gecko/lib/main.dart

59 lines
1.4 KiB
Dart
Raw Normal View History

import 'package:gecko/ui/home.dart';
2020-12-13 05:43:52 +01:00
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
2020-12-21 03:59:25 +01:00
import 'package:graphql_flutter/graphql_flutter.dart';
2021-01-06 05:04:54 +01:00
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:flutter/foundation.dart';
2021-01-06 05:04:54 +01:00
// void main() => runApp(Gecko());
Future<void> main() async {
if (kReleaseMode) {
await SentryFlutter.init(
(options) {
options.dsn =
'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110';
},
appRunner: () => runApp(Gecko()),
);
} else {
2021-01-08 00:16:24 +01:00
print('Debug mode enabled: No sentry alerte');
runApp(Gecko());
}
2021-01-06 05:04:54 +01:00
}
2020-12-13 05:43:52 +01:00
2020-12-21 01:05:00 +01:00
class Gecko extends StatelessWidget {
2020-12-13 05:43:52 +01:00
@override
Widget build(BuildContext context) {
2020-12-21 03:59:25 +01:00
final _httpLink = HttpLink(
// 'http://192.168.1.91:10060/gva',
'https://g1.librelois.fr/gva',
2020-12-21 03:59:25 +01:00
);
final _client = ValueNotifier(
GraphQLClient(
cache: GraphQLCache(store: null),
2020-12-21 03:59:25 +01:00
link: _httpLink,
),
);
2020-12-13 05:43:52 +01:00
return MaterialApp(
2020-12-21 01:05:00 +01:00
title: 'Ğecko',
theme: ThemeData(
primaryColor: Color(0xffD28928),
accentColor: Color(0xffFFD68E),
textTheme: TextTheme(
bodyText1: TextStyle(),
bodyText2: TextStyle(),
).apply(
bodyColor: Color(0xff855F2D),
// displayColor: Colors.blue,
),
),
2020-12-21 03:59:25 +01:00
home: GraphQLProvider(
client: _client,
2021-01-06 05:04:54 +01:00
child: HomeScreen(),
2020-12-21 03:59:25 +01:00
),
);
2020-12-13 05:43:52 +01:00
}
}