Remove onboarding screen

For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.

This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
This commit is contained in:
Vishesh Handa
2019-01-21 13:43:33 +01:00
parent c915e58273
commit 519de8fcff
12 changed files with 239 additions and 76 deletions

View File

@ -6,6 +6,7 @@ import 'package:flutter_crashlytics/flutter_crashlytics.dart';
import 'package:journal/app.dart';
import 'package:journal/state_container.dart';
import 'package:journal/storage/git.dart';
void main() async {
bool isInDebugMode = true;
@ -30,7 +31,11 @@ void main() async {
Future runJournalApp() async {
var pref = await SharedPreferences.getInstance();
var onBoardingCompleted = pref.getBool("onBoardingCompleted") ?? false;
var localGitRepoConfigured = pref.getBool("localGitRepoConfigured") ?? false;
var remoteGitRepoConfigured =
pref.getBool("remoteGitRepoConfigured") ?? false;
var localGitRepoPath = pref.getString("localGitRepoPath") ?? "";
var remoteGitRepoPath = pref.getString("remoteGitRepoPath") ?? "";
if (JournalApp.isInDebugMode) {
if (JournalApp.analytics.android != null) {
@ -38,8 +43,25 @@ Future runJournalApp() async {
}
}
if (localGitRepoConfigured == false) {
// FIXME: What about exceptions!
localGitRepoPath = "journal_local";
await gitInit(localGitRepoPath);
localGitRepoConfigured = true;
await pref.setBool("localGitRepoConfigured", localGitRepoConfigured);
await pref.setString("localGitRepoPath", localGitRepoPath);
}
var dir = await getGitBaseDirectory();
runApp(new StateContainer(
onBoardingCompleted: onBoardingCompleted,
localGitRepoConfigured: localGitRepoConfigured,
remoteGitRepoConfigured: remoteGitRepoConfigured,
localGitRepoPath: localGitRepoPath,
remoteGitRepoPath: remoteGitRepoPath,
gitBaseDirectory: dir.path,
child: JournalApp(),
));
}