Skip to content

Instantly share code, notes, and snippets.

@Schwusch
Created December 14, 2022 18:41
Show Gist options
  • Save Schwusch/abdbc15ac0ee6571e8725825a2ef0770 to your computer and use it in GitHub Desktop.
Save Schwusch/abdbc15ac0ee6571e8725825a2ef0770 to your computer and use it in GitHub Desktop.
quintessential-glacier-6695

quintessential-glacier-6695

Created with <3 with dartpad.dev.

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