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-22 12:41:12 +01:00
|
|
|
// import 'dart:io';
|
|
|
|
// import 'package:graphql_flutter/graphql_flutter.dart';
|
2019-01-22 16:39:44 +01:00
|
|
|
// import 'android/main.dart';
|
2018-04-20 18:59:26 +02:00
|
|
|
import 'ios/main.dart';
|
2019-01-22 12:41:12 +01:00
|
|
|
// import 'token.dart';
|
2019-01-23 09:50:51 +01:00
|
|
|
import 'providers/event.dart';
|
|
|
|
import 'providers/notification.dart';
|
2018-04-18 14:38:28 +02:00
|
|
|
|
2018-04-25 15:07:44 +02:00
|
|
|
class App extends StatelessWidget {
|
2019-01-22 12:41:12 +01:00
|
|
|
final isIos = true;
|
2019-01-23 09:50:51 +01:00
|
|
|
final EventBloc eventBloc;
|
|
|
|
final NotificationBloc notificationBloc;
|
|
|
|
|
|
|
|
App(this.eventBloc, this.notificationBloc);
|
2019-01-22 12:41:12 +01:00
|
|
|
|
|
|
|
// final ValueNotifier<GraphQLClient> client = ValueNotifier(
|
|
|
|
// GraphQLClient(
|
|
|
|
// cache: InMemoryCache(),
|
|
|
|
// link: HttpLink(
|
|
|
|
// uri: 'https://api.github.com/graphql',
|
|
|
|
// headers: {HttpHeaders.authorizationHeader: 'token $token'},
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// );
|
2018-04-25 15:07:44 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
build(context) {
|
2019-01-23 09:50:51 +01:00
|
|
|
return NotificationProvider(
|
|
|
|
bloc: notificationBloc,
|
|
|
|
child: EventProvider(
|
|
|
|
bloc: eventBloc,
|
|
|
|
child: MaterialApp(
|
|
|
|
title: 'GitFlux',
|
|
|
|
theme: ThemeData(
|
|
|
|
primarySwatch: Colors.blue,
|
|
|
|
),
|
|
|
|
home: DefaultTextStyle(
|
|
|
|
style: TextStyle(color: CupertinoColors.black),
|
|
|
|
child: IosHomePage(title: 'GitFlux'),
|
|
|
|
),
|
|
|
|
routes: {
|
|
|
|
// '/notification': (context) => IosNotificationTab(),
|
|
|
|
// '/profile': (context) => IosProfileTab(),
|
|
|
|
},
|
|
|
|
),
|
2019-01-22 16:39:44 +01:00
|
|
|
),
|
2018-04-25 15:07:44 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-23 09:50:51 +01:00
|
|
|
void main() {
|
|
|
|
EventBloc eventBloc = EventBloc();
|
|
|
|
NotificationBloc notificationBloc = NotificationBloc();
|
|
|
|
|
|
|
|
runApp(App(eventBloc, notificationBloc));
|
|
|
|
}
|