43 lines
1.3 KiB
Dart
43 lines
1.3 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:voyagehandbook/views/home.dart';
|
||
|
|
||
|
import '../views/search.dart';
|
||
|
|
||
|
Drawer genDrawer(int page, BuildContext context) => Drawer(
|
||
|
child: ListView(
|
||
|
children: [
|
||
|
DrawerHeader(
|
||
|
child: Column(
|
||
|
children: const [
|
||
|
Text("Voyage Handbook"),
|
||
|
Text("Created by Matyáš Caras")
|
||
|
],
|
||
|
)),
|
||
|
ListTile(
|
||
|
selected: page == 1,
|
||
|
title: const Text("Home"),
|
||
|
leading: const Icon(Icons.home),
|
||
|
onTap: () => page == 1
|
||
|
? Navigator.of(context).pop()
|
||
|
: Navigator.of(context).push(
|
||
|
MaterialPageRoute(
|
||
|
builder: (_) => const HomeView(),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
ListTile(
|
||
|
selected: page == 2,
|
||
|
title: const Text("Search"),
|
||
|
leading: const Icon(Icons.search),
|
||
|
onTap: () => page == 2
|
||
|
? Navigator.of(context).pop()
|
||
|
: Navigator.of(context).push(
|
||
|
MaterialPageRoute(
|
||
|
builder: (_) => const SearchView(),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
);
|