Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
[FIX] Fixed menu icon position and color
Browse files Browse the repository at this point in the history
  • Loading branch information
axellebot committed Jul 25, 2019
1 parent 3e3dd37 commit 5dce8f6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/src/presentation/pages/main_navigation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MainNavigationPage extends StatelessWidget {
bottomNavigationBar: BottomAppBar(
color: Theme.of(context).primaryColor,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
MenuButton(),
],
Expand Down
56 changes: 29 additions & 27 deletions lib/src/presentation/widgets/menu_button_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_door_buzzer/bloc.dart';
import 'package:flutter_door_buzzer/domain.dart';
import 'package:flutter_door_buzzer/presentation.dart';

class MenuButton extends StatelessWidget {
Expand Down Expand Up @@ -34,34 +33,37 @@ class _DefaultMenuButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return IconButton(
icon: Icon(
Icons.menu,
color: Colors.white,
),
onPressed: () => openMenuBottomSheet(context),
icon: Icon(Icons.menu),
);
}
}

class _MenuButtonConnected extends StatelessWidget {
@override
Widget build(BuildContext context) {
final AccountBloc _accountBloc = BlocProvider.of<AccountBloc>(context);

return BlocBuilder<AccountEvent, AccountState>(
bloc: _accountBloc,
builder: (BuildContext context, AccountState state) {
if (state is AccountLoaded) {
final UserEntity userEntity = state.user;
return Padding(
padding: const EdgeInsets.only(top: 3.0, bottom: 3.0),
child: IconButton(
onPressed: () => openMenuBottomSheet(context),
icon: InitialCircleAvatar(
text: userEntity.email,
),
),
);
}
return _DefaultMenuButton();
},
);
}
}
//class _MenuButtonConnected extends StatelessWidget {
// @override
// Widget build(BuildContext context) {
// final AccountBloc _accountBloc = BlocProvider.of<AccountBloc>(context);
//
// return BlocBuilder<AccountEvent, AccountState>(
// bloc: _accountBloc,
// builder: (BuildContext context, AccountState state) {
// if (state is AccountLoaded) {
// final UserEntity userEntity = state.user;
// return Padding(
// padding: const EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: IconButton(
// onPressed: () => openMenuBottomSheet(context),
// icon: InitialCircleAvatar(
// text: userEntity.email,
// ),
// ),
// );
// }
// return _DefaultMenuButton();
// },
// );
// }
//}

0 comments on commit 5dce8f6

Please sign in to comment.