Created
February 16, 2020 14:30
-
-
Save ryanlid/43cc789fd7567ca828c231fc507245b0 to your computer and use it in GitHub Desktop.
Opacity 透明度
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
title: "Opacity不透明度示例", | |
home: LayoutDemo(), | |
), | |
); | |
} | |
class LayoutDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("Opaxity 不透明度示例"), | |
), | |
body: Center( | |
child: Opacity( | |
opacity: 0.3, | |
child: Container( | |
width: 250.0, | |
height: 100.0, | |
decoration: BoxDecoration(color: Colors.black), | |
child: Text( | |
"不透明度0.3", | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 28.0, | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment