2018-04-18 20:38:28 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2019-01-22 23:39:44 +08:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-01-14 18:13:07 +08:00
|
|
|
import 'package:git_touch/app.dart';
|
2019-09-15 17:36:09 +08:00
|
|
|
import 'package:git_touch/models/code.dart';
|
2019-09-27 20:52:38 +08:00
|
|
|
import 'package:git_touch/models/auth.dart';
|
2019-09-02 21:52:32 +08:00
|
|
|
import 'package:git_touch/models/theme.dart';
|
2020-02-01 13:26:14 +08:00
|
|
|
import 'package:git_touch/router.dart';
|
2019-09-02 20:40:20 +08:00
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:git_touch/models/notification.dart';
|
2019-12-12 20:29:56 +08:00
|
|
|
import 'package:fluro/fluro.dart';
|
2020-04-30 08:18:42 +05:30
|
|
|
import 'package:flutter/services.dart';
|
2021-06-14 14:35:10 +08:00
|
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
2018-04-18 20:38:28 +08:00
|
|
|
|
2019-01-29 19:41:24 +08:00
|
|
|
void main() async {
|
2021-06-14 14:35:10 +08:00
|
|
|
await SentryFlutter.init(
|
|
|
|
(options) {
|
|
|
|
options.dsn =
|
|
|
|
'https://006354525fa244289c48169790fa3757@o71119.ingest.sentry.io/5814819';
|
|
|
|
},
|
|
|
|
// Init your App.
|
|
|
|
appRunner: () async {
|
|
|
|
final notificationModel = NotificationModel();
|
|
|
|
final themeModel = ThemeModel();
|
|
|
|
final authModel = AuthModel();
|
|
|
|
final codeModel = CodeModel();
|
|
|
|
await Future.wait([
|
|
|
|
themeModel.init(),
|
|
|
|
authModel.init(),
|
|
|
|
codeModel.init(),
|
|
|
|
]);
|
2019-02-07 14:35:19 +08:00
|
|
|
|
2021-06-14 14:35:10 +08:00
|
|
|
CommonRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(CommonRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
GitlabRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(GitlabRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
GiteaRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(GiteaRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
BitbucketRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(BitbucketRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
GithubRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(GithubRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
GiteeRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(GiteeRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
GogsRouter.routes.forEach((screen) {
|
|
|
|
themeModel.router.define(GogsRouter.prefix + screen.path,
|
|
|
|
handler: Handler(handlerFunc: screen.handler));
|
|
|
|
});
|
|
|
|
// To match status bar color to app bar color
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
|
|
|
statusBarColor: Colors.transparent,
|
|
|
|
));
|
2019-01-23 16:50:51 +08:00
|
|
|
|
2021-06-14 14:35:10 +08:00
|
|
|
runApp(MultiProvider(
|
|
|
|
providers: [
|
|
|
|
ChangeNotifierProvider(create: (context) => notificationModel),
|
|
|
|
ChangeNotifierProvider(create: (context) => themeModel),
|
|
|
|
ChangeNotifierProvider(create: (context) => authModel),
|
|
|
|
ChangeNotifierProvider(create: (context) => codeModel),
|
|
|
|
],
|
|
|
|
child: MyApp(),
|
|
|
|
));
|
|
|
|
},
|
|
|
|
);
|
2019-01-23 16:50:51 +08:00
|
|
|
}
|