Simple NavigationBar and placeholder map view
This commit is contained in:
41
lib/pages/main_navigation_scaffold.dart
Normal file
41
lib/pages/main_navigation_scaffold.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'landing_page.dart';
|
||||
import 'map_page.dart';
|
||||
|
||||
class MainNavigationScaffold extends StatefulWidget {
|
||||
const MainNavigationScaffold({super.key});
|
||||
static const routeName = '/';
|
||||
|
||||
@override
|
||||
State<MainNavigationScaffold> createState() => _MainNavigationScaffoldState();
|
||||
}
|
||||
|
||||
class _MainNavigationScaffoldState extends State<MainNavigationScaffold> {
|
||||
int _selectedPageIndex = 0;
|
||||
|
||||
final List<Widget> _pages = [
|
||||
const LandingPage(),
|
||||
const MapPage(),
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: _selectedPageIndex,
|
||||
onDestinationSelected: (value) => setState(() {
|
||||
_selectedPageIndex = value;
|
||||
}),
|
||||
destinations: [
|
||||
NavigationDestination(icon: Icon(Icons.list), label: 'List'),
|
||||
NavigationDestination(icon: Icon(Icons.map_outlined), label: 'Map'),
|
||||
],
|
||||
),
|
||||
body: IndexedStack(
|
||||
index: _selectedPageIndex,
|
||||
children: _pages,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user