2019-01-29 12:41:24 +01:00
|
|
|
import 'dart:io';
|
2018-04-18 14:38:28 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2019-01-22 16:39:44 +01:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2019-01-29 06:34:52 +01:00
|
|
|
import 'package:git_flux/providers/providers.dart';
|
2019-01-30 07:46:18 +01:00
|
|
|
import 'package:git_flux/providers/settings.dart';
|
2019-01-29 12:41:24 +01:00
|
|
|
import 'package:git_flux/ios/ios.dart';
|
|
|
|
import 'package:git_flux/android/android.dart';
|
2018-04-18 14:38:28 +02:00
|
|
|
|
2018-04-25 15:07:44 +02:00
|
|
|
class App extends StatelessWidget {
|
2019-01-29 12:41:24 +01:00
|
|
|
final isIos = Platform.isIOS;
|
2019-01-30 07:46:18 +01:00
|
|
|
final SettingsBloc settingsBloc;
|
2019-01-23 09:50:51 +01:00
|
|
|
final NotificationBloc notificationBloc;
|
2019-01-23 12:52:51 +01:00
|
|
|
final SearchBloc searchBloc;
|
2019-01-23 09:50:51 +01:00
|
|
|
|
2019-01-30 07:46:18 +01:00
|
|
|
App(this.settingsBloc, this.notificationBloc, this.searchBloc);
|
2018-04-25 15:07:44 +02:00
|
|
|
|
2019-01-29 12:41:24 +01:00
|
|
|
_buildScreen() {
|
|
|
|
// return IssueScreen(11609, 'flutter', 'flutter');
|
|
|
|
|
|
|
|
// return IosHome();
|
|
|
|
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
return IosHome();
|
|
|
|
} else if (Platform.isAndroid) {
|
|
|
|
return AndroidHome();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-25 15:07:44 +02:00
|
|
|
@override
|
|
|
|
build(context) {
|
2019-01-23 12:52:51 +01:00
|
|
|
return SearchProvider(
|
|
|
|
bloc: searchBloc,
|
|
|
|
child: NotificationProvider(
|
|
|
|
bloc: notificationBloc,
|
|
|
|
child: EventProvider(
|
2019-01-30 07:46:18 +01:00
|
|
|
bloc: settingsBloc,
|
2019-01-23 12:52:51 +01:00
|
|
|
child: MaterialApp(
|
|
|
|
home: DefaultTextStyle(
|
2019-01-26 15:10:18 +01:00
|
|
|
style: TextStyle(color: Color(0xff24292e)),
|
2019-01-29 12:41:24 +01:00
|
|
|
child: _buildScreen(),
|
2019-01-23 12:52:51 +01:00
|
|
|
),
|
2019-01-25 13:35:20 +01:00
|
|
|
// theme: ThemeData(
|
|
|
|
// textTheme: TextTheme(
|
|
|
|
// title: TextStyle(color: Colors.red),
|
|
|
|
// ),
|
|
|
|
// ),
|
2019-01-23 09:50:51 +01:00
|
|
|
),
|
|
|
|
),
|
2019-01-22 16:39:44 +01:00
|
|
|
),
|
2018-04-25 15:07:44 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 12:41:24 +01:00
|
|
|
void main() async {
|
2019-01-30 07:46:18 +01:00
|
|
|
SettingsBloc eventBloc = SettingsBloc();
|
2019-01-23 09:50:51 +01:00
|
|
|
NotificationBloc notificationBloc = NotificationBloc();
|
2019-01-23 12:52:51 +01:00
|
|
|
SearchBloc searchBloc = SearchBloc();
|
2019-01-23 09:50:51 +01:00
|
|
|
|
2019-01-29 12:41:24 +01:00
|
|
|
// DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
|
|
|
// AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
|
|
|
// print('Running on ${androidInfo.model}'); // e.g. "Moto G (4)"
|
|
|
|
|
|
|
|
// IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
|
|
|
|
// print('Running on ${iosInfo.utsname.machine}'); // e.g. "iPod7,1"
|
|
|
|
|
2019-01-23 12:52:51 +01:00
|
|
|
runApp(App(eventBloc, notificationBloc, searchBloc));
|
2019-01-23 09:50:51 +01:00
|
|
|
}
|