2019-01-22 20:20:10 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2019-05-08 18:54:14 +00:00
|
|
|
import 'package:local_spend/pages/home_page.dart';
|
|
|
|
import 'package:local_spend/pages/login_page.dart';
|
2019-08-21 13:53:52 +00:00
|
|
|
import 'package:local_spend/pages/map_page.dart';
|
2019-08-05 08:33:39 +00:00
|
|
|
import 'package:local_spend/pages/receipt_page_2.dart';
|
2019-05-08 18:54:14 +00:00
|
|
|
import 'package:local_spend/pages/spash_screen.dart';
|
2019-07-16 14:12:16 +00:00
|
|
|
import 'package:local_spend/pages/more_page.dart';
|
2019-07-05 12:39:24 +00:00
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
2019-08-27 10:00:57 +00:00
|
|
|
import 'package:local_spend/common/apifunctions/get_graph_data.dart';
|
2020-10-14 12:43:09 +00:00
|
|
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
2019-01-22 20:20:10 +00:00
|
|
|
|
2019-05-08 18:54:14 +00:00
|
|
|
void main() {
|
2020-10-14 12:43:09 +00:00
|
|
|
runApp(
|
|
|
|
MyApp()
|
|
|
|
);
|
2019-05-08 18:54:14 +00:00
|
|
|
}
|
2019-01-22 20:20:10 +00:00
|
|
|
|
2019-09-02 11:57:14 +00:00
|
|
|
void loadGraphs() {}
|
2019-08-27 10:00:57 +00:00
|
|
|
|
|
|
|
class GraphWithTitle {
|
2019-09-02 11:57:14 +00:00
|
|
|
GraphWithTitle({this.graph, this.title});
|
2019-08-27 10:00:57 +00:00
|
|
|
|
|
|
|
GraphData graph;
|
|
|
|
String title;
|
|
|
|
}
|
|
|
|
|
2019-01-22 20:20:10 +00:00
|
|
|
class MyApp extends StatelessWidget {
|
2020-10-14 12:43:09 +00:00
|
|
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
2019-01-22 20:20:10 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-09-02 11:57:14 +00:00
|
|
|
// TODO: load graphs on app login and send to graph widgets
|
2019-08-27 10:00:57 +00:00
|
|
|
|
2020-10-14 12:43:09 +00:00
|
|
|
_firebaseMessaging.configure(
|
|
|
|
onMessage: (Map<String, dynamic> message) async {
|
|
|
|
print('onMessage: $message');
|
|
|
|
},
|
|
|
|
onLaunch: (Map<String, dynamic> message) async {
|
|
|
|
print('onLaunch: $message');
|
|
|
|
},
|
|
|
|
onResume: (Map<String, dynamic> message) async {
|
|
|
|
print('onResume: $message');
|
|
|
|
},
|
|
|
|
);
|
|
|
|
|
|
|
|
// Required on iOS; non-op on Android.
|
|
|
|
_firebaseMessaging.requestNotificationPermissions();
|
|
|
|
|
|
|
|
return MaterialApp(
|
2019-07-18 09:26:37 +00:00
|
|
|
debugShowCheckedModeBanner: false,
|
2019-07-05 12:39:24 +00:00
|
|
|
localizationsDelegates: [
|
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
|
|
|
],
|
2020-10-14 12:43:09 +00:00
|
|
|
supportedLocales: [Locale('en')],
|
|
|
|
title: 'Local Spend Tracker',
|
|
|
|
theme: ThemeData(
|
2019-05-10 11:51:11 +00:00
|
|
|
primarySwatch: Colors.blueGrey,
|
|
|
|
),
|
2019-05-08 18:54:14 +00:00
|
|
|
routes: <String, WidgetBuilder>{
|
2020-10-14 12:43:09 +00:00
|
|
|
'/HomePage': (BuildContext context) => HomePage(),
|
|
|
|
'/LoginPage': (BuildContext context) => LoginPage(),
|
2019-09-02 11:57:14 +00:00
|
|
|
'/MapPage': (BuildContext context) => MapPage(),
|
2020-10-14 12:43:09 +00:00
|
|
|
'/ReceiptPage': (BuildContext context) => ReceiptPage2(),
|
|
|
|
'/MorePage': (BuildContext context) => MorePage(),
|
2019-05-08 18:54:14 +00:00
|
|
|
},
|
|
|
|
home: SplashScreen(),
|
2019-01-22 20:20:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|