Files
GitJournal/lib/gitapp.dart
Vishesh Handa 4bb02b12d6 Hookup the Journal app to git
Now notes are saved in the git repo, and immediately synced. This is not
the best implementation, as the notes are being reloaded a lot, and
the error handling is terrible (I miss golang). But it's the first
working poc.
2019-01-09 12:55:53 +01:00

63 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:journal/storage/git.dart';
class GitApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Git App',
home: Scaffold(
appBar: AppBar(
title: Text('Git Test'),
),
body: Column(
children: buildGitButtons(),
),
),
);
}
}
buildGitButtons() {
return <Widget>[
RaisedButton(
child: Text("Generate Keys"),
onPressed: generateSSHKeys,
),
RaisedButton(
child: Text("Git Clone"),
onPressed: () async {
gitClone("root@bcn.vhanda.in:git/test", "journal");
},
),
RaisedButton(
child: Text("Git Pull"),
onPressed: () async {
gitPull("journal");
},
),
RaisedButton(
child: Text("Git Add"),
onPressed: () async {
await gitAdd("journal", "1");
},
),
RaisedButton(
child: Text("Git Push"),
onPressed: () async {
gitPush("journal");
},
),
RaisedButton(
child: Text("Git Commit"),
onPressed: () async {
gitCommit(
gitFolder: "journal",
authorEmail: "noemail@example.com",
authorName: "Vishesh Handa",
message: "Default message from GitJournal",
);
}),
];
}