git-touch-android-ios-app/lib/main.dart

68 lines
1.9 KiB
Dart
Raw Normal View History

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';
import 'package:git_touch/providers/providers.dart';
import 'package:git_touch/providers/settings.dart';
import 'package:git_touch/ios/ios.dart';
import 'package:git_touch/android/android.dart';
2018-04-18 14:38:28 +02:00
class App extends StatelessWidget {
final isIos = Platform.isIOS;
2019-01-30 07:46:18 +01:00
final SettingsBloc settingsBloc;
final NotificationBloc notificationBloc;
2019-01-23 12:52:51 +01:00
final SearchBloc searchBloc;
2019-01-30 07:46:18 +01:00
App(this.settingsBloc, this.notificationBloc, this.searchBloc);
_buildScreen() {
// return IssueScreen(11609, 'flutter', 'flutter');
// return IosHome();
if (Platform.isIOS) {
return IosHome();
} else if (Platform.isAndroid) {
return AndroidHome();
}
}
@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(
style: TextStyle(color: Color(0xff24292e)),
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-22 16:39:44 +01:00
),
);
}
}
void main() async {
2019-01-30 07:46:18 +01:00
SettingsBloc eventBloc = SettingsBloc();
NotificationBloc notificationBloc = NotificationBloc();
2019-01-23 12:52:51 +01:00
SearchBloc searchBloc = SearchBloc();
// 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));
}