Skip to content

Instantly share code, notes, and snippets.

@metal-young
Created May 29, 2023 14:35
Show Gist options
  • Save metal-young/ff7acbbeebb276ffec4ab393585648bc to your computer and use it in GitHub Desktop.
Save metal-young/ff7acbbeebb276ffec4ab393585648bc to your computer and use it in GitHub Desktop.
cylindrical-charm-4575

cylindrical-charm-4575

Created with <3 with dartpad.dev.

import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Scaffold Example',
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Scaffold Example'),
),
body: Center(
child: Text('Hello, World!'),
),
drawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Item 1'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: Text('Item 2'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.navigation),
backgroundColor: Colors.green,
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.business),
label: 'Business',
),
BottomNavigationBarItem(
icon: Icon(Icons.school),
label: 'School',
),
],
),
backgroundColor: Colors.white,
endDrawer: Drawer(
child: ListView(
children: <Widget>[
DrawerHeader(
child: Text('End Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
),
),
ListTile(
title: Text('Item 1'),
onTap: () {
Navigator.pop(context);
},
),
ListTile(
title: Text('Item 2'),
onTap: () {
Navigator.pop(context);
},
),
],
),
),
bottomSheet: BottomSheet(
onClosing: () {},
builder: (BuildContext context) {
return Container(
height: 200,
color: Colors.blue,
child: Center(
child: Text('Hello, World!'),
),
);
},
),
);
}
}
@metal-young
Copy link
Author

metal-young commented May 29, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment