mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
83 lines
2.4 KiB
Dart
83 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:journal/state_container.dart';
|
|
import 'package:share/share.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
class AppDrawer extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget setupGitButton = Container();
|
|
var appState = StateContainer.of(context).appState;
|
|
|
|
if (!appState.remoteGitRepoConfigured) {
|
|
setupGitButton = ListTile(
|
|
leading: Icon(Icons.sync),
|
|
title: Text('Setup Git Host'),
|
|
trailing: Icon(
|
|
Icons.info,
|
|
color: Colors.red,
|
|
),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
Navigator.pushNamed(context, "/setupRemoteGit");
|
|
},
|
|
);
|
|
}
|
|
|
|
return Drawer(
|
|
child: ListView(
|
|
// Important: Remove any padding from the ListView.
|
|
padding: EdgeInsets.zero,
|
|
children: <Widget>[
|
|
DrawerHeader(
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).buttonColor,
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
image: DecorationImage(
|
|
image: AssetImage('assets/icon/icon.png'),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
setupGitButton,
|
|
ListTile(
|
|
leading: Icon(Icons.share),
|
|
title: Text('Share App'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
Share.share('Checkout GitJournal https://gitjournal.io/');
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: Icon(Icons.feedback),
|
|
title: Text('Feedback'),
|
|
onTap: () {
|
|
var emailAddress = 'gitjournal.io@gmail.com';
|
|
var subject = 'GitJournal Feedback';
|
|
var body =
|
|
"Hey!\n\nHere are some ways to improve GitJournal - \n";
|
|
var url = 'mailto:$emailAddress?subject=$subject&body=$body';
|
|
launch(url);
|
|
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
ListTile(
|
|
leading: Icon(Icons.settings),
|
|
title: Text('Settings'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
Navigator.pushNamed(context, "/settings");
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|