mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 20:43:20 +08:00
AppMenuButton: Remove badge for when git remote not configured
I cannot seem to get it to look nice with this new version of Badges and now I'm reconsidering if it should be shown at all. The user doesn't **need** to setup the git repo. This app can be used without it perfectly fine.
This commit is contained in:
@ -1,21 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:badges/badges.dart';
|
|
||||||
|
|
||||||
import 'package:gitjournal/state_container.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class GJAppBarMenuButton extends StatelessWidget {
|
class GJAppBarMenuButton extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var container = Provider.of<StateContainer>(context);
|
var appBarMenuButton = IconButton(
|
||||||
final appState = container.appState;
|
|
||||||
|
|
||||||
bool shouldShowBadge =
|
|
||||||
!appState.remoteGitRepoConfigured && appState.hasJournalEntries;
|
|
||||||
var appBarMenuButton = BadgeIconButton(
|
|
||||||
key: const ValueKey("DrawerButton"),
|
key: const ValueKey("DrawerButton"),
|
||||||
icon: const Icon(Icons.menu),
|
icon: const Icon(Icons.menu),
|
||||||
itemCount: shouldShowBadge ? 1 : 0,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).openDrawer();
|
Scaffold.of(context).openDrawer();
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user