From 3e3dd37355de9b5250585bf1af1cd997cf0ce411 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Thu, 25 Jul 2019 10:03:27 +0200 Subject: [PATCH 1/3] [TASK] Rearranged localization --- .../localizations/buzzer_localization_en.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/src/presentation/localizations/buzzer_localization_en.dart b/lib/src/presentation/localizations/buzzer_localization_en.dart index 01a72cb..e0d9a8d 100644 --- a/lib/src/presentation/localizations/buzzer_localization_en.dart +++ b/lib/src/presentation/localizations/buzzer_localization_en.dart @@ -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'; @@ -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 /// -------------------------------------------------------------------------- From 5dce8f6967c15ff31946f82abe0feb6049798f8d Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Thu, 25 Jul 2019 10:03:46 +0200 Subject: [PATCH 2/3] [FIX] Fixed menu icon position and color --- .../pages/main_navigation_page.dart | 2 +- .../widgets/menu_button_widget.dart | 56 ++++++++++--------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/src/presentation/pages/main_navigation_page.dart b/lib/src/presentation/pages/main_navigation_page.dart index 144217d..4baca6d 100644 --- a/lib/src/presentation/pages/main_navigation_page.dart +++ b/lib/src/presentation/pages/main_navigation_page.dart @@ -43,7 +43,7 @@ class MainNavigationPage extends StatelessWidget { bottomNavigationBar: BottomAppBar( color: Theme.of(context).primaryColor, child: Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, children: [ MenuButton(), ], diff --git a/lib/src/presentation/widgets/menu_button_widget.dart b/lib/src/presentation/widgets/menu_button_widget.dart index b2300e4..0679fb1 100644 --- a/lib/src/presentation/widgets/menu_button_widget.dart +++ b/lib/src/presentation/widgets/menu_button_widget.dart @@ -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 { @@ -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(context); - - return BlocBuilder( - 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(context); +// +// return BlocBuilder( +// 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(); +// }, +// ); +// } +//} From 057c78c01e3d3859db4fdf9c2b23317c828fa0f0 Mon Sep 17 00:00:00 2001 From: Axel LE BOT Date: Fri, 26 Jul 2019 15:55:24 +0200 Subject: [PATCH 3/3] [TASK] Renamed generic data model - Deleted old unused secret file --- lib/src/data/models/api_models.dart | 8 ++++---- lib/src/data/models/api_models.g.dart | 8 ++++---- secrets.json.dist | 4 ---- 3 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 secrets.json.dist diff --git a/lib/src/data/models/api_models.dart b/lib/src/data/models/api_models.dart index a48e302..494393f 100644 --- a/lib/src/data/models/api_models.dart +++ b/lib/src/data/models/api_models.dart @@ -166,7 +166,7 @@ abstract class _Envelop { @JsonSerializable() class DataEnvelop extends _Envelop { - @_GenericListConverter() + @_GenericConverter() T data; DataEnvelop({ @@ -183,7 +183,7 @@ class DataEnvelop extends _Envelop { @JsonSerializable() class DataArrayEnvelop extends _Envelop { - @_GenericListConverter() + @_GenericConverter() List data; int total; @@ -203,8 +203,8 @@ class DataArrayEnvelop extends _Envelop { /// Example of model with GenericCollection /// https://github.com/dart-lang/json_serializable/blob/ee2c5c788279af01860624303abe16811850b82c/example/lib/json_converter_example.dart -class _GenericListConverter implements JsonConverter { - const _GenericListConverter(); +class _GenericConverter implements JsonConverter { + const _GenericConverter(); @override T fromJson(Object json) { diff --git a/lib/src/data/models/api_models.g.dart b/lib/src/data/models/api_models.g.dart index a312f22..b165a7f 100644 --- a/lib/src/data/models/api_models.g.dart +++ b/lib/src/data/models/api_models.g.dart @@ -87,7 +87,7 @@ DataEnvelop _$DataEnvelopFromJson(Map json) { message: json['message'] as String, data: json['data'] == null ? null - : _GenericListConverter().fromJson(json['data'])); + : _GenericConverter().fromJson(json['data'])); } Map _$DataEnvelopToJson(DataEnvelop instance) => @@ -96,7 +96,7 @@ Map _$DataEnvelopToJson(DataEnvelop instance) => 'message': instance.message, 'data': instance.data == null ? null - : _GenericListConverter().toJson(instance.data) + : _GenericConverter().toJson(instance.data) }; DataArrayEnvelop _$DataArrayEnvelopFromJson(Map json) { @@ -105,7 +105,7 @@ DataArrayEnvelop _$DataArrayEnvelopFromJson(Map json) { message: json['message'] as String, data: (json['data'] as List) ?.map( - (e) => e == null ? null : _GenericListConverter().fromJson(e)) + (e) => e == null ? null : _GenericConverter().fromJson(e)) ?.toList(), total: json['total'] as int); } @@ -116,7 +116,7 @@ Map _$DataArrayEnvelopToJson( 'error': instance.error, 'message': instance.message, 'data': instance.data - ?.map((e) => e == null ? null : _GenericListConverter().toJson(e)) + ?.map((e) => e == null ? null : _GenericConverter().toJson(e)) ?.toList(), 'total': instance.total }; diff --git a/secrets.json.dist b/secrets.json.dist deleted file mode 100644 index 5e97524..0000000 --- a/secrets.json.dist +++ /dev/null @@ -1,4 +0,0 @@ -{ - "clientId": "", - "clientSecret": "" -} \ No newline at end of file