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.
65 lines
1.7 KiB
Dart
65 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:journal/state_container.dart';
|
|
|
|
class AppDrawer extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget setupGitButton = Container();
|
|
var appState = StateContainer.of(context).appState;
|
|
|
|
if (!appState.remoteGitRepoConfigured) {
|
|
setupGitButton = ListTile(
|
|
title: Text('Setup Git Host'),
|
|
trailing: Icon(
|
|
Icons.priority_high,
|
|
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(
|
|
title: Text('Share App'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
// Update the state of the app
|
|
// ...
|
|
},
|
|
),
|
|
ListTile(
|
|
title: Text('Settings'),
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
Navigator.pushNamed(context, "/settings");
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|