The official document: API. Flutter. Dev/flutter/dar…
Dartpad Example: dartpad.dev/ 53049AC9419…
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
var colorBlendMode = [
BlendMode.clear,
BlendMode.src,
BlendMode.dst,
BlendMode.srcOver,
BlendMode.dstOver,
BlendMode.srcIn,
BlendMode.dstIn,
BlendMode.srcOut,
BlendMode.dstOut,
BlendMode.srcATop,
BlendMode.dstATop,
BlendMode.xor,
BlendMode.plus,
BlendMode.modulate,
BlendMode.screen,
BlendMode.overlay,
BlendMode.darken,
BlendMode.lighten,
BlendMode.colorDodge,
BlendMode.colorBurn,
BlendMode.hardLight,
BlendMode.softLight,
BlendMode.difference,
BlendMode.exclusion,
BlendMode.multiply,
BlendMode.hue,
BlendMode.saturation,
BlendMode.color,
BlendMode.luminosity,
];
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: GridView.count(
crossAxisCount: 4,
children: <Widget>[
for (var mode in colorBlendMode)
GridTile(
child: Image.network(
'https://raw.githubusercontent.com/flutter/flutter/master/dev/docs/favicon.ico',
color: Colors.amber,
colorBlendMode: mode,
),
footer: Text('${mode.toString()}'),),),),); }}Copy the code
Reference:
https://juejin.cn/post/6844903885908213768