Skip to content

Instantly share code, notes, and snippets.

@WinXaito
Created October 22, 2021 14:38
Show Gist options
  • Save WinXaito/b8977d35245844b1fafd7b89b413b688 to your computer and use it in GitHub Desktop.
Save WinXaito/b8977d35245844b1fafd7b89b413b688 to your computer and use it in GitHub Desktop.
With material
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