mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +08:00
Add a new Git app for testing the git commands
This commit is contained in:
53
lib/gitapp.dart
Normal file
53
lib/gitapp.dart
Normal file
@ -0,0 +1,53 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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("Remove Directory"),
|
||||
onPressed: () {
|
||||
print("FOO");
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("Git Clone"),
|
||||
onPressed: () async {
|
||||
await gitClone();
|
||||
},
|
||||
),
|
||||
RaisedButton(
|
||||
child: Text("New File"),
|
||||
onPressed: () {
|
||||
print("FOO");
|
||||
},
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Future gitClone() async {
|
||||
const platform = const MethodChannel('samples.flutter.io/battery');
|
||||
|
||||
print("Going to git clone");
|
||||
await platform.invokeMethod('gitClone', {
|
||||
'cloneUrl': "root@bcn.vhanda.in:git/notes",
|
||||
'filePath': "/",
|
||||
});
|
||||
print("FOO");
|
||||
}
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
//import 'package:http/http.dart' as http;
|
||||
|
||||
import 'package:journal/app.dart';
|
||||
import 'package:journal/gitapp.dart';
|
||||
import 'package:journal/state_container.dart';
|
||||
|
||||
/*
|
||||
@ -22,6 +23,6 @@ Future<List<Note>> fetchNotes() async {
|
||||
|
||||
void main() {
|
||||
runApp(new StateContainer(
|
||||
child: JournalApp(),
|
||||
child: GitApp(),
|
||||
));
|
||||
}
|
||||
|
Reference in New Issue
Block a user