astronote/lib/main.dart

34 lines
1.1 KiB
Dart
Raw Normal View History

2020-08-06 16:25:47 +02:00
import 'file:///D:/AndroidStudioProjects/astronote_app/lib/services/log_in_services.dart';
import 'package:astronote_app/themes/style.dart';
import 'package:astronote_app/views/company_choice.dart';
import 'package:astronote_app/views/dashboard.dart';
import 'package:astronote_app/views/log_in.dart';
2020-07-12 23:56:06 +02:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
2020-07-12 23:56:06 +02:00
void main() => runApp(MyApp());
2020-07-12 23:56:06 +02:00
class MyApp extends StatelessWidget {
2020-08-06 16:25:47 +02:00
// This widget is the root of your application.
2020-07-12 23:56:06 +02:00
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: LogIn()),
],
child: Consumer<LogIn>(
builder:(context, logIn, _) => MaterialApp(
debugShowCheckedModeBanner: false,
theme: appTheme(),
2020-08-06 16:25:47 +02:00
home: logIn.isLog ? CompanyChoiceView() : LogInView(),
routes: {
2020-08-06 16:25:47 +02:00
"/logInScreen": (context) => LogInView(),
"/companyChoiceScreen": (context) => CompanyChoiceView(),
"/dashboardScreen": (context) => DashBoardView()
},
),
),
2020-07-31 17:30:32 +02:00
);
2020-07-12 23:56:06 +02:00
}
}