Created
August 2, 2023 10:08
-
-
Save ashishbeck/c0c87fc478d6524afc9a5e64d253d787 to your computer and use it in GitHub Desktop.
Flutter layout
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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar(title: const Text('Layout Builder Example')), | |
body: Center( | |
child: Container( | |
color: Colors.blue, | |
width: 200, | |
height: 200, | |
child: LayoutBuilder( | |
builder: (context, constraints) { | |
return Container( | |
width: 300, | |
height: 100, | |
color: Colors.red, | |
); | |
}, | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment