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

[WIP] UI enhancement #22

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/src/data/models/api_models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ abstract class _Envelop {

@JsonSerializable()
class DataEnvelop<T> extends _Envelop {
@_GenericListConverter()
@_GenericConverter()
T data;

DataEnvelop({
Expand All @@ -183,7 +183,7 @@ class DataEnvelop<T> extends _Envelop {

@JsonSerializable()
class DataArrayEnvelop<T> extends _Envelop {
@_GenericListConverter()
@_GenericConverter()
List<T> data;

int total;
Expand All @@ -203,8 +203,8 @@ class DataArrayEnvelop<T> extends _Envelop {

/// Example of model with GenericCollection
/// https://github.com/dart-lang/json_serializable/blob/ee2c5c788279af01860624303abe16811850b82c/example/lib/json_converter_example.dart
class _GenericListConverter<T> implements JsonConverter<T, Object> {
const _GenericListConverter();
class _GenericConverter<T> implements JsonConverter<T, Object> {
const _GenericConverter();

@override
T fromJson(Object json) {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/data/models/api_models.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions lib/src/presentation/localizations/buzzer_localization_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,6 @@ class BuzzerLocalizationsEN implements BuzzerLocalizations {
@override
String get appErrorUserNotFound => 'User not found';

/// --------------------------------------------------------------------------
/// App Errors
/// --------------------------------------------------------------------------

@override
String get errorNotYetImplemented => 'Not yet implemented';

@override
String get errorNotSupported => 'Not supported';

@override
String get appErrorAuthForbidden => 'Access forbidden';

Expand All @@ -231,6 +221,16 @@ class BuzzerLocalizationsEN implements BuzzerLocalizations {
@override
String get appErrorServerSideProblem => 'A server side error occured';

/// --------------------------------------------------------------------------
/// App Errors
/// --------------------------------------------------------------------------

@override
String get errorNotYetImplemented => 'Not yet implemented';

@override
String get errorNotSupported => 'Not supported';

/// --------------------------------------------------------------------------
/// Other Exceptions
/// --------------------------------------------------------------------------
Expand Down
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();
// },
// );
// }
//}
4 changes: 0 additions & 4 deletions secrets.json.dist

This file was deleted.