Created with <3 with dartpad.dev.
Created
December 14, 2022 18:41
-
-
Save Schwusch/abdbc15ac0ee6571e8725825a2ef0770 to your computer and use it in GitHub Desktop.
quintessential-glacier-6695
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(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( | |
useMaterial3: true | |
), | |
home: const NavRailExample(), | |
); | |
} | |
} | |
class NavRailExample extends StatefulWidget { | |
const NavRailExample({super.key}); | |
@override | |
State<NavRailExample> createState() => _NavRailExampleState(); | |
} | |
class _NavRailExampleState extends State<NavRailExample> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Row( | |
children: <Widget>[ | |
NavigationRail( | |
selectedIndex: 0, | |
extended: true, | |
destinations: const <NavigationRailDestination>[ | |
NavigationRailDestination( | |
icon: Icon(Icons.favorite_border), | |
selectedIcon: Icon(Icons.favorite), | |
label: Text('First'), | |
), | |
NavigationRailDestination( | |
icon: Icon(Icons.bookmark_border), | |
selectedIcon: Icon(Icons.book), | |
label: Text('Second'), | |
), | |
], | |
), | |
const VerticalDivider(thickness: 1, width: 1), | |
Container(), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment