Flutter ColorFiltered 将ColorFilter应用于其子级。

Example

<summary>main.dart</summary>
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ColorFiltered(
          colorFilter: ColorFilter.mode(Colors.pink[300], BlendMode.modulate),
          child: Image.network(
              "https://i.loli.net/2019/11/30/nBZehFardWu5pAV.jpg"),
        ),
      ),
    );
  }
}
posted @ 2019-12-12 12:03  Ajanuw  阅读(1752)  评论(0编辑  收藏  举报