toolheim/mobile-app/lib/main.dart

36 lines
1 KiB
Dart
Raw Normal View History

2019-06-24 00:53:43 +02:00
import 'package:flutter/material.dart';
import 'package:preferences/preferences.dart';
2019-07-10 14:16:13 +02:00
import 'package:provider/provider.dart';
import 'package:toolheim/data/github_adapter.dart';
import 'package:toolheim/screens/settings_screen.dart';
2019-08-07 14:55:33 +02:00
import 'package:toolheim/screens/unit_screen.dart';
import 'package:toolheim/screens/warband_roster_screen.dart';
2019-06-24 00:53:43 +02:00
void main() async {
await PrefService.init(prefix: 'toolheim_');
2019-07-10 14:16:13 +02:00
runApp(Toolheim());
}
2019-06-24 00:53:43 +02:00
class Toolheim extends StatelessWidget {
@override
Widget build(BuildContext context) {
2019-07-10 14:16:13 +02:00
return ChangeNotifierProvider(
builder: (context) => GitHubAdapter(),
child: MaterialApp(
2019-08-08 20:15:06 +02:00
debugShowCheckedModeBanner: false,
2019-07-10 14:16:13 +02:00
title: 'Toolheim',
theme: ThemeData(
primarySwatch: Colors.brown,
accentColor: Colors.grey,
),
2019-07-10 14:16:13 +02:00
initialRoute: '/',
routes: {
'/': (context) => WarbandRosterScreen(),
2019-08-07 14:55:33 +02:00
'/unit': (context) => UnitScreen(),
'/settings': (context) => SettingsScreen(),
2019-07-10 14:16:13 +02:00
},
2019-06-27 00:16:58 +02:00
),
2019-07-10 14:16:13 +02:00
);
2019-06-24 00:53:43 +02:00
}
}