Created with <3 with dartpad.dev.
Created
May 29, 2023 14:35
-
-
Save metal-young/ff7acbbeebb276ffec4ab393585648bc to your computer and use it in GitHub Desktop.
cylindrical-charm-4575
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() { | |
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!'), | |
), | |
); | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
view dartpad.dev/