mirror of
https://github.com/rainloreley/shlink-manager.git
synced 2024-11-13 23:05:14 +01:00
36 lines
1004 B
Dart
36 lines
1004 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shlink_app/HomeView.dart';
|
|
import 'package:shlink_app/URLListView.dart';
|
|
|
|
class NavigationBarView extends StatefulWidget {
|
|
const NavigationBarView({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<NavigationBarView> createState() => _NavigationBarViewState();
|
|
}
|
|
|
|
class _NavigationBarViewState extends State<NavigationBarView> {
|
|
|
|
final List<Widget> views = [HomeView(), URLListView()];
|
|
int _selectedView = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: views.elementAt(_selectedView),
|
|
bottomNavigationBar: NavigationBar(
|
|
destinations: [
|
|
NavigationDestination(icon: Icon(Icons.home), label: "Home"),
|
|
NavigationDestination(icon: Icon(Icons.link), label: "Short URLs")
|
|
],
|
|
selectedIndex: _selectedView,
|
|
onDestinationSelected: (int index) {
|
|
setState(() {
|
|
_selectedView = index;
|
|
});
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|