lbry-sdk/dart/packages/ver/lib/main.dart

84 lines
2.7 KiB
Dart
Raw Normal View History

2019-07-10 03:10:37 +02:00
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart' show debugDefaultTargetPlatformOverride;
2019-07-15 07:11:44 +02:00
import 'package:provider/provider.dart';
import 'package:ver/src/servers.dart';
import 'package:ver/src/models/server.dart';
2019-07-10 23:28:02 +02:00
import 'package:ver/utils.dart';
2019-07-10 03:10:37 +02:00
2019-07-15 07:11:44 +02:00
class UnderConstructionPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Under Construction')),
body: SizedBox.expand(
child: Center(child: Text('Under Construction')),
),
);
}
2019-07-10 03:10:37 +02:00
}
2019-07-15 07:11:44 +02:00
class MainPage extends StatefulWidget {
@override
_MainPageState createState() => _MainPageState();
2019-07-10 03:10:37 +02:00
}
2019-07-10 23:28:02 +02:00
2019-07-15 07:11:44 +02:00
class _MainPageState extends State<MainPage> {
int _currentIndex = 3;
@override
Widget build(BuildContext context) {
return Scaffold(
body: IndexedStack(
index: _currentIndex,
children: [
UnderConstructionPage(),
UnderConstructionPage(),
UnderConstructionPage(),
ServersSectionNavigation(),
UnderConstructionPage(),
],
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(Icons.home), title: Text('Home')),
BottomNavigationBarItem(icon: Icon(Icons.trending_up), title: Text('Trending')),
BottomNavigationBarItem(icon: Icon(Icons.subscriptions), title: Text('Subscriptions')),
BottomNavigationBarItem(icon: Icon(Icons.router), title: Text('Servers')),
BottomNavigationBarItem(icon: Icon(Icons.folder), title: Text('Library')),
],
currentIndex: _currentIndex,
onTap: (int index) {
setState(() {
_currentIndex = index;
});
},
selectedItemColor: Colors.amber[800],
),
);
}
}
2019-07-10 23:28:02 +02:00
void main() {
2019-07-15 07:11:44 +02:00
debugDefaultTargetPlatformOverride = getTargetPlatformForDesktop();
runApp(
MaterialApp(
title: 'Ver',
theme: ThemeData(
brightness: Brightness.dark,
2019-07-16 21:21:41 +02:00
//primaryColor: Colors.lightBlue[800],
//accentColor: Colors.cyan[600],
2019-07-15 07:11:44 +02:00
fontFamily: 'Roboto',
),
home: MultiProvider(
providers: [
ChangeNotifierProvider<ServerManager>(builder: (context) => ServerManager())
],
child: MainPage()
)
)
);
2019-07-10 23:28:02 +02:00
}