Created
October 22, 2021 14:38
-
-
Save WinXaito/b8977d35245844b1fafd7b89b413b688 to your computer and use it in GitHub Desktop.
With material
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() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
runApp(const Test()); | |
} | |
class Test extends StatefulWidget { | |
const Test({Key? key}) : super(key: key); | |
@override | |
State<StatefulWidget> createState() => _TestState(); | |
} | |
class _TestState extends State<Test> { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: const ExampleWidget(), | |
builder: (context, child) { | |
return Scaffold( | |
body: Column( | |
children: [ | |
Container(height: 40, color: Colors.red), | |
Expanded(child: child!), | |
], | |
), | |
); | |
}, | |
); | |
} | |
} | |
class ExampleWidget extends StatelessWidget { | |
const ExampleWidget({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
color: Colors.blue, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment