mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00

For now I've mostly tried to follow the same style guide as the flutter repository, with many options disabled. Eventually, maybe it would make sense to be far stricter.
52 lines
1.6 KiB
Dart
52 lines
1.6 KiB
Dart
import 'package:firebase_analytics/firebase_analytics.dart';
|
|
import 'package:firebase_analytics/observer.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:journal/screens/home_screen.dart';
|
|
import 'package:journal/screens/settings_screen.dart';
|
|
import 'package:journal/state_container.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'screens/githostsetup_screens.dart';
|
|
|
|
class JournalApp extends StatelessWidget {
|
|
static FirebaseAnalytics analytics = FirebaseAnalytics();
|
|
static FirebaseAnalyticsObserver observer =
|
|
FirebaseAnalyticsObserver(analytics: analytics);
|
|
|
|
static bool get isInDebugMode {
|
|
bool inDebugMode = false;
|
|
assert(inDebugMode = true);
|
|
return inDebugMode;
|
|
}
|
|
|
|
static SharedPreferences preferences;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var stateContainer = StateContainer.of(context);
|
|
var onCompleted = () {
|
|
stateContainer.completeGitHostSetup();
|
|
};
|
|
|
|
return MaterialApp(
|
|
title: 'GitJournal',
|
|
theme: ThemeData(
|
|
brightness: Brightness.light,
|
|
primaryColor: Color(0xFF66bb6a),
|
|
primaryColorLight: Color(0xFF98ee99),
|
|
primaryColorDark: Color(0xFF338a3e),
|
|
accentColor: Color(0xff6d4c41),
|
|
),
|
|
navigatorObservers: <NavigatorObserver>[JournalApp.observer],
|
|
initialRoute: '/',
|
|
routes: {
|
|
'/': (context) => HomeScreen(),
|
|
'/settings': (context) => SettingsScreen(),
|
|
'/setupRemoteGit': (context) => GitHostSetupScreen(onCompleted),
|
|
},
|
|
debugShowCheckedModeBanner: false,
|
|
//debugShowMaterialGrid: true,
|
|
);
|
|
}
|
|
}
|