一统天下 flutter - widget 容器类(只能有一个子): Opacity - 不透明度

源码 https://github.com/webabcd/flutter_demo
作者 webabcd

一统天下 flutter - widget 容器类(只能有一个子): Opacity - 不透明度

示例如下:

lib\widget\container\opacity.dart

/*
 * Opacity - 不透明度
 */

import 'package:flutter/material.dart';
import 'package:flutter_demo/helper.dart';

class OpacityDemo extends StatelessWidget {
  const OpacityDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: Opacity(
        /// opacity - 不透明度(0 - 1 之间)
        opacity: 0.3,
        child: MyText("webabcd"),
      ),
    );
  }
}

源码 https://github.com/webabcd/flutter_demo
作者 webabcd

posted @ 2023-03-22 10:25  webabcd  阅读(17)  评论(0编辑  收藏  举报