Created
May 7, 2020 16:10
-
-
Save CoderJava/8f64c9d7d3fec54c582d3007bdfb0f8c to your computer and use it in GitHub Desktop.
Widget Stack
This file contains hidden or 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(App()); | |
| class App extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| home: HomePage(), | |
| ); | |
| } | |
| } | |
| class HomePage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text('Flutter Demo'), | |
| ), | |
| body: Stack( | |
| children: <Widget>[ | |
| Container( | |
| width: 200.0, | |
| height: 200.0, | |
| color: Colors.red, | |
| ), | |
| Container( | |
| width: 180.0, | |
| height: 180.0, | |
| color: Colors.green, | |
| ), | |
| Container( | |
| width: 160.0, | |
| height: 160.0, | |
| color: Colors.orange, | |
| ), | |
| Align( | |
| alignment: Alignment.center, | |
| child: Text('Center'), | |
| ), | |
| Positioned( | |
| right: 24.0, | |
| child: Text('Right 24'), | |
| ), | |
| ], | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment