49 lines
1.2 KiB
Dart
49 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MainLayout extends StatelessWidget {
|
|
const MainLayout({
|
|
Key? key,
|
|
this.body,
|
|
}) : super(key: key);
|
|
|
|
final Widget? body;
|
|
|
|
void _onItemTapped(int index) {
|
|
// Navigate to the second screen using a named route.
|
|
// Navigator.pushNamed(context, '/second');
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: body,
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
items: const <BottomNavigationBarItem>[
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.home),
|
|
label: 'Home',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.map),
|
|
label: 'Map',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.perm_identity),
|
|
label: 'Meal Card',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.calendar_month),
|
|
label: 'Events',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.info_outline),
|
|
label: 'Info',
|
|
),
|
|
],
|
|
currentIndex: 0,
|
|
selectedItemColor: Colors.grey[700],
|
|
onTap: _onItemTapped,
|
|
),
|
|
);
|
|
}
|
|
} |