From 9608ef1876e7faabbdfd6cd27ecbae3c6aec5664 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 10 Mar 2023 12:33:05 +0100 Subject: [PATCH 01/28] fix: search user inputCustomWidget, on-screen tap to close keyboard --- .../widget/custom_search_input.dart | 114 ++++++++++++++++++ lib/home/view/user_search_screen.dart | 44 ++++--- lib/home/view/widgets/search_input.dart | 17 +-- 3 files changed, 145 insertions(+), 30 deletions(-) create mode 100644 lib/core/presentation/widget/custom_search_input.dart diff --git a/lib/core/presentation/widget/custom_search_input.dart b/lib/core/presentation/widget/custom_search_input.dart new file mode 100644 index 0000000..e384a82 --- /dev/null +++ b/lib/core/presentation/widget/custom_search_input.dart @@ -0,0 +1,114 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class CustomSearchInput extends StatelessWidget { + const CustomSearchInput({ + @required this.labelText, + this.errorText, + this.showSuffix, + this.showSuffixIcon = false, + this.assetSvgPath, + @required this.keyboardType, + this.controller, + this.onChanged, + this.suffixIconWidget, + this.onTap, + this.onTapSuffix, + this.readOnly = false, + this.obscureText = false, + this.showlabel = true, + this.inputFormatters, + required this.box, + }); + + final BoxConstraints box; + final String? labelText; + final String? errorText; + final bool? showSuffix; + final bool? showSuffixIcon; + final String? assetSvgPath; + final TextInputType? keyboardType; + final TextEditingController? controller; + final void Function(String)? onChanged; + final Widget? suffixIconWidget; + final void Function()? onTap; + final void Function()? onTapSuffix; + final bool? readOnly; + final bool? obscureText; + final bool? showlabel; + final List? inputFormatters; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + height: box.maxHeight * 0.1, + child: Center( + child: TextField( + controller: controller, + keyboardType: keyboardType, + obscureText: obscureText!, + onChanged: onChanged, + onTap: onTap, + readOnly: readOnly!, + cursorColor: Colors.black, + inputFormatters: inputFormatters, + decoration: InputDecoration( + hintText: labelText, + fillColor: Colors.transparent, + filled: true, + errorText: errorText, + enabledBorder: OutlineInputBorder( + // width: 0.0 produces a thin "hairline" border + borderSide: BorderSide( + color: Colors.grey, + width: 0.0, + ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + ), + focusedBorder: const OutlineInputBorder( + // width: 0.0 produces a thin "hairline" border + borderSide: BorderSide( + color: Colors.grey, + width: 1.0, + ), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + ), + border: OutlineInputBorder(), + hintStyle: TextStyle( + fontSize: box.maxWidth * 0.04, + ), + suffixIcon: showSuffix == true + ? InkWell( + onTap: onTapSuffix, + child: Container( + height: 5, + margin: EdgeInsets.only( + right: 15.0, + ), + child: Image.asset( + assetSvgPath!, + height: box.maxHeight * 0.002, + width: 2, + ), + ), + ) + : showSuffixIcon == true + ? suffixIconWidget + : null, + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/home/view/user_search_screen.dart b/lib/home/view/user_search_screen.dart index 1c3d3bd..d7e96f7 100644 --- a/lib/home/view/user_search_screen.dart +++ b/lib/home/view/user_search_screen.dart @@ -19,27 +19,33 @@ class UserSearchScreen extends StatelessWidget { } return LayoutBuilder(builder: (context, box) { return SafeArea( - child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: CustomAppBar( - titleChildWidget: CircleAvatar( - backgroundImage: NetworkImage('${user.photo}'), - ), - actionChildWidget: [ - RowHeaderIcons(), - ], - ), - body: SingleChildScrollView( - child: Column( - children: [ - SearchInputWidget( - box: box, - ), - UserSearchList( - box: box, - ), + child: GestureDetector( + onTap: () { + // close keyboard + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + appBar: CustomAppBar( + titleChildWidget: CircleAvatar( + backgroundImage: NetworkImage('${user.photo}'), + ), + actionChildWidget: [ + RowHeaderIcons(), ], ), + body: SingleChildScrollView( + child: Column( + children: [ + SearchInputWidget( + box: box, + ), + UserSearchList( + box: box, + ), + ], + ), + ), ), ), ); diff --git a/lib/home/view/widgets/search_input.dart b/lib/home/view/widgets/search_input.dart index 92873b0..166a02d 100644 --- a/lib/home/view/widgets/search_input.dart +++ b/lib/home/view/widgets/search_input.dart @@ -3,7 +3,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/core/application/search_user_bloc/search_user_bloc.dart'; import 'package:fpb/core/application/search_user_bloc/search_user_state.dart'; import 'package:fpb/core/domain/user.dart'; -import 'package:fpb/core/presentation/widget/my_textformfield.dart'; +import 'package:fpb/core/presentation/widget/custom_search_input.dart'; +import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; class SearchInputWidget extends StatelessWidget { const SearchInputWidget({super.key, required this.box, this.textController}); @@ -31,22 +32,16 @@ class SearchInputWidget extends StatelessWidget { fontWeight: FontWeight.bold, ), ), - SizedBox( - height: box.maxHeight * 0.02, - ), + VerticalSpacingWidget(box: box), Container( width: box.maxWidth, - child: FpbTextFormField( - key: const Key('SearchUserForPayments'), + child: CustomSearchInput( box: box, - label: '', - hint: 'Name, email, identifier', - isEmail: false, + keyboardType: null, + labelText: 'Name, email, identifier', onChanged: (search) async { print(search); }, - showLabelText: false, - errorText: null, ), ), ], From 2892bcd961dc3e22c23a9d53bd09d702d8bed274 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 13 Mar 2023 11:10:53 +0100 Subject: [PATCH 02/28] feat: display recent user and users contact --- lib/home/view/widgets/user_radio_select.dart | 2 +- lib/home/view/widgets/user_search_list.dart | 198 ++++++++---------- macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 114 +++++++++- .../flutter/generated_plugin_registrant.cc | 6 + windows/flutter/generated_plugins.cmake | 2 + 6 files changed, 209 insertions(+), 115 deletions(-) diff --git a/lib/home/view/widgets/user_radio_select.dart b/lib/home/view/widgets/user_radio_select.dart index 9f567ba..1bdd556 100644 --- a/lib/home/view/widgets/user_radio_select.dart +++ b/lib/home/view/widgets/user_radio_select.dart @@ -46,7 +46,7 @@ class UserRadioSelect extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '@${username}', + '@${username.trim()}', style: TextStyle( fontSize: box.maxHeight * 0.023, fontWeight: FontWeight.w400, diff --git a/lib/home/view/widgets/user_search_list.dart b/lib/home/view/widgets/user_search_list.dart index 4efdfb0..9e6b88b 100644 --- a/lib/home/view/widgets/user_search_list.dart +++ b/lib/home/view/widgets/user_search_list.dart @@ -6,11 +6,53 @@ import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart import 'package:fpb/core/domain/user.dart'; import 'package:fpb/core/shared/helpers/value_injector.dart'; -class UserSearchList extends StatelessWidget { +class UserSearchList extends StatefulWidget { const UserSearchList({super.key, required this.box}); final BoxConstraints box; + @override + State createState() => _UserSearchListState(); +} + +class _UserSearchListState extends State { + // list users + List users = [ + User( + id: '1', + isNewUser: false, + photo: + 'https://expertphotography.b-cdn.net/wp-content/uploads/2020/08/profile-photos-4.jpg', + providerId: '123', + name: 'Marry smith', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '2', + isNewUser: false, + photo: + 'https://marketplace.canva.com/EAFEits4-uw/1/0/1600w/canva-boy-cartoon-gamer-animated-twitch-profile-photo-oEqs2yqaL8s.jpg', + providerId: '123456', + name: 'Terry Scotch', + email: 'mary@smith.com', + phoneNumber: '177778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + ]; + + // recently sent list + List recentSentUsers = []; + @override Widget build(BuildContext context) { final user = ValueInjector.of(context)?.value ?? User.empty; @@ -18,9 +60,9 @@ class UserSearchList extends StatelessWidget { context.read()..add(AuthEvent.logoutRequest()); } return Container( - width: box.maxWidth, + width: widget.box.maxWidth, padding: EdgeInsets.symmetric( - horizontal: box.maxWidth * 0.025, + horizontal: widget.box.maxWidth * 0.025, ), child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -29,145 +71,75 @@ class UserSearchList extends StatelessWidget { Text( 'Recently sent', style: TextStyle( - fontSize: box.maxHeight * 0.025, + fontSize: widget.box.maxHeight * 0.025, ), ), VerticalSpacingWidget( - box: box, - height: box.maxHeight * 0.01, + box: widget.box, + height: widget.box.maxHeight * 0.01, ), // display user with recent sent transactions Container( - width: box.maxWidth, - height: box.maxHeight * 0.2, + width: widget.box.maxWidth, + height: widget.box.maxHeight * 0.2, padding: EdgeInsets.symmetric( - horizontal: box.maxWidth * 0.01, + horizontal: widget.box.maxWidth * 0.01, ), child: SingleChildScrollView( child: Column( - // list will be coming from an API - this is just for demo UI - children: [ - UserRadioSelect( - box: box, - fullName: 'Tambe desmond', - username: 'dezzy', - userPhoto: '${user.photo}', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Rudy Mendy', - username: 'rudy', - userPhoto: '${user.photo}', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Gaelle Tiku', - username: 'gaelle', - userPhoto: '${user.photo}', - onChanged: (value) { - print(value); - }, - ), - ], + children: users + .map( + (e) => UserRadioSelect( + box: widget.box, + fullName: e.name, + username: e.name, + userPhoto: '${e.photo}', + onChanged: (value) { + print(value); + }, + ), + ) + .toList(), ), ), ), VerticalSpacingWidget( - box: box, - height: box.maxHeight * 0.015, + box: widget.box, + height: widget.box.maxHeight * 0.015, ), Text( 'Contacts', style: TextStyle( - fontSize: box.maxHeight * 0.025, + fontSize: widget.box.maxHeight * 0.025, ), ), VerticalSpacingWidget( - box: box, - height: box.maxHeight * 0.01, + box: widget.box, + height: widget.box.maxHeight * 0.01, ), // display user with recent sent transactions Container( - width: box.maxWidth, - height: box.maxHeight * 0.5, + width: widget.box.maxWidth, + height: widget.box.maxHeight * 0.5, padding: EdgeInsets.symmetric( - horizontal: box.maxWidth * 0.01, + horizontal: widget.box.maxWidth * 0.01, ), child: SingleChildScrollView( child: Column( - // list will be coming from an API - this is just for demo UI - children: [ - UserRadioSelect( - box: box, - fullName: 'Loic Fonkam', - username: 'loic', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Tambe desmond', - username: 'dezzy', - userPhoto: '${user.photo}', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Amanda', - username: 'amanda', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Desking La', - username: 'desking', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Desking La', - username: 'desking', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Desking La', - username: 'desking', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - UserRadioSelect( - box: box, - fullName: 'Desking La', - username: 'desking', - userPhoto: '', - onChanged: (value) { - print(value); - }, - ), - ], + children: users + .map( + (e) => UserRadioSelect( + box: widget.box, + fullName: e.name, + username: e.name, + userPhoto: '${e.photo}', + onChanged: (value) { + print(value); + }, + ), + ) + .toList(), ), ), ), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 4a243f5..e21d99c 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import firebase_auth import firebase_core import flutter_secure_storage_macos import path_provider_foundation +import share_plus import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { @@ -22,5 +23,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 5f4fd57..0c0d883 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -248,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.6.3" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" + url: "https://pub.dev" + source: hosted + version: "0.3.3+4" crypto: dependency: transitive description: @@ -861,7 +869,7 @@ packages: source: hosted version: "1.0.1" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9" @@ -972,6 +980,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + qr: + dependency: transitive + description: + name: qr + sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + qr_code_scanner: + dependency: "direct main" + description: + name: qr_code_scanner + sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd + url: "https://pub.dev" + source: hosted + version: "1.0.1" + qr_flutter: + dependency: "direct main" + description: + name: qr_flutter + sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + url: "https://pub.dev" + source: hosted + version: "4.0.0" quiver: dependency: transitive description: @@ -988,6 +1020,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.0" + share_plus: + dependency: "direct main" + description: + name: share_plus + sha256: "8c6892037b1824e2d7e8f59d54b3105932899008642e6372e5079c6939b4b625" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "82ddd4ab9260c295e6e39612d4ff00390b9a7a21f1bb1da771e2f232d80ab8a1" + url: "https://pub.dev" + source: hosted + version: "3.2.0" shared_preferences: dependency: "direct main" description: @@ -1201,6 +1249,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "206fb8334a700ef7754d6a9ed119e7349bc830448098f21a69bf1b4ed038cabc" + url: "https://pub.dev" + source: hosted + version: "3.0.4" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" + url: "https://pub.dev" + source: hosted + version: "2.0.16" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: a83ba3607a507758669cfafb03f9de09bf6e6280c14d9b9cb18f013e406dcacd + url: "https://pub.dev" + source: hosted + version: "3.0.5" user_repository: dependency: "direct main" description: @@ -1288,6 +1368,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + sha256: b6cd42db3ced5411f3d01599906156885b18e4188f7065a8a351eb84bee347e0 + url: "https://pub.dev" + source: hosted + version: "4.0.6" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + sha256: c849dcb6bf7367f696869006fb9575c15bdc6a1d624ae13f12de5a147a740b12 + url: "https://pub.dev" + source: hosted + version: "3.4.2" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + sha256: "1939c39e2150fb4d30fd3cc59a891a49fed9935db53007df633ed83581b6117b" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + sha256: ab12479f7a0cf112b9420c36aaf206a1ca47cd60cd42de74a4be2e97a697587b + url: "https://pub.dev" + source: hosted + version: "3.2.1" widgetbook: dependency: "direct main" description: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index d7240f1..d75b6b1 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -9,6 +9,8 @@ #include #include #include +#include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { ConnectivityPlusWindowsPluginRegisterWithRegistrar( @@ -17,4 +19,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); LocalAuthPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("LocalAuthPlugin")); + SharePlusWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 9b83ab5..fe04268 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -6,6 +6,8 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus flutter_secure_storage_windows local_auth_windows + share_plus + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST From 22300dace98e5848673771644b18b7f9905f8fc5 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 13 Mar 2023 12:08:27 +0100 Subject: [PATCH 03/28] feat: change radio button to checkboxes, alongside implemented user selection widget when selecting users for payment --- .../widget/selected_user_item.dart | 63 + lib/home/view/user_search_screen.dart | 4 - lib/home/view/widgets/search_input.dart | 4 - ...dio_select.dart => user_check_select.dart} | 15 +- lib/home/view/widgets/user_search_list.dart | 81 +- macos/Flutter/GeneratedPluginRegistrant.swift | 28 - pubspec.lock | 1469 ----------------- .../flutter/generated_plugin_registrant.cc | 26 - windows/flutter/generated_plugins.cmake | 28 - 9 files changed, 145 insertions(+), 1573 deletions(-) create mode 100644 lib/core/presentation/widget/selected_user_item.dart rename lib/home/view/widgets/{user_radio_select.dart => user_check_select.dart} (88%) delete mode 100644 macos/Flutter/GeneratedPluginRegistrant.swift delete mode 100644 pubspec.lock delete mode 100644 windows/flutter/generated_plugin_registrant.cc delete mode 100644 windows/flutter/generated_plugins.cmake diff --git a/lib/core/presentation/widget/selected_user_item.dart b/lib/core/presentation/widget/selected_user_item.dart new file mode 100644 index 0000000..dbbbc66 --- /dev/null +++ b/lib/core/presentation/widget/selected_user_item.dart @@ -0,0 +1,63 @@ +import 'package:flutter/material.dart'; + +class SelectedUserItem extends StatelessWidget { + const SelectedUserItem({ + super.key, + required this.box, + required this.userPhoto, + required this.username, + required this.onTap, + }); + + final BoxConstraints box; + final String username; + final String userPhoto; + final void Function() onTap; + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.symmetric( + vertical: box.maxWidth * 0.02, + horizontal: box.maxWidth * 0.02, + ), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.onError.withOpacity(0.1), + borderRadius: BorderRadius.circular( + box.maxHeight * 0.01, + ), + ), + child: Wrap( + spacing: 6.0, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + CircleAvatar( + backgroundImage: NetworkImage( + '${userPhoto}', + ), + radius: box.maxHeight * 0.02, + child: userPhoto == '' + ? Icon( + Icons.person, + ) + : Container(), + ), + Text( + '${username}', + style: TextStyle( + fontSize: box.maxHeight * 0.02, + fontWeight: FontWeight.w400, + ), + ), + GestureDetector( + onTap: onTap, + child: Icon( + Icons.close, + size: box.maxHeight * 0.02, + ), + ) + ], + ), + ); + } +} diff --git a/lib/home/view/user_search_screen.dart b/lib/home/view/user_search_screen.dart index d7e96f7..e6fa3f5 100644 --- a/lib/home/view/user_search_screen.dart +++ b/lib/home/view/user_search_screen.dart @@ -5,7 +5,6 @@ import 'package:fpb/core/domain/user.dart'; import 'package:fpb/core/shared/helpers/value_injector.dart'; import 'package:fpb/home/view/widgets/custom_appbar.dart'; import 'package:fpb/home/view/widgets/row_header_icons.dart'; -import 'package:fpb/home/view/widgets/search_input.dart'; import 'package:fpb/home/view/widgets/user_search_list.dart'; class UserSearchScreen extends StatelessWidget { @@ -37,9 +36,6 @@ class UserSearchScreen extends StatelessWidget { body: SingleChildScrollView( child: Column( children: [ - SearchInputWidget( - box: box, - ), UserSearchList( box: box, ), diff --git a/lib/home/view/widgets/search_input.dart b/lib/home/view/widgets/search_input.dart index 166a02d..699bcbe 100644 --- a/lib/home/view/widgets/search_input.dart +++ b/lib/home/view/widgets/search_input.dart @@ -17,10 +17,6 @@ class SearchInputWidget extends StatelessWidget { // final l10n = context.l10n; return Container( width: box.maxWidth, - padding: EdgeInsets.symmetric( - horizontal: box.maxWidth * 0.04, - vertical: box.maxHeight * 0.01, - ), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/home/view/widgets/user_radio_select.dart b/lib/home/view/widgets/user_check_select.dart similarity index 88% rename from lib/home/view/widgets/user_radio_select.dart rename to lib/home/view/widgets/user_check_select.dart index 1bdd556..3a15f32 100644 --- a/lib/home/view/widgets/user_radio_select.dart +++ b/lib/home/view/widgets/user_check_select.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; -class UserRadioSelect extends StatelessWidget { - const UserRadioSelect({ +class UserCheckSelect extends StatelessWidget { + const UserCheckSelect({ super.key, required this.box, required this.username, required this.fullName, required this.onChanged, + required this.checked, required this.userPhoto, }); @@ -14,7 +15,8 @@ class UserRadioSelect extends StatelessWidget { final String username; final String fullName; final String userPhoto; - final void Function(String?) onChanged; + final bool checked; + final void Function(bool?) onChanged; @override Widget build(BuildContext context) { @@ -66,11 +68,10 @@ class UserRadioSelect extends StatelessWidget { ), ), - // radio select button + // checkbox select button SizedBox( - child: Radio( - value: 'dezzy', - groupValue: username, + child: Checkbox( + value: checked, onChanged: onChanged, ), ), diff --git a/lib/home/view/widgets/user_search_list.dart b/lib/home/view/widgets/user_search_list.dart index 9e6b88b..9d0a160 100644 --- a/lib/home/view/widgets/user_search_list.dart +++ b/lib/home/view/widgets/user_search_list.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; -import 'package:fpb/home/view/widgets/user_radio_select.dart'; +import 'package:fpb/home/view/widgets/search_input.dart'; +import 'package:fpb/core/presentation/widget/selected_user_item.dart'; +import 'package:fpb/home/view/widgets/user_check_select.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart'; import 'package:fpb/core/domain/user.dart'; @@ -53,6 +55,12 @@ class _UserSearchListState extends State { // recently sent list List recentSentUsers = []; + // checkbox state + bool selectUser = false; + + // list of selected users + List userSelected = []; + @override Widget build(BuildContext context) { final user = ValueInjector.of(context)?.value ?? User.empty; @@ -68,6 +76,39 @@ class _UserSearchListState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + SearchInputWidget( + box: widget.box, + ), + // display list of selected users + Container( + padding: EdgeInsets.symmetric( + vertical: widget.box.maxWidth * 0.02, + ), + width: widget.box.maxWidth, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Wrap( + spacing: 5.0, + children: userSelected + .map( + (e) => SelectedUserItem( + box: widget.box, + userPhoto: e.photo, + username: e.name, + onTap: () { + userSelected.remove(e); + setState(() {}); + }, + ), + ) + .toList(), + ), + ), + ), + VerticalSpacingWidget( + box: widget.box, + height: widget.box.maxHeight * 0.02, + ), Text( 'Recently sent', style: TextStyle( @@ -89,13 +130,26 @@ class _UserSearchListState extends State { child: Column( children: users .map( - (e) => UserRadioSelect( + (e) => UserCheckSelect( box: widget.box, fullName: e.name, username: e.name, userPhoto: '${e.photo}', - onChanged: (value) { - print(value); + checked: userSelected.contains(e) ? true : false, + onChanged: (bool? value) { + // check if item adde - if yes then remove + if (userSelected.contains(e)) { + userSelected.remove(e); + setState(() { + selectUser = value!; + }); + } else { + // add use to userSelected + userSelected.add(e); + setState(() { + selectUser = value!; + }); + } }, ), ) @@ -129,13 +183,26 @@ class _UserSearchListState extends State { child: Column( children: users .map( - (e) => UserRadioSelect( + (e) => UserCheckSelect( box: widget.box, fullName: e.name, username: e.name, userPhoto: '${e.photo}', - onChanged: (value) { - print(value); + checked: userSelected.contains(e) ? true : false, + onChanged: (bool? value) { + // check if item adde - if yes then remove + if (userSelected.contains(e)) { + userSelected.remove(e); + setState(() { + selectUser = value!; + }); + } else { + // add use to userSelected + userSelected.add(e); + setState(() { + selectUser = value!; + }); + } }, ), ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift deleted file mode 100644 index e21d99c..0000000 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Generated file. Do not edit. -// - -import FlutterMacOS -import Foundation - -import cloud_firestore -import connectivity_plus -import facebook_auth_desktop -import firebase_auth -import firebase_core -import flutter_secure_storage_macos -import path_provider_foundation -import share_plus -import shared_preferences_foundation - -func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) - ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) - FacebookAuthDesktopPlugin.register(with: registry.registrar(forPlugin: "FacebookAuthDesktopPlugin")) - FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) - FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) -} diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 0c0d883..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,1469 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: "4897882604d919befd350648c7f91926a9d5de99e67b455bf0917cc2362f4bb8" - url: "https://pub.dev" - source: hosted - version: "47.0.0" - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "64fcb0dbca4386356386c085142fa6e79c00a3326ceaa778a2d25f5d9ba61441" - url: "https://pub.dev" - source: hosted - version: "1.0.16" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "690e335554a8385bc9d787117d9eb52c0c03ee207a607e593de3c9d71b1cfe80" - url: "https://pub.dev" - source: hosted - version: "4.7.0" - args: - dependency: transitive - description: - name: args - sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" - url: "https://pub.dev" - source: hosted - version: "2.4.0" - async: - dependency: transitive - description: - name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 - url: "https://pub.dev" - source: hosted - version: "2.10.0" - authentication_repository: - dependency: "direct main" - description: - path: "packages/authentication_repository" - relative: true - source: path - version: "0.0.0" - auto_route: - dependency: "direct main" - description: - name: auto_route - sha256: "12047baeca0e01df93165ef33275b32119d72699ab9a49dc64c20e78f586f96d" - url: "https://pub.dev" - source: hosted - version: "5.0.4" - auto_route_generator: - dependency: "direct dev" - description: - name: auto_route_generator - sha256: c66eaa20dbba3211cac656037f88ba836a633dda953d9f4f9f9f5809b57e4278 - url: "https://pub.dev" - source: hosted - version: "5.0.2" - bloc: - dependency: "direct main" - description: - name: bloc - sha256: "658a5ae59edcf1e58aac98b000a71c762ad8f46f1394c34a52050cafb3e11a80" - url: "https://pub.dev" - source: hosted - version: "8.1.1" - bloc_test: - dependency: "direct dev" - description: - name: bloc_test - sha256: ffbb60c17ee3d8e3784cb78071088e353199057233665541e8ac6cd438dca8ad - url: "https://pub.dev" - source: hosted - version: "9.1.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - build: - dependency: transitive - description: - name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" - url: "https://pub.dev" - source: hosted - version: "2.3.1" - build_config: - dependency: transitive - description: - name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" - source: hosted - version: "1.1.1" - build_daemon: - dependency: transitive - description: - name: build_daemon - sha256: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - sha256: "687cf90a3951affac1bd5f9ecb5e3e90b60487f3d9cdc359bb310f8876bb02a6" - url: "https://pub.dev" - source: hosted - version: "2.0.10" - build_runner: - dependency: "direct dev" - description: - name: build_runner - sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 - url: "https://pub.dev" - source: hosted - version: "2.3.3" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" - url: "https://pub.dev" - source: hosted - version: "7.2.7" - built_collection: - dependency: transitive - description: - name: built_collection - sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" - source: hosted - version: "5.1.1" - built_value: - dependency: transitive - description: - name: built_value - sha256: "31b7c748fd4b9adf8d25d72a4c4a59ef119f12876cf414f94f8af5131d5fa2b0" - url: "https://pub.dev" - source: hosted - version: "8.4.4" - characters: - dependency: transitive - description: - name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c - url: "https://pub.dev" - source: hosted - version: "1.2.1" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - sha256: "65f148d9f5b4f389320abb45847120cf5e46094c1a8cbc64934ffc1e29688596" - url: "https://pub.dev" - source: hosted - version: "4.4.3" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "43ccae09f7e0c82752e69c251c6dc5efcdff4ddcfc09564175a28657bbd74188" - url: "https://pub.dev" - source: hosted - version: "5.11.3" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: e054c007217e28e07179bbae0564c2a4f6338a60bddb0c139e4834e953f4b95c - url: "https://pub.dev" - source: hosted - version: "3.3.3" - code_builder: - dependency: transitive - description: - name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" - url: "https://pub.dev" - source: hosted - version: "4.4.0" - collection: - dependency: transitive - description: - name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 - url: "https://pub.dev" - source: hosted - version: "1.17.0" - connectivity_plus: - dependency: "direct main" - description: - name: connectivity_plus - sha256: "8875e8ed511a49f030e313656154e4bbbcef18d68dfd32eb853fac10bce48e96" - url: "https://pub.dev" - source: hosted - version: "3.0.3" - connectivity_plus_platform_interface: - dependency: transitive - description: - name: connectivity_plus_platform_interface - sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a - url: "https://pub.dev" - source: hosted - version: "1.2.4" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" - url: "https://pub.dev" - source: hosted - version: "1.6.3" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" - url: "https://pub.dev" - source: hosted - version: "0.3.3+4" - crypto: - dependency: transitive - description: - name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 - url: "https://pub.dev" - source: hosted - version: "3.0.2" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "7a03456c3490394c8e7665890333e91ae8a49be43542b616e414449ac358acd4" - url: "https://pub.dev" - source: hosted - version: "2.2.4" - dartz: - dependency: "direct main" - description: - name: dartz - sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168 - url: "https://pub.dev" - source: hosted - version: "0.10.1" - dbus: - dependency: transitive - description: - name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" - url: "https://pub.dev" - source: hosted - version: "0.7.8" - device_frame: - dependency: transitive - description: - name: device_frame - sha256: afe76182aec178d171953d9b4a50a43c57c7cf3c77d8b09a48bf30c8fa04dd9d - url: "https://pub.dev" - source: hosted - version: "1.1.0" - device_preview: - dependency: "direct main" - description: - name: device_preview - sha256: "2f097bf31b929e15e6756dbe0ec1bcb63952ab9ed51c25dc5a2c722d2b21fdaf" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - diff_match_patch: - dependency: transitive - description: - name: diff_match_patch - sha256: "2efc9e6e8f449d0abe15be240e2c2a3bcd977c8d126cfd70598aee60af35c0a4" - url: "https://pub.dev" - source: hosted - version: "0.4.1" - equatable: - dependency: "direct main" - description: - name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 - url: "https://pub.dev" - source: hosted - version: "2.0.5" - facebook_auth_desktop: - dependency: transitive - description: - name: facebook_auth_desktop - sha256: "35ff7b8c62ad37c4bc08eed7d58cf301ab8770a2f4eed46573843ae1e1a1aac3" - url: "https://pub.dev" - source: hosted - version: "0.0.9" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - sha256: "9907d80446466e638dad31c195150b305dffd145dc57610fcd12c72289432143" - url: "https://pub.dev" - source: hosted - version: "4.2.9" - firebase_auth_platform_interface: - dependency: "direct dev" - description: - name: firebase_auth_platform_interface - sha256: c645fec50b0391aa878288f58fa4fe9762c271380c457aedf5c7c9b718604f68 - url: "https://pub.dev" - source: hosted - version: "6.11.11" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: "2dcf2a36852b9091741b4a4047a02e1f2c43a62c6cacec7df573a793a6543e6d" - url: "https://pub.dev" - source: hosted - version: "5.2.8" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - sha256: fe30ac230f12f8836bb97e6e09197340d3c584526825b1746ea362a82e1e43f7 - url: "https://pub.dev" - source: hosted - version: "2.7.0" - firebase_core_platform_interface: - dependency: "direct main" - description: - name: firebase_core_platform_interface - sha256: "5615b30c36f55b2777d0533771deda7e5730e769e5d3cb7fda79e9bed86cfa55" - url: "https://pub.dev" - source: hosted - version: "4.5.3" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - sha256: "291fbcace608aca6c860652e1358ef89752be8cc3ef227f8bbcd1e62775b833a" - url: "https://pub.dev" - source: hosted - version: "2.2.1" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_bloc: - dependency: "direct main" - description: - name: flutter_bloc - sha256: "434951eea948dbe87f737b674281465f610b8259c16c097b8163ce138749a775" - url: "https://pub.dev" - source: hosted - version: "8.1.2" - flutter_facebook_auth: - dependency: "direct main" - description: - name: flutter_facebook_auth - sha256: "865752fb264e18f5246626d0cc8c1b6b5217cba8fa12f6704204c471695913b9" - url: "https://pub.dev" - source: hosted - version: "5.0.8" - flutter_facebook_auth_platform_interface: - dependency: transitive - description: - name: flutter_facebook_auth_platform_interface - sha256: "0bc5fefc89b012635c4424a34334215e81e0ff38c5b413f869fd9c14a10c6135" - url: "https://pub.dev" - source: hosted - version: "4.1.1" - flutter_facebook_auth_web: - dependency: transitive - description: - name: flutter_facebook_auth_web - sha256: "6dfd4a3844137fbf7eb4c8d753add1ca15233b280a73a3360d9af46b87680678" - url: "https://pub.dev" - source: hosted - version: "4.1.1" - flutter_hooks: - dependency: "direct main" - description: - name: flutter_hooks - sha256: "6a126f703b89499818d73305e4ce1e3de33b4ae1c5512e3b8eab4b986f46774c" - url: "https://pub.dev" - source: hosted - version: "0.18.6" - flutter_localizations: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: c224ac897bed083dabf11f238dd11a239809b446740be0c2044608c50029ffdf - url: "https://pub.dev" - source: hosted - version: "2.0.9" - flutter_secure_storage: - dependency: transitive - description: - name: flutter_secure_storage - sha256: "98352186ee7ad3639ccc77ad7924b773ff6883076ab952437d20f18a61f0a7c5" - url: "https://pub.dev" - source: hosted - version: "8.0.0" - flutter_secure_storage_linux: - dependency: transitive - description: - name: flutter_secure_storage_linux - sha256: "0912ae29a572230ad52d8a4697e5518d7f0f429052fd51df7e5a7952c7efe2a3" - url: "https://pub.dev" - source: hosted - version: "1.1.3" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: "083add01847fc1c80a07a08e1ed6927e9acd9618a35e330239d4422cd2a58c50" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - flutter_secure_storage_platform_interface: - dependency: transitive - description: - name: flutter_secure_storage_platform_interface - sha256: b3773190e385a3c8a382007893d678ae95462b3c2279e987b55d140d3b0cb81b - url: "https://pub.dev" - source: hosted - version: "1.0.1" - flutter_secure_storage_web: - dependency: transitive - description: - name: flutter_secure_storage_web - sha256: "42938e70d4b872e856e678c423cc0e9065d7d294f45bc41fc1981a4eb4beaffe" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - flutter_secure_storage_windows: - dependency: transitive - description: - name: flutter_secure_storage_windows - sha256: fc2910ec9b28d60598216c29ea763b3a96c401f0ce1d13cdf69ccb0e5c93c3ee - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: "97c5b291b4fd34ae4f55d6a4c05841d4d0ed94952e033c5a6529e1b47b4d2a29" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - formz: - dependency: "direct main" - description: - name: formz - sha256: ed92f501f4a44b1da9137a025007df773b3732147b413c464158ecd997612ab6 - url: "https://pub.dev" - source: hosted - version: "0.4.1" - freezed: - dependency: "direct dev" - description: - name: freezed - sha256: "4179d41127bc7a67dc3f58ceec1d22f1cdf10470653cb86eda2a63f81b4920c7" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - freezed_annotation: - dependency: "direct main" - description: - name: freezed_annotation - sha256: aeac15850ef1b38ee368d4c53ba9a847e900bb2c53a4db3f6881cbb3cb684338 - url: "https://pub.dev" - source: hosted - version: "2.2.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - get_it: - dependency: "direct main" - description: - name: get_it - sha256: "290fde3a86072e4b37dbb03c07bec6126f0ecc28dad403c12ffe2e5a2d751ab7" - url: "https://pub.dev" - source: hosted - version: "7.2.0" - glob: - dependency: transitive - description: - name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: "927573f2e8a8d65c17931e21918ad0ab0666b1b636537de7c4932bdb487b190f" - url: "https://pub.dev" - source: hosted - version: "4.0.3" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: "821f354c053d51a2d417b02d42532a19a6ea8057d2f9ebb8863c07d81c98aaf9" - url: "https://pub.dev" - source: hosted - version: "5.4.4" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: f27bd56527c567594167bd0a46f7ceb93122ed064d2eee612413d6af0bb2e2e5 - url: "https://pub.dev" - source: hosted - version: "6.1.7" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: "2575ef0d06dbe6923cedf39766da8305d407bb891d9f4a59502c642719776c5c" - url: "https://pub.dev" - source: hosted - version: "5.6.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: fece762f0d2dd762ebde43ad70662a209ff6ee034111976549c392f7763d9264 - url: "https://pub.dev" - source: hosted - version: "2.3.1" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: "75cc41ebc53b1756320ee14d9c3018ad3e6cea298147dbcd86e9d0c8d6720b40" - url: "https://pub.dev" - source: hosted - version: "0.10.2+1" - graphs: - dependency: transitive - description: - name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 - url: "https://pub.dev" - source: hosted - version: "2.2.0" - http: - dependency: transitive - description: - name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" - url: "https://pub.dev" - source: hosted - version: "0.13.5" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - injectable: - dependency: "direct main" - description: - name: injectable - sha256: "7dab7d341feb40a0590d9ff6261aea9495522005e2c6763f9161a4face916f7b" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - injectable_generator: - dependency: "direct dev" - description: - name: injectable_generator - sha256: b206de637c1960007b0beebe447a6ee3cf30c9e5f14542083024a9d0c49a7a09 - url: "https://pub.dev" - source: hosted - version: "2.1.4" - intl: - dependency: "direct main" - description: - name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" - url: "https://pub.dev" - source: hosted - version: "0.17.0" - intl_phone_field: - dependency: "direct main" - description: - name: intl_phone_field - sha256: "0d2b35d148ed28a454d50797e6c2fb297f0a295feab84641b02d3dd32294b3f3" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" - url: "https://pub.dev" - source: hosted - version: "0.6.5" - json_annotation: - dependency: "direct main" - description: - name: json_annotation - sha256: "3520fa844009431b5d4491a5a778603520cdc399ab3406332dcc50f93547258c" - url: "https://pub.dev" - source: hosted - version: "4.7.0" - json_serializable: - dependency: "direct main" - description: - name: json_serializable - sha256: f3c2c18a7889580f71926f30c1937727c8c7d4f3a435f8f5e8b0ddd25253ef5d - url: "https://pub.dev" - source: hosted - version: "6.5.4" - local_auth: - dependency: "direct main" - description: - name: local_auth - sha256: "0cf238be2bfa51a6c9e7e9cfc11c05ea39f2a3a4d3e5bb255d0ebc917da24401" - url: "https://pub.dev" - source: hosted - version: "2.1.6" - local_auth_android: - dependency: transitive - description: - name: local_auth_android - sha256: "6e97e997530f7bfcc696cc0ed84a019209719dd6e854675da81803d02f10d8fc" - url: "https://pub.dev" - source: hosted - version: "1.0.20" - local_auth_ios: - dependency: transitive - description: - name: local_auth_ios - sha256: b4b7a02eec2bd8ffea78026658264e7a720c841cca7732dfa27e36af2f727dd8 - url: "https://pub.dev" - source: hosted - version: "1.1.0" - local_auth_platform_interface: - dependency: transitive - description: - name: local_auth_platform_interface - sha256: "9e160d59ef0743e35f1b50f4fb84dc64f55676b1b8071e319ef35e7f3bc13367" - url: "https://pub.dev" - source: hosted - version: "1.0.7" - local_auth_windows: - dependency: transitive - description: - name: local_auth_windows - sha256: "69c4a6b1201e7b5467e7180c7dd84cf96c308982680cc1778984552bea84b0bc" - url: "https://pub.dev" - source: hosted - version: "1.0.6" - logging: - dependency: "direct main" - description: - name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" - url: "https://pub.dev" - source: hosted - version: "0.12.13" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" - source: hosted - version: "0.2.0" - meta: - dependency: transitive - description: - name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" - url: "https://pub.dev" - source: hosted - version: "1.8.0" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" - mocktail: - dependency: "direct dev" - description: - name: mocktail - sha256: "80a996cd9a69284b3dc521ce185ffe9150cde69767c2d3a0720147d93c0cef53" - url: "https://pub.dev" - source: hosted - version: "0.3.0" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - nm: - dependency: transitive - description: - name: nm - sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://pub.dev" - source: hosted - version: "0.5.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - ntp: - dependency: "direct main" - description: - name: ntp - sha256: "198db73e5059b334b50dbe8c626011c26576778ee9fc53f4c55c1d89d08ed2d2" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - path: - dependency: transitive - description: - name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b - url: "https://pub.dev" - source: hosted - version: "1.8.2" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" - source: hosted - version: "1.0.1" - path_provider: - dependency: "direct main" - description: - name: path_provider - sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9" - url: "https://pub.dev" - source: hosted - version: "2.0.13" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "7623b7d4be0f0f7d9a8b5ee6879fc13e4522d4c875ab86801dee4af32b54b83e" - url: "https://pub.dev" - source: hosted - version: "2.0.23" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: eec003594f19fe2456ea965ae36b3fc967bc5005f508890aafe31fa75e41d972 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: "525ad5e07622d19447ad740b1ed5070031f7a5437f44355ae915ff56e986429a" - url: "https://pub.dev" - source: hosted - version: "2.1.9" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" - url: "https://pub.dev" - source: hosted - version: "2.0.6" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: "642ddf65fde5404f83267e8459ddb4556316d3ee6d511ed193357e25caa3632d" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" - url: "https://pub.dev" - source: hosted - version: "5.1.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: "direct dev" - description: - name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" - provider: - dependency: transitive - description: - name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f - url: "https://pub.dev" - source: hosted - version: "6.0.5" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - qr: - dependency: transitive - description: - name: qr - sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - qr_code_scanner: - dependency: "direct main" - description: - name: qr_code_scanner - sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd - url: "https://pub.dev" - source: hosted - version: "1.0.1" - qr_flutter: - dependency: "direct main" - description: - name: qr_flutter - sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e - url: "https://pub.dev" - source: hosted - version: "4.0.0" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" - recase: - dependency: transitive - description: - name: recase - sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - share_plus: - dependency: "direct main" - description: - name: share_plus - sha256: "8c6892037b1824e2d7e8f59d54b3105932899008642e6372e5079c6939b4b625" - url: "https://pub.dev" - source: hosted - version: "6.3.1" - share_plus_platform_interface: - dependency: transitive - description: - name: share_plus_platform_interface - sha256: "82ddd4ab9260c295e6e39612d4ff00390b9a7a21f1bb1da771e2f232d80ab8a1" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - sha256: ee6257848f822b8481691f20c3e6d2bfee2e9eccb2a3d249907fcfb198c55b41 - url: "https://pub.dev" - source: hosted - version: "2.0.18" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: a51a4f9375097f94df1c6e0a49c0374440d31ab026b59d58a7e7660675879db4 - url: "https://pub.dev" - source: hosted - version: "2.0.16" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "6b84fdf06b32bb336f972d373cd38b63734f3461ba56ac2ba01b56d052796259" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - shared_preferences_linux: - dependency: transitive - description: - name: shared_preferences_linux - sha256: d7fb71e6e20cd3dfffcc823a28da3539b392e53ed5fc5c2b90b55fdaa8a7e8fa - url: "https://pub.dev" - source: hosted - version: "2.1.4" - shared_preferences_platform_interface: - dependency: transitive - description: - name: shared_preferences_platform_interface - sha256: "824bfd02713e37603b2bdade0842e47d56e7db32b1dcdd1cae533fb88e2913fc" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - shared_preferences_web: - dependency: transitive - description: - name: shared_preferences_web - sha256: "6737b757e49ba93de2a233df229d0b6a87728cea1684da828cbc718b65dcf9d7" - url: "https://pub.dev" - source: hosted - version: "2.0.5" - shared_preferences_windows: - dependency: transitive - description: - name: shared_preferences_windows - sha256: bd014168e8484837c39ef21065b78f305810ceabc1d4f90be6e3b392ce81b46d - url: "https://pub.dev" - source: hosted - version: "2.1.4" - shelf: - dependency: transitive - description: - name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c - url: "https://pub.dev" - source: hosted - version: "1.4.0" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 - url: "https://pub.dev" - source: hosted - version: "3.0.1" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c - url: "https://pub.dev" - source: hosted - version: "1.1.1" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 - url: "https://pub.dev" - source: hosted - version: "1.0.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - sha256: "2d79738b6bbf38a43920e2b8d189e9a3ce6cc201f4b8fc76be5e4fe377b1c38d" - url: "https://pub.dev" - source: hosted - version: "1.2.6" - source_helper: - dependency: transitive - description: - name: source_helper - sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" - url: "https://pub.dev" - source: hosted - version: "1.3.3" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" - source_span: - dependency: transitive - description: - name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" - source: hosted - version: "1.9.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - stream_transform: - dependency: transitive - description: - name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test: - dependency: transitive - description: - name: test - sha256: a5fcd2d25eeadbb6589e80198a47d6a464ba3e2049da473943b8af9797900c2d - url: "https://pub.dev" - source: hosted - version: "1.22.0" - test_api: - dependency: transitive - description: - name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 - url: "https://pub.dev" - source: hosted - version: "0.4.16" - test_core: - dependency: transitive - description: - name: test_core - sha256: "0ef9755ec6d746951ba0aabe62f874b707690b5ede0fecc818b138fcc9b14888" - url: "https://pub.dev" - source: hosted - version: "0.4.20" - timing: - dependency: transitive - description: - name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: "206fb8334a700ef7754d6a9ed119e7349bc830448098f21a69bf1b4ed038cabc" - url: "https://pub.dev" - source: hosted - version: "3.0.4" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" - url: "https://pub.dev" - source: hosted - version: "2.0.16" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: a83ba3607a507758669cfafb03f9de09bf6e6280c14d9b9cb18f013e406dcacd - url: "https://pub.dev" - source: hosted - version: "3.0.5" - user_repository: - dependency: "direct main" - description: - path: "packages/user_repository" - relative: true - source: path - version: "0.0.0" - uuid: - dependency: transitive - description: - name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.dev" - source: hosted - version: "3.0.7" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: e43c38822e7d2facd790fd617ce16b10cc359a4b094d5772e3198904270918ef - url: "https://pub.dev" - source: hosted - version: "1.1.1" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "4a85a8563405bfe223052a85d6f8bc276ba3a22e12acfa3fd9a7108c67b32076" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "9e8066d2f18e88f2fb1cf6c8ca567417bdfb0145ac28519dcca3c15d42a10b3e" - url: "https://pub.dev" - source: hosted - version: "1.1.1" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - very_good_analysis: - dependency: "direct dev" - description: - name: very_good_analysis - sha256: ebc48c51db35beeeec8c414e32f7bd78e612bd7f5992ccb0d46e19edaeb40b08 - url: "https://pub.dev" - source: hosted - version: "4.0.0+1" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 - url: "https://pub.dev" - source: hosted - version: "9.4.0" - watcher: - dependency: transitive - description: - name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b - url: "https://pub.dev" - source: hosted - version: "2.3.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - webview_flutter: - dependency: "direct main" - description: - name: webview_flutter - sha256: b6cd42db3ced5411f3d01599906156885b18e4188f7065a8a351eb84bee347e0 - url: "https://pub.dev" - source: hosted - version: "4.0.6" - webview_flutter_android: - dependency: transitive - description: - name: webview_flutter_android - sha256: c849dcb6bf7367f696869006fb9575c15bdc6a1d624ae13f12de5a147a740b12 - url: "https://pub.dev" - source: hosted - version: "3.4.2" - webview_flutter_platform_interface: - dependency: transitive - description: - name: webview_flutter_platform_interface - sha256: "1939c39e2150fb4d30fd3cc59a891a49fed9935db53007df633ed83581b6117b" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - webview_flutter_wkwebview: - dependency: transitive - description: - name: webview_flutter_wkwebview - sha256: ab12479f7a0cf112b9420c36aaf206a1ca47cd60cd42de74a4be2e97a697587b - url: "https://pub.dev" - source: hosted - version: "3.2.1" - widgetbook: - dependency: "direct main" - description: - name: widgetbook - sha256: "137c4af10146e3a48c7f3d241b7af06c17b3df4b6c3e708c7a5c9a508c6af209" - url: "https://pub.dev" - source: hosted - version: "1.0.3" - widgetbook_annotation: - dependency: "direct main" - description: - name: widgetbook_annotation - sha256: "1f12e090865200191ab6b79b7ed4b108a191bf5de3140f92917c8c75e7e3f916" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - widgetbook_generator: - dependency: "direct dev" - description: - name: widgetbook_generator - sha256: b6d00fef564fa5c0b98e26a72a27d52d03400c36409e56be25c0f09cfee3307b - url: "https://pub.dev" - source: hosted - version: "2.4.1" - widgetbook_models: - dependency: transitive - description: - name: widgetbook_models - sha256: "40899314ab0cce1a52b189ee12b79138ba59f445229f850fb326f579c8f63045" - url: "https://pub.dev" - source: hosted - version: "0.0.7" - win32: - dependency: transitive - description: - name: win32 - sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 - url: "https://pub.dev" - source: hosted - version: "3.1.3" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - xml: - dependency: transitive - description: - name: xml - sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" - url: "https://pub.dev" - source: hosted - version: "6.2.2" - yaml: - dependency: transitive - description: - name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" - url: "https://pub.dev" - source: hosted - version: "3.1.1" -sdks: - dart: ">=2.19.0 <3.0.0" - flutter: ">=3.7.0-0" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index d75b6b1..0000000 --- a/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,26 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include -#include -#include -#include -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - ConnectivityPlusWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); - LocalAuthPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("LocalAuthPlugin")); - SharePlusWindowsPluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); -} diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake deleted file mode 100644 index fe04268..0000000 --- a/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - connectivity_plus - flutter_secure_storage_windows - local_auth_windows - share_plus - url_launcher_windows -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) From 131b18b93c0c71359486628e7479b9390a3ebeb9 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Tue, 14 Mar 2023 11:21:12 +0100 Subject: [PATCH 04/28] fix: revert changes for GeneratedPluginRegistrant.swift and cmake file deletion --- lib/home/view/widgets/user_check_select.dart | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 26 +++++++++++++++++++ .../flutter/generated_plugin_registrant.cc | 20 ++++++++++++++ windows/flutter/generated_plugins.cmake | 26 +++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 macos/Flutter/GeneratedPluginRegistrant.swift create mode 100644 windows/flutter/generated_plugin_registrant.cc create mode 100644 windows/flutter/generated_plugins.cmake diff --git a/lib/home/view/widgets/user_check_select.dart b/lib/home/view/widgets/user_check_select.dart index 3a15f32..f22280a 100644 --- a/lib/home/view/widgets/user_check_select.dart +++ b/lib/home/view/widgets/user_check_select.dart @@ -48,7 +48,7 @@ class UserCheckSelect extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '@${username.trim()}', + '@${username}', style: TextStyle( fontSize: box.maxHeight * 0.023, fontWeight: FontWeight.w400, diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..4a243f5 --- /dev/null +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,26 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import cloud_firestore +import connectivity_plus +import facebook_auth_desktop +import firebase_auth +import firebase_core +import flutter_secure_storage_macos +import path_provider_foundation +import shared_preferences_foundation + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) + ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) + FacebookAuthDesktopPlugin.register(with: registry.registrar(forPlugin: "FacebookAuthDesktopPlugin")) + FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) + FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) + FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) +} diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..d7240f1 --- /dev/null +++ b/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,20 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + FlutterSecureStorageWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); + LocalAuthPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("LocalAuthPlugin")); +} diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..9b83ab5 --- /dev/null +++ b/windows/flutter/generated_plugins.cmake @@ -0,0 +1,26 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus + flutter_secure_storage_windows + local_auth_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) From ff729f3a11be8bc0d55171eb657309e38507e4b0 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Tue, 14 Mar 2023 11:41:45 +0100 Subject: [PATCH 05/28] fix: update to request changes --- macos/Flutter/GeneratedPluginRegistrant.swift | 2 ++ windows/flutter/generated_plugin_registrant.cc | 6 ++++++ windows/flutter/generated_plugins.cmake | 2 ++ 3 files changed, 10 insertions(+) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 4a243f5..e21d99c 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import firebase_auth import firebase_core import flutter_secure_storage_macos import path_provider_foundation +import share_plus import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { @@ -22,5 +23,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index d7240f1..d75b6b1 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -9,6 +9,8 @@ #include #include #include +#include +#include void RegisterPlugins(flutter::PluginRegistry* registry) { ConnectivityPlusWindowsPluginRegisterWithRegistrar( @@ -17,4 +19,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); LocalAuthPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("LocalAuthPlugin")); + SharePlusWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 9b83ab5..fe04268 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -6,6 +6,8 @@ list(APPEND FLUTTER_PLUGIN_LIST connectivity_plus flutter_secure_storage_windows local_auth_windows + share_plus + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST From cb7af60311015c4bd83f0c318bb450b9755eb50b Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Wed, 15 Mar 2023 09:29:11 +0100 Subject: [PATCH 06/28] fix: resolve merge conflicts in search_input.dart widget --- .../presentation/theming/colors/colors.dart | 2 + .../theming/themes/light_theme.dart | 4 +- .../widget/confirmation_screen_actions.dart | 77 +++++++ .../confirmation_screen_illustration.dart | 25 ++ .../{my_button.dart => fpb_button.dart} | 42 ++-- ...ormfield.dart => fpb_text_form_field.dart} | 0 .../widget/otp_group_text_field.dart | 42 ++++ lib/core/presentation/widget/otp_input.dart | 33 +++ .../email_confirmation.dart | 2 +- .../view/email_confirmation_page.dart | 215 ------------------ .../view/email_confirmation_screen.dart | 99 ++++++++ lib/home/view/budget_screen.dart | 3 +- lib/injection.config.dart | 112 +++++---- lib/l10n/arb/app_en.arb | 35 ++- lib/l10n/arb/app_fr.arb | 16 +- lib/onboarding/view/widgets/actions.dart | 2 +- .../view/phone_number_confirmation.dart | 102 +++++++++ lib/router/app_route.dart | 4 + lib/router/app_route.gr.dart | 173 +++++++++----- .../save_money_with_bucket.dart | 2 +- lib/sign_in/view/widgets/email_input.dart | 2 +- lib/sign_in/view/widgets/login_button.dart | 2 +- lib/sign_in/view/widgets/password_input.dart | 2 +- lib/sign_up/view/signup_page.dart | 4 +- 24 files changed, 634 insertions(+), 366 deletions(-) create mode 100644 lib/core/presentation/widget/confirmation_screen_actions.dart create mode 100644 lib/core/presentation/widget/confirmation_screen_illustration.dart rename lib/core/presentation/widget/{my_button.dart => fpb_button.dart} (56%) rename lib/core/presentation/widget/{my_textformfield.dart => fpb_text_form_field.dart} (100%) create mode 100644 lib/core/presentation/widget/otp_group_text_field.dart create mode 100644 lib/core/presentation/widget/otp_input.dart delete mode 100644 lib/email_confirmation/view/email_confirmation_page.dart create mode 100644 lib/email_confirmation/view/email_confirmation_screen.dart create mode 100644 lib/phone_number_confirmation/view/phone_number_confirmation.dart diff --git a/lib/core/presentation/theming/colors/colors.dart b/lib/core/presentation/theming/colors/colors.dart index 1a1ddea..45a1582 100644 --- a/lib/core/presentation/theming/colors/colors.dart +++ b/lib/core/presentation/theming/colors/colors.dart @@ -15,6 +15,8 @@ class _AppColors { static Color onSurfaceW = Color(0xfff7f7f7); // const Color(0xff808191); static Color greyLight = Color(0xFFABABAB); + static Color lightGrey = Color(0xffA7A7A7); + static Color getShade(Color color, {bool darker = false, double value = .1}) { assert(value >= 0 && value <= 1, 'verify domain interval'); diff --git a/lib/core/presentation/theming/themes/light_theme.dart b/lib/core/presentation/theming/themes/light_theme.dart index 9327645..ba77ae2 100644 --- a/lib/core/presentation/theming/themes/light_theme.dart +++ b/lib/core/presentation/theming/themes/light_theme.dart @@ -35,8 +35,8 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { .green, // set to odd color so we can see which component in the UI is affected inversePrimary: Colors .yellow, // set to odd color so we can see which component in the UI is affected - outline: Colors - .purple, // set to odd color so we can see which component in the UI is affected + outline: _AppColors + .lightGrey, // set to odd color so we can see which component in the UI is affected surface: _AppColors.bgColorW, onSurface: _AppColors.onSurfaceW, background: _AppColors.bgColorW, diff --git a/lib/core/presentation/widget/confirmation_screen_actions.dart b/lib/core/presentation/widget/confirmation_screen_actions.dart new file mode 100644 index 0000000..fd6b32f --- /dev/null +++ b/lib/core/presentation/widget/confirmation_screen_actions.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; +import 'package:fpb/l10n/l10n.dart'; + +class ConfirmationScreenAction extends StatelessWidget { + const ConfirmationScreenAction({ + Key? key, + required this.confirmButtonLabel, + required this.onTapConfirmButton, + required this.onTapContactUsButton, + }) : super(key: key); + + final String confirmButtonLabel; + final void Function() onTapConfirmButton; + final void Function() onTapContactUsButton; + + @override + Widget build(BuildContext context) { + final l10n = context.l10n; + final theme = Theme.of(context); + final style = theme.textTheme; + final colors = theme.colorScheme; + + return LayoutBuilder(builder: (context, box) { + return Container( + height: box.maxHeight * .17, + width: box.maxWidth, + decoration: BoxDecoration( + color: colors.secondary, + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: box.maxHeight * .035), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FpbButton( + label: confirmButtonLabel, + onTap: onTapConfirmButton, + backgroundColor: colors.scrim, + borderSideColor: colors.outline, + textColor: colors.outline, + ), + SizedBox( + height: box.maxHeight * .03, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + l10n.confirmPhoneNumberNeedHelpLink, + style: style.labelMedium?.copyWith( + color: colors.outline, + fontSize: 12.0, + ), + ), + InkWell( + child: Text( + l10n.confirmPhoneNumberContactUs, + style: style.labelMedium?.copyWith( + fontWeight: FontWeight.w700, + color: theme.colorScheme.onSurface, + fontSize: 12.0, + ), + ), + onTap: onTapContactUsButton, + ), + ], + ) + ], + ), + ), + ); + }); + } +} diff --git a/lib/core/presentation/widget/confirmation_screen_illustration.dart b/lib/core/presentation/widget/confirmation_screen_illustration.dart new file mode 100644 index 0000000..8dd1ea1 --- /dev/null +++ b/lib/core/presentation/widget/confirmation_screen_illustration.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:fpb/assets/fpb_svg.dart'; + +class ConfirmationScreenIllustration extends StatelessWidget { + const ConfirmationScreenIllustration({ + super.key, + required this.box, + }); + + final BoxConstraints box; + + @override + Widget build(BuildContext context) { + return Container( + height: box.maxHeight * .23, + width: box.maxWidth, + child: SvgPicture.asset( + SvgNames.emailConfirmation, + width: box.maxWidth, + height: 0.25 * box.maxHeight, + ), + ); + } +} diff --git a/lib/core/presentation/widget/my_button.dart b/lib/core/presentation/widget/fpb_button.dart similarity index 56% rename from lib/core/presentation/widget/my_button.dart rename to lib/core/presentation/widget/fpb_button.dart index 7540718..5d0b417 100644 --- a/lib/core/presentation/widget/my_button.dart +++ b/lib/core/presentation/widget/fpb_button.dart @@ -10,6 +10,9 @@ class FpbButton extends StatelessWidget { this.width, this.leading, this.spaceAround = false, + this.backgroundColor, + this.borderSideColor, + this.textColor, }); final String label; @@ -19,17 +22,16 @@ class FpbButton extends StatelessWidget { final double? width; final Widget? leading; final bool spaceAround; + final Color? backgroundColor; + final Color? borderSideColor; + final Color? textColor; @override Widget build(BuildContext context) { - final text = Text( - label, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Colors.white, - // fontWeight: FontWeight.w400, - ), - ); final size = MediaQuery.of(context).size; + final theme = Theme.of(context); + final colors = theme.colorScheme; + return SizedBox( width: width ?? size.width, height: height ?? size.height * 0.075, @@ -41,13 +43,14 @@ class FpbButton extends StatelessWidget { ? MainAxisAlignment.spaceAround : MainAxisAlignment.spaceBetween, children: [ - leading != null - ? Transform.translate( - offset: const Offset(-10, 0), - child: leading, - ) - : const SizedBox.shrink(), - text, + leading ?? const SizedBox.shrink(), + Text( + label, + style: Theme.of(context).textTheme.titleMedium?.copyWith( + color: textColor ?? colors.surface, + // fontWeight: FontWeight.w400, + ), + ), if (trailing != null) Transform.translate( offset: const Offset(-15, 0), @@ -57,6 +60,17 @@ class FpbButton extends StatelessWidget { const SizedBox.shrink() ], ), + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(backgroundColor ?? colors.error), + side: MaterialStateProperty.all( + BorderSide( + color: borderSideColor ?? colors.error, + width: 1.0, + style: BorderStyle.solid), + ), + elevation: MaterialStateProperty.all(0.0), + ), ), ); } diff --git a/lib/core/presentation/widget/my_textformfield.dart b/lib/core/presentation/widget/fpb_text_form_field.dart similarity index 100% rename from lib/core/presentation/widget/my_textformfield.dart rename to lib/core/presentation/widget/fpb_text_form_field.dart diff --git a/lib/core/presentation/widget/otp_group_text_field.dart b/lib/core/presentation/widget/otp_group_text_field.dart new file mode 100644 index 0000000..1dc49ec --- /dev/null +++ b/lib/core/presentation/widget/otp_group_text_field.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/otp_input.dart'; + +class OtpGroupTextField extends StatelessWidget { + const OtpGroupTextField({ + super.key, + required this.box, + }); + + final BoxConstraints box; + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Wrap( + children: [ + OtpInput( + box: box, + ), + OtpInput( + box: box, + ), + OtpInput( + box: box, + ), + OtpInput( + box: box, + ), + OtpInput( + box: box, + ), + OtpInput( + box: box, + ), + ], + ), + ], + ); + } +} diff --git a/lib/core/presentation/widget/otp_input.dart b/lib/core/presentation/widget/otp_input.dart new file mode 100644 index 0000000..93ddf12 --- /dev/null +++ b/lib/core/presentation/widget/otp_input.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +class OtpInput extends StatelessWidget { + const OtpInput({ + super.key, + required this.box, + }); + + final BoxConstraints box; + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + + return Padding( + padding: EdgeInsets.symmetric(horizontal: box.maxHeight * .0065), + child: Container( + height: box.maxHeight * .065, + width: box.maxWidth * .12, + child: Flexible( + fit: FlexFit.loose, + child: TextFormField( + cursorColor: colors.scrim, + textAlign: TextAlign.center, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(box.maxHeight * .15))), + ), + ), + ), + ); + } +} diff --git a/lib/email_confirmation/email_confirmation.dart b/lib/email_confirmation/email_confirmation.dart index 8059d8f..adf534a 100644 --- a/lib/email_confirmation/email_confirmation.dart +++ b/lib/email_confirmation/email_confirmation.dart @@ -1 +1 @@ -export 'view/email_confirmation_page.dart'; +export 'view/email_confirmation_screen.dart'; diff --git a/lib/email_confirmation/view/email_confirmation_page.dart b/lib/email_confirmation/view/email_confirmation_page.dart deleted file mode 100644 index 6dbbb4d..0000000 --- a/lib/email_confirmation/view/email_confirmation_page.dart +++ /dev/null @@ -1,215 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:fpb/assets/fpb_svg.dart'; -import 'package:fpb/core/presentation/widget/my_button.dart'; -import 'package:fpb/l10n/l10n.dart'; - -class EmailConfirmationScreen extends StatefulWidget { - static const routeName = '/emailConfirmation'; - - const EmailConfirmationScreen({super.key}); - - @override - State createState() => - _EmailConfirmationScreenState(); -} - -class _EmailConfirmationScreenState extends State { - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - final theme = Theme.of(context); - final style = theme.textTheme; - final colors = theme.colorScheme; - - return LayoutBuilder( - builder: (context, box) { - return Scaffold( - backgroundColor: colors.background, - body: SafeArea( - child: Stack( - children: [ - Container( - height: box.maxHeight * .5, - width: box.maxWidth, - child: Container( - child: Padding( - padding: EdgeInsets.only( - left: box.maxHeight * .025, - right: box.maxHeight * .025), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Confirm your', - style: style.titleLarge - ?.copyWith(fontSize: box.maxHeight * .045), - ), - SizedBox( - height: box.maxHeight * .01, - ), - Text( - l10n.signInEmailLogInLabel, - style: style.titleLarge - ?.copyWith(fontSize: box.maxHeight * .045), - ), - SizedBox( - height: box.maxHeight * .01, - ), - RichText( - maxLines: 3, - text: TextSpan(children: [ - TextSpan( - text: - 'We\'ve sent you a confirmation email containing your ', - style: style.titleMedium, - ), - TextSpan( - text: 'validation code. ', - style: style.titleMedium?.copyWith( - fontWeight: FontWeight.w600, - //color: theme.colorScheme.onSurface - ), - ), - TextSpan( - text: 'Please enter the code.', - style: style.titleMedium) - ])), - SizedBox( - height: box.maxHeight * .05, - ), - Row( - children: [ - Wrap(children: [ - confirmation_input( - box: box, - ), - confirmation_input( - box: box, - ), - confirmation_input( - box: box, - ), - confirmation_input( - box: box, - ), - confirmation_input( - box: box, - ), - confirmation_input( - box: box, - ), - ]), - ], - ), - ], - ), - ), - ), - ), - Align( - alignment: Alignment.bottomCenter, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - height: box.maxHeight * .2, - width: box.maxWidth, - child: SvgPicture.asset( - SvgNames.emailConfirmation, - width: box.maxWidth, - height: 0.25 * box.maxHeight, - ), - ), - Container( - height: box.maxHeight * .2, - width: box.maxWidth, - decoration: BoxDecoration( - color: colors.secondary, - ), - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: box.maxHeight * .035), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FpbButton( - // style: ButtonStyle( - // textStyle: MaterialStateProperty.all( - // style.titleMedium - // ?.copyWith(color: colors.onSurface), - // ), - // shape: MaterialStateProperty.all( - // RoundedRectangleBorder( - // borderRadius: BorderRadius.circular( - // box.maxHeight * .02)), - // ), - // side: MaterialStateProperty.all( - // BorderSide(color: colors.background)), - // backgroundColor: - // MaterialStateProperty.all( - // colors.secondary, - // )), - label: 'Resend confirmation email', - onTap: () {}), - Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Need help?', - style: style.labelMedium - ?.copyWith(color: colors.onSurface), - ), - TextButton( - onPressed: () {}, - child: Text( - 'Contact us', - style: style.labelMedium?.copyWith( - fontWeight: FontWeight.w600, - color: theme.colorScheme.onSurface), - )) - ], - ) - ], - ), - ), - ), - ], - ), - ) - ], - ), - ), - ); - }, - ); - } -} - -class confirmation_input extends StatelessWidget { - const confirmation_input({ - super.key, - required this.box, - }); - - final BoxConstraints box; - - @override - Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: box.maxHeight * .0075), - child: Container( - height: box.maxHeight * .065, - width: box.maxWidth * .12, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(box.maxHeight * .15))), - ), - ), - ); - } -} diff --git a/lib/email_confirmation/view/email_confirmation_screen.dart b/lib/email_confirmation/view/email_confirmation_screen.dart new file mode 100644 index 0000000..cc85044 --- /dev/null +++ b/lib/email_confirmation/view/email_confirmation_screen.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/confirmation_screen_illustration.dart'; +import 'package:fpb/core/presentation/widget/otp_group_text_field.dart'; +import 'package:fpb/l10n/l10n.dart'; +import 'package:fpb/core/presentation/widget/confirmation_screen_actions.dart'; + +class EmailConfirmationScreen extends StatefulWidget { + static const routeName = '/emailConfirmation'; + + const EmailConfirmationScreen({super.key}); + + @override + State createState() => + _EmailConfirmationScreenState(); +} + +class _EmailConfirmationScreenState extends State { + @override + Widget build(BuildContext context) { + final l10n = context.l10n; + final theme = Theme.of(context); + final style = theme.textTheme; + final colors = theme.colorScheme; + + return LayoutBuilder( + builder: (context, box) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: colors.background, + body: Stack( + children: [ + SingleChildScrollView( + child: Padding( + padding: EdgeInsets.only( + left: box.maxHeight * .025, right: box.maxHeight * .025), + child: Column( + children: [ + SizedBox( + height: box.maxHeight * .15, + ), + Text( + l10n.confirmEmailTitleText, + style: style.titleLarge + ?.copyWith(fontSize: box.maxHeight * .045), + textAlign: TextAlign.center, + ), + SizedBox( + height: box.maxHeight * .03, + ), + RichText( + maxLines: 3, + textAlign: TextAlign.center, + text: TextSpan(children: [ + TextSpan( + text: l10n.confirmEmailBodyContentStart, + style: style.titleMedium, + ), + TextSpan( + text: l10n.confirmPhoneNumberBodyContentMid, + style: style.titleMedium?.copyWith( + fontWeight: FontWeight.w600, + //color: theme.colorScheme.onSurface + ), + ), + TextSpan( + text: l10n.confirmPhoneNumberBodyContentEnd, + style: style.titleMedium) + ])), + SizedBox( + height: box.maxHeight * .05, + ), + OtpGroupTextField( + box: box, + ), + SizedBox( + height: box.maxHeight * .05, + ), + ConfirmationScreenIllustration( + box: box, + ), + ], + ), + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: ConfirmationScreenAction( + onTapConfirmButton: () {}, + confirmButtonLabel: l10n.confirmEmailResendButton, + onTapContactUsButton: () {}, + ), + ) + ], + ), + ); + }, + ); + } +} diff --git a/lib/home/view/budget_screen.dart b/lib/home/view/budget_screen.dart index ebbed96..d07f490 100644 --- a/lib/home/view/budget_screen.dart +++ b/lib/home/view/budget_screen.dart @@ -2,6 +2,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:fpb/core/presentation/animations/circular_slider_animation/double_circular_slider.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; import 'package:fpb/home/view/widgets/custom_appbar.dart'; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart'; import 'package:fpb/core/domain/user.dart'; @@ -10,8 +11,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/home/view/widgets/different_categories.dart'; import 'package:fpb/home/view/widgets/latest_budget_activity.dart'; -import '../../core/presentation/widget/my_button.dart'; - class BudgetScreen extends StatefulWidget { const BudgetScreen({super.key}); diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 41bc4d3..702ab0c 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,49 +13,55 @@ import 'package:firebase_auth/firebase_auth.dart' as _i7; import 'package:firebase_core/firebase_core.dart' as _i6; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' - as _i17; + as _i19; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i30; + as _i33; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' - as _i19; + as _i21; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' as _i10; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i32; + as _i35; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' - as _i24; + as _i27; import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' - as _i21; + as _i24; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' - as _i22; + as _i25; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i31; + as _i34; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' - as _i20; + as _i23; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' - as _i12; + as _i14; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' - as _i28; + as _i31; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' - as _i13; + as _i15; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' - as _i25; + as _i28; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' - as _i27; -import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i29; -import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; -import 'package:fpb/core/settings/cached.dart' as _i18; + as _i30; +import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; +import 'package:fpb/core/settings/app_settings_helper.dart' as _i26; +import 'package:fpb/core/settings/cached.dart' as _i20; +import 'package:fpb/forgot_password_flow/application/bloc/forgot_password_bloc.dart' + as _i22; +import 'package:fpb/forgot_password_flow/domain/i_forgot_password_facade.dart' + as _i12; +import 'package:fpb/forgot_password_flow/infrastructure/forgot_password_repository.dart' + as _i13; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' - as _i26; + as _i29; import 'package:get_it/get_it.dart' as _i1; import 'package:google_sign_in/google_sign_in.dart' as _i9; import 'package:injectable/injectable.dart' as _i2; -import 'package:ntp/ntp.dart' as _i14; -import 'package:shared_preferences/shared_preferences.dart' as _i15; +import 'package:ntp/ntp.dart' as _i16; +import 'package:shared_preferences/shared_preferences.dart' as _i17; import 'package:user_repository/user_repository.dart' - as _i16; // ignore_for_file: unnecessary_lambdas + as _i18; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars extension GetItInjectableX on _i1.GetIt { @@ -98,56 +104,66 @@ extension GetItInjectableX on _i1.GetIt { gh<_i5.FacebookAuth>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i12.IGoogleRepositoryFacade>( - () => _i13.GoogleAuthenticationRepository( + gh.lazySingleton<_i12.IForgotPasswordRepositoryFacade>( + () => _i13.ForgotPasswordRepository( + gh<_i7.FirebaseAuth>(), + gh(), + )); + gh.lazySingleton<_i14.IGoogleRepositoryFacade>( + () => _i15.GoogleAuthenticationRepository( gh<_i9.GoogleSignIn>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i14.NTP>(() => coreInjectableModule.ntp); - await gh.factoryAsync<_i15.SharedPreferences>( + gh.lazySingleton<_i16.NTP>(() => coreInjectableModule.ntp); + await gh.factoryAsync<_i17.SharedPreferences>( () => firebaseAuthInjectableModule.sharePreferences, preResolve: true, ); - gh.singleton<_i16.UserRepository>( + gh.singleton<_i18.UserRepository>( authenticationMockModuleInjection.userRepository); - gh.factory<_i17.AuthenticationBloc>(() => _i17.AuthenticationBloc( + gh.factory<_i19.AuthenticationBloc>(() => _i19.AuthenticationBloc( authenticationRepository: gh<_i3.AuthenticationRepository>(), - userRepository: gh<_i16.UserRepository>(), + userRepository: gh<_i18.UserRepository>(), )); - gh.singleton<_i18.Cached>(_i18.Cached(gh<_i15.SharedPreferences>())); - gh.factory<_i19.FacebookAuthBloc>(() => _i19.FacebookAuthBloc( + gh.singleton<_i20.Cached>(_i20.Cached(gh<_i17.SharedPreferences>())); + gh.factory<_i21.FacebookAuthBloc>(() => _i21.FacebookAuthBloc( authenticationRepository: gh<_i10.IFacebookRepositoryFacade>())); - gh.factory<_i20.GoogleSignInBloc>(() => _i20.GoogleSignInBloc( - authenticationRepository: gh<_i12.IGoogleRepositoryFacade>())); - gh.lazySingleton<_i21.IAuthFacade>(() => _i22.FirebaseAuthFacade( + gh.factory<_i22.ForgotPasswordBloc>(() => _i22.ForgotPasswordBloc( + gh<_i22.ForgotPasswordState>(), + forgotPasswordRepositoryFacade: + gh<_i12.IForgotPasswordRepositoryFacade>(), + )); + gh.factory<_i23.GoogleSignInBloc>(() => _i23.GoogleSignInBloc( + authenticationRepository: gh<_i14.IGoogleRepositoryFacade>())); + gh.lazySingleton<_i24.IAuthFacade>(() => _i25.FirebaseAuthFacade( gh<_i7.FirebaseAuth>(), - gh<_i18.Cached>(), + gh<_i20.Cached>(), )); - gh.lazySingleton<_i23.AppSettingsHelper>(() => _i23.AppSettingsHelper( - gh<_i18.Cached>(), + gh.lazySingleton<_i26.AppSettingsHelper>(() => _i26.AppSettingsHelper( + gh<_i20.Cached>(), gh<_i4.Connectivity>(), )); - gh.factory<_i24.AuthBloc>(() => _i24.AuthBloc(gh<_i21.IAuthFacade>())); - gh.singleton<_i25.EmailPasswordBloc>(_i25.EmailPasswordBloc( - authenticationRepository: gh<_i21.IAuthFacade>())); - gh.factory<_i26.HomeViewBloc>( - () => _i26.HomeViewBloc(gh<_i23.AppSettingsHelper>())); - gh.factory<_i27.InternetAndTimeBloc>( - () => _i27.InternetAndTimeBloc(gh<_i23.AppSettingsHelper>())); + gh.factory<_i27.AuthBloc>(() => _i27.AuthBloc(gh<_i24.IAuthFacade>())); + gh.singleton<_i28.EmailPasswordBloc>(_i28.EmailPasswordBloc( + authenticationRepository: gh<_i24.IAuthFacade>())); + gh.factory<_i29.HomeViewBloc>( + () => _i29.HomeViewBloc(gh<_i26.AppSettingsHelper>())); + gh.factory<_i30.InternetAndTimeBloc>( + () => _i30.InternetAndTimeBloc(gh<_i26.AppSettingsHelper>())); return this; } } class _$GoogleAuthenticationInjectableModule - extends _i28.GoogleAuthenticationInjectableModule {} + extends _i31.GoogleAuthenticationInjectableModule {} -class _$CoreInjectableModule extends _i29.CoreInjectableModule {} +class _$CoreInjectableModule extends _i32.CoreInjectableModule {} class _$AuthenticationMockModuleInjection - extends _i30.AuthenticationMockModuleInjection {} + extends _i33.AuthenticationMockModuleInjection {} class _$FirebaseAuthInjectableModule - extends _i31.FirebaseAuthInjectableModule {} + extends _i34.FirebaseAuthInjectableModule {} class _$FacebookAuthenticationInjectableModule - extends _i32.FacebookAuthenticationInjectableModule {} + extends _i35.FacebookAuthenticationInjectableModule {} diff --git a/lib/l10n/arb/app_en.arb b/lib/l10n/arb/app_en.arb index 9779ed5..1ec51e7 100644 --- a/lib/l10n/arb/app_en.arb +++ b/lib/l10n/arb/app_en.arb @@ -248,11 +248,11 @@ "@termsOfUseSubmitBtn": { "description": "This is the text displayed on the submit button of the terms of use screen" }, - "confirmPhoneNumberTitleText": "Enter Pin\nCode", + "confirmPhoneNumberTitleText": "Enter OTP\nCode", "@confirmPhoneNumberTitleText": { "description": "This is the main title on the phone number confirmation screen" }, - "confirmPhoneNumberBodyContentStart": "We’ve sent you a confirmation email containing ", + "confirmPhoneNumberBodyContentStart": "We’ve sent you a confirmation sms containing your ", "@confirmPhoneNumberBodyContentStart": { "description": "This is the first part of the content found on the body of the confirmation screen, just below the main title" }, @@ -260,7 +260,7 @@ "@confirmPhoneNumberBodyContentMid": { "description": "This is the middle part in bold of the content found on the body of the confirmation screen" }, - "confirmPhoneNumberBodyContentEnd": "Please enter the code.", + "confirmPhoneNumberBodyContentEnd": "Please enter the code here.", "@confirmPhoneNumberBodyContentEnd": { "description": "This is the last part of the content found on the body of the confirmation screen" }, @@ -268,22 +268,33 @@ "@confirmPhoneNumberResendOtpButton": { "description": "This is the text label on the resend button on the confirmation screen" }, + "saveMoneyWithBucketScreenTitle": "Add to your savings", + "@saveMoneyWithBucketScreenTitle": { + "description": "This is the main title on the save money with bucket screen screen" + }, + "saveMoneyWithBucketSaveButton": "Save", + "@saveMoneyWithBucketSaveButton": { + "description": "This is the text label on the resend button on the phone number confirmation screen" + }, "confirmPhoneNumberNeedHelpLink": "Need help?", "@confirmPhoneNumberNeedHelpLink": { - "description": "This is the text label for the Need help link in the dark section of the confirmation screen " + "description": "This is the text label for the Need help link in the dark section of the phone number confirmation screen " }, "confirmPhoneNumberContactUs": " Contact us", "@confirmPhoneNumberContactUs": { - "description": "This is the text label for the contact us link in the dark section of the confirmation screen" + "description": "This is the text label for the contact us link in the dark section of the phone number confirmation screen" }, - "saveMoneyWithBucketScreenTitle": "Add to your savings", - "@saveMoneyWithBucketScreenTitle": { - "description": "This is the main title on the save money with bucket screen screen" + "confirmEmailTitleText": "Confirm your\nEmail", + "@confirmEmailTitleText": { + "description": "This is the main title on the email confirmation screen" }, - "saveMoneyWithBucketSaveButton": "Save", - "@saveMoneyWithBucketSaveButton": { - "description": "This is the button label of the save button on the save money with bucket screen screen" + "confirmEmailBodyContentStart": "We’ve sent you a confirmation email containing your ", + "@confirmEmailBodyContentStart": { + "description": "This is the first part of the content found on the body of the email confirmation screen, just below the main title" + }, + "confirmEmailResendButton": "Resend confirmation email", + "@confirmEmailResendButton": { + "description": "This is the text label on the resend button on the phone number confirmation screen" } - } \ No newline at end of file diff --git a/lib/l10n/arb/app_fr.arb b/lib/l10n/arb/app_fr.arb index 07beaa5..8359a06 100644 --- a/lib/l10n/arb/app_fr.arb +++ b/lib/l10n/arb/app_fr.arb @@ -252,7 +252,7 @@ "@confirmPhoneNumberTitleText": { "description": "Il s'agit du titre principal de l'écran de confirmation du numéro de téléphone." }, - "confirmPhoneNumberBodyContentStart": "Nous vous avons envoyé un e-mail de confirmation contenant ", + "confirmPhoneNumberBodyContentStart": "Nous vous avons envoyé un sms de confirmation contenant votre ", "@confirmPhoneNumberBodyContentStart": { "description": "Il s'agit de la première partie du contenu qui se trouve dans le corps de l'écran de confirmation, juste en dessous du titre principal." }, @@ -260,7 +260,7 @@ "@confirmPhoneNumberBodyContentMid": { "description": "Il s'agit de la partie centrale en gras du contenu du corps de l'écran de confirmation." }, - "confirmPhoneNumberBodyContentEnd": "Veuillez saisir le code.", + "confirmPhoneNumberBodyContentEnd": "Veuillez saisir le code ici.", "@confirmPhoneNumberBodyContentEnd": { "description": "Il s'agit de la dernière partie du contenu figurant dans le corps de l'écran de confirmation." }, @@ -283,6 +283,18 @@ "saveMoneyWithBucketSaveButton": "Sauvegarder", "@saveMoneyWithBucketSaveButton": { "description": "Il s'agit de l'intitulé du bouton \"économiser\" de l'écran \"sauvegarder de l'argent avec un seau\"." + }, + "confirmEmailTitleText": "Confirmez votre\nAdresse Email", + "@confirmEmailTitleText": { + "description": "Il s'agit du titre principal de l'écran de confirmation du courrier électronique." + }, + "confirmEmailBodyContentStart": "Nous vous avons envoyé un e-mail de confirmation contenant votre ", + "@confirmEmailBodyContentStart": { + "description": "Il s'agit de la première partie du contenu qui se trouve dans le corps de l'écran de confirmation du courrier électronique, juste en dessous du titre principal." + }, + "confirmEmailResendButton": "Renvoyer l'e-mail", + "@confirmEmailResendButton": { + "description": "Il s'agit du texte de l'étiquette du bouton de renvoi sur l'écran de confirmation du numéro de téléphone." } } \ No newline at end of file diff --git a/lib/onboarding/view/widgets/actions.dart b/lib/onboarding/view/widgets/actions.dart index da29038..428d76e 100644 --- a/lib/onboarding/view/widgets/actions.dart +++ b/lib/onboarding/view/widgets/actions.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:fpb/assets/fpb_icons/fpb_icons_icons.dart'; -import 'package:fpb/core/presentation/widget/my_button.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; import 'package:fpb/l10n/l10n.dart'; class Actions extends StatelessWidget { diff --git a/lib/phone_number_confirmation/view/phone_number_confirmation.dart b/lib/phone_number_confirmation/view/phone_number_confirmation.dart new file mode 100644 index 0000000..50309e8 --- /dev/null +++ b/lib/phone_number_confirmation/view/phone_number_confirmation.dart @@ -0,0 +1,102 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/confirmation_screen_illustration.dart'; +import 'package:fpb/core/presentation/widget/otp_group_text_field.dart'; +import 'package:fpb/l10n/l10n.dart'; +import 'package:fpb/core/presentation/widget/confirmation_screen_actions.dart'; +import 'package:fpb/core/presentation/widget/otp_input.dart'; + +class PhoneNumberConfirmationScreen extends StatefulWidget { + static const routeName = '/phoneNumberConfirmation'; + + const PhoneNumberConfirmationScreen({super.key}); + + @override + State createState() => + _PhoneNumberConfirmationScreenState(); +} + +class _PhoneNumberConfirmationScreenState + extends State { + @override + Widget build(BuildContext context) { + final l10n = context.l10n; + final theme = Theme.of(context); + final style = theme.textTheme; + final colors = theme.colorScheme; + + return LayoutBuilder( + builder: (context, box) { + return Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: colors.background, + body: Stack( + children: [ + SingleChildScrollView( + child: Padding( + padding: EdgeInsets.only( + left: box.maxHeight * .025, + right: box.maxHeight * .025), + child: Column( + children: [ + SizedBox( + height: box.maxHeight * .15, + ), + Text( + l10n.confirmPhoneNumberTitleText, + style: style.titleLarge + ?.copyWith(fontSize: box.maxHeight * .045), + textAlign: TextAlign.center, + ), + SizedBox( + height: box.maxHeight * .03, + ), + RichText( + maxLines: 3, + textAlign: TextAlign.center, + text: TextSpan(children: [ + TextSpan( + text: l10n.confirmPhoneNumberBodyContentStart, + style: style.titleMedium, + ), + TextSpan( + text: l10n.confirmPhoneNumberBodyContentMid, + style: style.titleMedium?.copyWith( + fontWeight: FontWeight.w600, + //color: theme.colorScheme.onSurface + ), + ), + TextSpan( + text: l10n.confirmPhoneNumberBodyContentEnd, + style: style.titleMedium) + ])), + SizedBox( + height: box.maxHeight * .05, + ), + OtpGroupTextField( + box: box, + ), + SizedBox( + height: box.maxHeight * .05, + ), + ConfirmationScreenIllustration( + box: box, + ), + ], + ), + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: ConfirmationScreenAction( + onTapConfirmButton: () {}, + confirmButtonLabel: l10n.confirmPhoneNumberResendOtpButton, + onTapContactUsButton: () {}, + ), + ) + ], + ), + ); + }, + ); + } +} diff --git a/lib/router/app_route.dart b/lib/router/app_route.dart index 3daf64d..7f7ba41 100644 --- a/lib/router/app_route.dart +++ b/lib/router/app_route.dart @@ -1,8 +1,10 @@ import 'package:auto_route/annotations.dart'; +import 'package:fpb/email_confirmation/email_confirmation.dart'; import 'package:fpb/home/view/home_screen.dart'; import 'package:fpb/latest_activities/view/latest_activities_screen.dart'; import 'package:fpb/onboarding/view/onboarding_screens.dart'; import 'package:fpb/onboarding/view/splash_screen.dart'; +import 'package:fpb/phone_number_confirmation/view/phone_number_confirmation.dart'; import 'package:fpb/profile/view/profile_page.dart'; import 'package:fpb/qr_code_screen/view/qr_code_screen.dart'; import 'package:fpb/savings/save_money_with_bucket/save_money_with_bucket.dart'; @@ -14,6 +16,8 @@ import 'package:fpb/sign_up/view/signup_page.dart'; routes: [ AutoRoute(page: SplashScreen, initial: true), AutoRoute(page: SignInScreen), + AutoRoute(page: PhoneNumberConfirmationScreen), + AutoRoute(page: EmailConfirmationScreen), AutoRoute(page: SignUpScreen), AutoRoute(page: SaveMoneyScreen), AutoRoute( diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 5d5e9e9..9d58a39 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,129 +11,152 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i10; -import 'package:flutter/material.dart' as _i11; - -import '../core/domain/user.dart' as _i12; -import '../home/view/home_screen.dart' as _i5; -import '../latest_activities/view/latest_activities_screen.dart' as _i6; -import '../onboarding/view/onboarding_screens.dart' as _i8; +import 'package:auto_route/auto_route.dart' as _i12; +import 'package:flutter/material.dart' as _i13; + +import '../core/domain/user.dart' as _i14; +import '../email_confirmation/email_confirmation.dart' as _i4; +import '../home/view/home_screen.dart' as _i7; +import '../latest_activities/view/latest_activities_screen.dart' as _i8; +import '../onboarding/view/onboarding_screens.dart' as _i10; import '../onboarding/view/splash_screen.dart' as _i1; -import '../profile/view/profile_page.dart' as _i9; -import '../qr_code_screen/view/qr_code_screen.dart' as _i7; -import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i4; +import '../phone_number_confirmation/view/phone_number_confirmation.dart' + as _i3; +import '../profile/view/profile_page.dart' as _i11; +import '../qr_code_screen/view/qr_code_screen.dart' as _i9; +import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; import '../sign_in/view/sign_in_page.dart' as _i2; -import '../sign_up/view/signup_page.dart' as _i3; +import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i10.RootStackRouter { - AppRoute([_i11.GlobalKey<_i11.NavigatorState>? navigatorKey]) +class AppRoute extends _i12.RootStackRouter { + AppRoute([_i13.GlobalKey<_i13.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, + PhoneNumberConfirmationRoute.name: (routeData) { + return _i12.MaterialPageX( + routeData: routeData, + child: const _i3.PhoneNumberConfirmationScreen(), + ); + }, + EmailConfirmationRoute.name: (routeData) { + return _i12.MaterialPageX( + routeData: routeData, + child: const _i4.EmailConfirmationScreen(), + ); + }, SignUpRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: const _i3.SignUpScreen(), + child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: const _i4.SaveMoneyScreen(), + child: const _i6.SaveMoneyScreen(), ); }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: _i5.HomeScreen( + child: _i7.HomeScreen( key: args.key, user: args.user, ), ); }, LatestActivitiesPage.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: const _i6.LatestActivitiesPage(), + child: const _i8.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: const _i7.QrCodeScreen(), + child: const _i9.QrCodeScreen(), ); }, OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: _i8.OnboardingScreen( + child: _i10.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, key: args.key, ), ); }, ProfileRoute.name: (routeData) { - return _i10.MaterialPageX( + return _i12.MaterialPageX( routeData: routeData, - child: const _i9.ProfileScreen(), + child: const _i11.ProfileScreen(), ); }, }; @override - List<_i10.RouteConfig> get routes => [ - _i10.RouteConfig( + List<_i12.RouteConfig> get routes => [ + _i12.RouteConfig( SplashRoute.name, path: '/', ), - _i10.RouteConfig( + _i12.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i10.RouteConfig( + _i12.RouteConfig( + PhoneNumberConfirmationRoute.name, + path: '/phone-number-confirmation-screen', + ), + _i12.RouteConfig( + EmailConfirmationRoute.name, + path: '/email-confirmation-screen', + ), + _i12.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i10.RouteConfig( + _i12.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i10.RouteConfig( + _i12.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i10.RouteConfig( + _i12.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, ) ], ), - _i10.RouteConfig( + _i12.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i10.RouteConfig( + _i12.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i10.RouteConfig( + _i12.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), @@ -142,7 +165,7 @@ class AppRoute extends _i10.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i10.PageRouteInfo { +class SplashRoute extends _i12.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -154,7 +177,7 @@ class SplashRoute extends _i10.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i10.PageRouteInfo { +class SignInRoute extends _i12.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -165,8 +188,32 @@ class SignInRoute extends _i10.PageRouteInfo { } /// generated route for -/// [_i3.SignUpScreen] -class SignUpRoute extends _i10.PageRouteInfo { +/// [_i3.PhoneNumberConfirmationScreen] +class PhoneNumberConfirmationRoute extends _i12.PageRouteInfo { + const PhoneNumberConfirmationRoute() + : super( + PhoneNumberConfirmationRoute.name, + path: '/phone-number-confirmation-screen', + ); + + static const String name = 'PhoneNumberConfirmationRoute'; +} + +/// generated route for +/// [_i4.EmailConfirmationScreen] +class EmailConfirmationRoute extends _i12.PageRouteInfo { + const EmailConfirmationRoute() + : super( + EmailConfirmationRoute.name, + path: '/email-confirmation-screen', + ); + + static const String name = 'EmailConfirmationRoute'; +} + +/// generated route for +/// [_i5.SignUpScreen] +class SignUpRoute extends _i12.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -177,8 +224,8 @@ class SignUpRoute extends _i10.PageRouteInfo { } /// generated route for -/// [_i4.SaveMoneyScreen] -class SaveMoneyRoute extends _i10.PageRouteInfo { +/// [_i6.SaveMoneyScreen] +class SaveMoneyRoute extends _i12.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -189,12 +236,12 @@ class SaveMoneyRoute extends _i10.PageRouteInfo { } /// generated route for -/// [_i5.HomeScreen] -class HomeRouter extends _i10.PageRouteInfo { +/// [_i7.HomeScreen] +class HomeRouter extends _i12.PageRouteInfo { HomeRouter({ - _i11.Key? key, - required _i12.User user, - List<_i10.PageRouteInfo>? children, + _i13.Key? key, + required _i14.User user, + List<_i12.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -214,9 +261,9 @@ class HomeRouterArgs { required this.user, }); - final _i11.Key? key; + final _i13.Key? key; - final _i12.User user; + final _i14.User user; @override String toString() { @@ -225,8 +272,8 @@ class HomeRouterArgs { } /// generated route for -/// [_i6.LatestActivitiesPage] -class LatestActivitiesPage extends _i10.PageRouteInfo { +/// [_i8.LatestActivitiesPage] +class LatestActivitiesPage extends _i12.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -237,8 +284,8 @@ class LatestActivitiesPage extends _i10.PageRouteInfo { } /// generated route for -/// [_i7.QrCodeScreen] -class QrCodeRoute extends _i10.PageRouteInfo { +/// [_i9.QrCodeScreen] +class QrCodeRoute extends _i12.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -249,11 +296,11 @@ class QrCodeRoute extends _i10.PageRouteInfo { } /// generated route for -/// [_i8.OnboardingScreen] -class OnboardingRoute extends _i10.PageRouteInfo { +/// [_i10.OnboardingScreen] +class OnboardingRoute extends _i12.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i11.Key? key, + _i13.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -274,7 +321,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i11.Key? key; + final _i13.Key? key; @override String toString() { @@ -283,8 +330,8 @@ class OnboardingRouteArgs { } /// generated route for -/// [_i9.ProfileScreen] -class ProfileRoute extends _i10.PageRouteInfo { +/// [_i11.ProfileScreen] +class ProfileRoute extends _i12.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, diff --git a/lib/savings/save_money_with_bucket/save_money_with_bucket.dart b/lib/savings/save_money_with_bucket/save_money_with_bucket.dart index a717cb9..7d5ec01 100644 --- a/lib/savings/save_money_with_bucket/save_money_with_bucket.dart +++ b/lib/savings/save_money_with_bucket/save_money_with_bucket.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:fpb/core/presentation/widget/my_button.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; import 'package:fpb/core/shared/helpers/extensions.dart'; import 'package:fpb/l10n/l10n.dart'; import 'package:fpb/savings/save_money_with_bucket/widgets/bucket_account_dropdown_button.dart'; diff --git a/lib/sign_in/view/widgets/email_input.dart b/lib/sign_in/view/widgets/email_input.dart index be954a0..9f9059e 100644 --- a/lib/sign_in/view/widgets/email_input.dart +++ b/lib/sign_in/view/widgets/email_input.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart'; -import 'package:fpb/core/presentation/widget/my_textformfield.dart'; +import 'package:fpb/core/presentation/widget/fpb_text_form_field.dart'; import 'package:fpb/l10n/l10n.dart'; class EmailInput extends StatelessWidget { diff --git a/lib/sign_in/view/widgets/login_button.dart b/lib/sign_in/view/widgets/login_button.dart index 9b0ed97..6827f61 100644 --- a/lib/sign_in/view/widgets/login_button.dart +++ b/lib/sign_in/view/widgets/login_button.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:formz/formz.dart'; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart'; -import 'package:fpb/core/presentation/widget/my_button.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; import 'package:fpb/l10n/l10n.dart'; class LoginButton extends StatelessWidget { diff --git a/lib/sign_in/view/widgets/password_input.dart b/lib/sign_in/view/widgets/password_input.dart index 3146dba..9f8391c 100644 --- a/lib/sign_in/view/widgets/password_input.dart +++ b/lib/sign_in/view/widgets/password_input.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart'; -import 'package:fpb/core/presentation/widget/my_textformfield.dart'; +import 'package:fpb/core/presentation/widget/fpb_text_form_field.dart'; import 'package:fpb/l10n/l10n.dart'; class PasswordInput extends StatelessWidget { diff --git a/lib/sign_up/view/signup_page.dart b/lib/sign_up/view/signup_page.dart index 8d6b814..1c79d00 100644 --- a/lib/sign_up/view/signup_page.dart +++ b/lib/sign_up/view/signup_page.dart @@ -7,8 +7,8 @@ import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc. import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart'; import 'package:fpb/authentication_with_google/view/loading_indicator.dart'; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart'; -import 'package:fpb/core/presentation/widget/my_button.dart'; -import 'package:fpb/core/presentation/widget/my_textformfield.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; +import 'package:fpb/core/presentation/widget/fpb_text_form_field.dart'; import 'package:fpb/injection.dart'; import 'package:fpb/l10n/l10n.dart'; import 'package:fpb/onboarding/view/widgets/alternative_auth.dart'; From bae4ab9e740d55cd68d5b14a61836d0af6bb8c14 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 16 Mar 2023 16:04:56 +0100 Subject: [PATCH 07/28] feat: list users added payment cards, added specific color for cards --- .../presentation/theming/colors/colors.dart | 4 +- .../theming/themes/light_theme.dart | 8 +- lib/core/presentation/widget/fpb_button.dart | 1 - lib/home/view/widgets/custom_appbar.dart | 4 +- lib/home/view/widgets/row_header_icons.dart | 3 +- lib/injection.config.dart | 116 ++++++-------- .../payment_method_screen.dart | 1 + lib/payment_methods/view/payment_methods.dart | 56 +++++++ .../view/widget/card_info_widget.dart | 89 +++++++++++ .../view/widget/card_number_dot.dart | 35 +++++ .../view/widget/mycard_item.dart | 80 ++++++++++ .../view/widget/payment_cards_widget.dart | 127 +++++++++++++++ lib/qr_code_screen/view/qr_code_screen.dart | 2 +- .../view/widget/my_qrcode_widget.dart | 6 +- .../view/widget/scan_qrcode_widget.dart | 2 +- lib/router/app_route.dart | 2 + lib/router/app_route.gr.dart | 147 ++++++++++-------- 17 files changed, 540 insertions(+), 143 deletions(-) create mode 100644 lib/payment_methods/payment_method_screen.dart create mode 100644 lib/payment_methods/view/payment_methods.dart create mode 100644 lib/payment_methods/view/widget/card_info_widget.dart create mode 100644 lib/payment_methods/view/widget/card_number_dot.dart create mode 100644 lib/payment_methods/view/widget/mycard_item.dart create mode 100644 lib/payment_methods/view/widget/payment_cards_widget.dart diff --git a/lib/core/presentation/theming/colors/colors.dart b/lib/core/presentation/theming/colors/colors.dart index 45a1582..3f879ee 100644 --- a/lib/core/presentation/theming/colors/colors.dart +++ b/lib/core/presentation/theming/colors/colors.dart @@ -11,11 +11,13 @@ class _AppColors { static Color onBgColorW = Color(0xffD9D9D9); // static Color surfaceW = const Color(0xffF5F5F5); // ; // static Color surfacerW = Color(0xffFFFFFF); - + static Color onSurfaceW = Color(0xfff7f7f7); // const Color(0xff808191); static Color greyLight = Color(0xFFABABAB); static Color lightGrey = Color(0xffA7A7A7); + static Color orangePrimary = Color(0xffDF602F); + static Color orangeDark = Color(0xffA34420); static Color getShade(Color color, {bool darker = false, double value = .1}) { assert(value >= 0 && value <= 1, 'verify domain interval'); diff --git a/lib/core/presentation/theming/themes/light_theme.dart b/lib/core/presentation/theming/themes/light_theme.dart index ba77ae2..ee65422 100644 --- a/lib/core/presentation/theming/themes/light_theme.dart +++ b/lib/core/presentation/theming/themes/light_theme.dart @@ -27,10 +27,10 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { secondary: _AppColors.secondaryColorW, onSecondary: _AppColors.primaryColorW, secondaryContainer: _AppColors.secondaryContainerW, - tertiary: _AppColors.onSurfaceW, - onTertiary: _AppColors.onSurfaceW, // use for static code (qrCode screen) - onTertiaryContainer: Colors - .blue, // set to odd color so we can see which component in the UI is affected + tertiary: _AppColors.onSurfaceW, // use for static code (qrCode screen) + onTertiary: _AppColors.orangePrimary, // use for cards and icon - Orange + onTertiaryContainer: + _AppColors.orangeDark, // use for cards and icon - OrangeDark inverseSurface: Colors .green, // set to odd color so we can see which component in the UI is affected inversePrimary: Colors diff --git a/lib/core/presentation/widget/fpb_button.dart b/lib/core/presentation/widget/fpb_button.dart index 5d0b417..14c0a2d 100644 --- a/lib/core/presentation/widget/fpb_button.dart +++ b/lib/core/presentation/widget/fpb_button.dart @@ -48,7 +48,6 @@ class FpbButton extends StatelessWidget { label, style: Theme.of(context).textTheme.titleMedium?.copyWith( color: textColor ?? colors.surface, - // fontWeight: FontWeight.w400, ), ), if (trailing != null) diff --git a/lib/home/view/widgets/custom_appbar.dart b/lib/home/view/widgets/custom_appbar.dart index 10f3846..65ee2a1 100644 --- a/lib/home/view/widgets/custom_appbar.dart +++ b/lib/home/view/widgets/custom_appbar.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { final double height; final Widget titleChildWidget; - final List actionChildWidget; + final List? actionChildWidget; final bool showArrow; final Color? backgroundColor; final Color? foregroundColor; @@ -11,7 +11,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { CustomAppBar({ this.height = kToolbarHeight, required this.titleChildWidget, - required this.actionChildWidget, + this.actionChildWidget, this.showArrow = false, this.backgroundColor, this.foregroundColor, diff --git a/lib/home/view/widgets/row_header_icons.dart b/lib/home/view/widgets/row_header_icons.dart index 53c8320..881e50f 100644 --- a/lib/home/view/widgets/row_header_icons.dart +++ b/lib/home/view/widgets/row_header_icons.dart @@ -1,8 +1,6 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:fpb/assets/fpb_icons/fpb_icons_icons.dart'; -import 'package:fpb/core/presentation/animations/slide_up_route_transition.dart'; -import 'package:fpb/qr_code_screen/view/qr_code_screen.dart'; import 'package:fpb/router/app_route.gr.dart'; class RowHeaderIcons extends StatelessWidget { @@ -27,6 +25,7 @@ class RowHeaderIcons extends StatelessWidget { ? InkWell( onTap: () { print('Activity screen'); + context.pushRoute(PaymentMethodRoute()); }, child: Icon( FpbIcons.search, diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 702ab0c..e23a1e0 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,55 +13,49 @@ import 'package:firebase_auth/firebase_auth.dart' as _i7; import 'package:firebase_core/firebase_core.dart' as _i6; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' - as _i19; + as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i33; + as _i28; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' - as _i21; + as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' as _i10; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i35; + as _i29; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' - as _i27; -import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' as _i24; +import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' + as _i21; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' - as _i25; + as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i34; + as _i30; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' - as _i23; + as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' - as _i14; + as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' as _i31; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' - as _i15; + as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' - as _i28; + as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' - as _i30; + as _i27; import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; -import 'package:fpb/core/settings/app_settings_helper.dart' as _i26; -import 'package:fpb/core/settings/cached.dart' as _i20; -import 'package:fpb/forgot_password_flow/application/bloc/forgot_password_bloc.dart' - as _i22; -import 'package:fpb/forgot_password_flow/domain/i_forgot_password_facade.dart' - as _i12; -import 'package:fpb/forgot_password_flow/infrastructure/forgot_password_repository.dart' - as _i13; +import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; +import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' - as _i29; + as _i26; import 'package:get_it/get_it.dart' as _i1; import 'package:google_sign_in/google_sign_in.dart' as _i9; import 'package:injectable/injectable.dart' as _i2; -import 'package:ntp/ntp.dart' as _i16; -import 'package:shared_preferences/shared_preferences.dart' as _i17; +import 'package:ntp/ntp.dart' as _i14; +import 'package:shared_preferences/shared_preferences.dart' as _i15; import 'package:user_repository/user_repository.dart' - as _i18; // ignore_for_file: unnecessary_lambdas + as _i16; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars extension GetItInjectableX on _i1.GetIt { @@ -104,66 +98,56 @@ extension GetItInjectableX on _i1.GetIt { gh<_i5.FacebookAuth>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i12.IForgotPasswordRepositoryFacade>( - () => _i13.ForgotPasswordRepository( - gh<_i7.FirebaseAuth>(), - gh(), - )); - gh.lazySingleton<_i14.IGoogleRepositoryFacade>( - () => _i15.GoogleAuthenticationRepository( + gh.lazySingleton<_i12.IGoogleRepositoryFacade>( + () => _i13.GoogleAuthenticationRepository( gh<_i9.GoogleSignIn>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i16.NTP>(() => coreInjectableModule.ntp); - await gh.factoryAsync<_i17.SharedPreferences>( + gh.lazySingleton<_i14.NTP>(() => coreInjectableModule.ntp); + await gh.factoryAsync<_i15.SharedPreferences>( () => firebaseAuthInjectableModule.sharePreferences, preResolve: true, ); - gh.singleton<_i18.UserRepository>( + gh.singleton<_i16.UserRepository>( authenticationMockModuleInjection.userRepository); - gh.factory<_i19.AuthenticationBloc>(() => _i19.AuthenticationBloc( + gh.factory<_i17.AuthenticationBloc>(() => _i17.AuthenticationBloc( authenticationRepository: gh<_i3.AuthenticationRepository>(), - userRepository: gh<_i18.UserRepository>(), + userRepository: gh<_i16.UserRepository>(), )); - gh.singleton<_i20.Cached>(_i20.Cached(gh<_i17.SharedPreferences>())); - gh.factory<_i21.FacebookAuthBloc>(() => _i21.FacebookAuthBloc( + gh.singleton<_i18.Cached>(_i18.Cached(gh<_i15.SharedPreferences>())); + gh.factory<_i19.FacebookAuthBloc>(() => _i19.FacebookAuthBloc( authenticationRepository: gh<_i10.IFacebookRepositoryFacade>())); - gh.factory<_i22.ForgotPasswordBloc>(() => _i22.ForgotPasswordBloc( - gh<_i22.ForgotPasswordState>(), - forgotPasswordRepositoryFacade: - gh<_i12.IForgotPasswordRepositoryFacade>(), - )); - gh.factory<_i23.GoogleSignInBloc>(() => _i23.GoogleSignInBloc( - authenticationRepository: gh<_i14.IGoogleRepositoryFacade>())); - gh.lazySingleton<_i24.IAuthFacade>(() => _i25.FirebaseAuthFacade( + gh.factory<_i20.GoogleSignInBloc>(() => _i20.GoogleSignInBloc( + authenticationRepository: gh<_i12.IGoogleRepositoryFacade>())); + gh.lazySingleton<_i21.IAuthFacade>(() => _i22.FirebaseAuthFacade( gh<_i7.FirebaseAuth>(), - gh<_i20.Cached>(), + gh<_i18.Cached>(), )); - gh.lazySingleton<_i26.AppSettingsHelper>(() => _i26.AppSettingsHelper( - gh<_i20.Cached>(), + gh.lazySingleton<_i23.AppSettingsHelper>(() => _i23.AppSettingsHelper( + gh<_i18.Cached>(), gh<_i4.Connectivity>(), )); - gh.factory<_i27.AuthBloc>(() => _i27.AuthBloc(gh<_i24.IAuthFacade>())); - gh.singleton<_i28.EmailPasswordBloc>(_i28.EmailPasswordBloc( - authenticationRepository: gh<_i24.IAuthFacade>())); - gh.factory<_i29.HomeViewBloc>( - () => _i29.HomeViewBloc(gh<_i26.AppSettingsHelper>())); - gh.factory<_i30.InternetAndTimeBloc>( - () => _i30.InternetAndTimeBloc(gh<_i26.AppSettingsHelper>())); + gh.factory<_i24.AuthBloc>(() => _i24.AuthBloc(gh<_i21.IAuthFacade>())); + gh.singleton<_i25.EmailPasswordBloc>(_i25.EmailPasswordBloc( + authenticationRepository: gh<_i21.IAuthFacade>())); + gh.factory<_i26.HomeViewBloc>( + () => _i26.HomeViewBloc(gh<_i23.AppSettingsHelper>())); + gh.factory<_i27.InternetAndTimeBloc>( + () => _i27.InternetAndTimeBloc(gh<_i23.AppSettingsHelper>())); return this; } } -class _$GoogleAuthenticationInjectableModule - extends _i31.GoogleAuthenticationInjectableModule {} - -class _$CoreInjectableModule extends _i32.CoreInjectableModule {} - class _$AuthenticationMockModuleInjection - extends _i33.AuthenticationMockModuleInjection {} + extends _i28.AuthenticationMockModuleInjection {} + +class _$FacebookAuthenticationInjectableModule + extends _i29.FacebookAuthenticationInjectableModule {} class _$FirebaseAuthInjectableModule - extends _i34.FirebaseAuthInjectableModule {} + extends _i30.FirebaseAuthInjectableModule {} -class _$FacebookAuthenticationInjectableModule - extends _i35.FacebookAuthenticationInjectableModule {} +class _$GoogleAuthenticationInjectableModule + extends _i31.GoogleAuthenticationInjectableModule {} + +class _$CoreInjectableModule extends _i32.CoreInjectableModule {} diff --git a/lib/payment_methods/payment_method_screen.dart b/lib/payment_methods/payment_method_screen.dart new file mode 100644 index 0000000..f8e3e71 --- /dev/null +++ b/lib/payment_methods/payment_method_screen.dart @@ -0,0 +1 @@ +export 'view/payment_methods.dart'; diff --git a/lib/payment_methods/view/payment_methods.dart b/lib/payment_methods/view/payment_methods.dart new file mode 100644 index 0000000..933bc5f --- /dev/null +++ b/lib/payment_methods/view/payment_methods.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:fpb/home/view/widgets/custom_appbar.dart'; +import 'package:fpb/payment_methods/view/widget/payment_cards_widget.dart'; + +class PaymentMethodScreen extends StatelessWidget { + const PaymentMethodScreen({super.key}); + + @override + Widget build(BuildContext context) { + return AnnotatedRegion( + value: SystemUiOverlayStyle( + statusBarColor: Theme.of(context).colorScheme.surface, + statusBarIconBrightness: Brightness.dark, // dark icon for iOS + statusBarBrightness: Brightness.dark, // set dark icon for android + ), + child: LayoutBuilder( + builder: (context, box) { + return SafeArea( + child: Scaffold( + backgroundColor: Theme.of(context).colorScheme.surface, + appBar: CustomAppBar( + showArrow: true, + backgroundColor: Theme.of(context).colorScheme.surface, + titleChildWidget: Text( + 'Payment methods', + ), + ), + body: SingleChildScrollView( + child: Column( + children: [ + PaymentCardsWidget( + box: box, + ), + ], + ), + // SliverFixedExtentList( + // itemExtent: 50.0, + // delegate: SliverChildBuilderDelegate( + // (BuildContext context, int index) { + // return Container( + // alignment: Alignment.center, + // color: Colors.lightBlue[100 * (index % 9)], + // child: Text('List Item $index'), + // ); + // }, + // ), + // ), + ), + ), + ); + }, + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/card_info_widget.dart b/lib/payment_methods/view/widget/card_info_widget.dart new file mode 100644 index 0000000..2f394e2 --- /dev/null +++ b/lib/payment_methods/view/widget/card_info_widget.dart @@ -0,0 +1,89 @@ +import 'package:flutter/material.dart'; + +class CardInfoWidget extends StatelessWidget { + const CardInfoWidget({ + super.key, + required this.box, + this.expiryDate, + this.cvv, + this.defaulPayment, + }); + + final BoxConstraints box; + final String? expiryDate; + final String? cvv; + final bool? defaulPayment; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + return Container( + width: box.maxWidth, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + // expiry date + SizedBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Expriy', + style: theme.textTheme.titleSmall?.copyWith( + fontWeight: FontWeight.w400, + ), + ), + Text( + expiryDate ?? '04/2025', + style: theme.textTheme.titleMedium?.copyWith( + color: colors.surface, + ), + ), + ], + ), + ), + // CVV + SizedBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'CVV', + style: theme.textTheme.titleSmall?.copyWith( + fontWeight: FontWeight.w400, + ), + ), + Text( + cvv ?? '04/2025', + style: theme.textTheme.titleMedium?.copyWith( + color: colors.surface, + ), + ), + ], + ), + ), + // default payment method + SizedBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Expriy', + style: theme.textTheme.titleSmall, + ), + Text( + expiryDate ?? '04/2025', + style: theme.textTheme.titleMedium?.copyWith( + color: colors.surface, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/card_number_dot.dart b/lib/payment_methods/view/widget/card_number_dot.dart new file mode 100644 index 0000000..1ec7062 --- /dev/null +++ b/lib/payment_methods/view/widget/card_number_dot.dart @@ -0,0 +1,35 @@ +import 'package:flutter/material.dart'; + +class CardNumberDot extends StatelessWidget { + const CardNumberDot({super.key}); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + return Wrap( + spacing: 5.0, + children: [ + Icon( + Icons.circle, + size: 12.0, + color: theme.cardColor, + ), + Icon( + Icons.circle, + size: 12.0, + color: theme.cardColor, + ), + Icon( + Icons.circle, + size: 12.0, + color: theme.cardColor, + ), + Icon( + Icons.circle, + size: 12.0, + color: theme.cardColor, + ), + ], + ); + } +} diff --git a/lib/payment_methods/view/widget/mycard_item.dart b/lib/payment_methods/view/widget/mycard_item.dart new file mode 100644 index 0000000..f851d6c --- /dev/null +++ b/lib/payment_methods/view/widget/mycard_item.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; +import 'package:fpb/payment_methods/view/widget/card_info_widget.dart'; +import 'package:fpb/payment_methods/view/widget/card_number_dot.dart'; + +class MyCardItem extends StatelessWidget { + const MyCardItem({ + super.key, + required this.box, + this.bgColor, + this.cardIndex, + }); + + final BoxConstraints box; + final Color? bgColor; + final int? cardIndex; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colors = Theme.of(context).colorScheme; + return Container( + width: box.maxWidth * 0.9, + height: box.maxHeight * 0.2, + decoration: BoxDecoration( + color: bgColor ?? colors.onTertiary, + borderRadius: BorderRadius.circular( + 10.0, + ), + ), + padding: EdgeInsets.symmetric( + horizontal: box.maxWidth * 0.04, + vertical: cardIndex == 0 || cardIndex == 1 + ? box.maxHeight * 0.0 + : box.maxHeight * 0.017, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + width: box.maxWidth, + // color: Colors.red, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Card Number', + style: theme.textTheme.titleSmall, + ), + SizedBox( + height: 5.0, + ), + SizedBox( + width: box.maxWidth, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + children: [ + CardNumberDot(), + CardNumberDot(), + CardNumberDot(), + ], + ), + ) + ], + ), + ), + CardInfoWidget( + box: box, + ), + if (cardIndex == 0 || cardIndex == 1) ...[ + VerticalSpacingWidget( + box: box, + height: box.maxHeight * 0.01, + ), + ] + ], + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/payment_cards_widget.dart b/lib/payment_methods/view/widget/payment_cards_widget.dart new file mode 100644 index 0000000..02214fc --- /dev/null +++ b/lib/payment_methods/view/widget/payment_cards_widget.dart @@ -0,0 +1,127 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/domain/virtualCard.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; +import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; +import 'package:fpb/payment_methods/view/widget/mycard_item.dart'; + +class PaymentCardsWidget extends StatefulWidget { + const PaymentCardsWidget({ + super.key, + required this.box, + }); + + final BoxConstraints box; + + @override + State createState() => _PaymentCardsWidgetState(); +} + +class _PaymentCardsWidgetState extends State { + Duration kAnimationDuration = Duration(microseconds: 150); + + List cardItems = [ + const VirtualCard( + index: 0, + balance: '200', + cardNumber: '1234 6565 6577', + expiry: '04/25', + cvv: '123', + type: 'visa', + lastFourDigits: '1232', + ), + const VirtualCard( + index: 0, + balance: '1000', + cardNumber: '1234 6565 6577', + expiry: '04/25', + cvv: '123', + type: 'visa', + lastFourDigits: '5050', + ), + const VirtualCard( + index: 0, + balance: '550.50', + cardNumber: '1234 6565 6577', + expiry: '04/25', + cvv: '123', + type: 'visa', + lastFourDigits: '7070', + ), + ]; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + return Container( + width: widget.box.maxWidth, + child: Column( + children: [ + Container( + width: widget.box.maxWidth * 0.9, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + Text( + 'My Cards', + style: Theme.of(context).textTheme.titleLarge, + ), + FpbButton( + width: widget.box.maxWidth * 0.5, + height: widget.box.maxHeight * 0.055, + label: 'Add Card', + onTap: () => print('Add Card'), + spaceAround: true, + leading: Icon( + Icons.add, + ), + ), + ], + ), + ), + VerticalSpacingWidget( + box: widget.box, + height: widget.box.maxHeight * 0.02, + ), + // display cards + Container( + width: widget.box.maxWidth, + height: widget.box.maxHeight * 0.4, + padding: EdgeInsets.symmetric( + vertical: widget.box.maxWidth * 0.01, + ), + child: Stack( + alignment: Alignment.center, + children: [ + Positioned( + top: 0.0, + child: MyCardItem( + box: widget.box, + cardIndex: 0, + bgColor: colors.onTertiaryContainer, + ), + ), + Positioned( + top: 60.0, + child: MyCardItem( + box: widget.box, + bgColor: Color(0xFFC95528), + cardIndex: 1, + ), + ), + Positioned( + bottom: 20.0, + child: MyCardItem( + box: widget.box, + // bgColor: Colors.indigo, + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/qr_code_screen/view/qr_code_screen.dart b/lib/qr_code_screen/view/qr_code_screen.dart index e0b386f..fb1e6d2 100644 --- a/lib/qr_code_screen/view/qr_code_screen.dart +++ b/lib/qr_code_screen/view/qr_code_screen.dart @@ -132,7 +132,7 @@ class _QrCodeScreenState extends State style: TextStyle( color: Theme.of(context) .colorScheme - .onTertiary, + .tertiary, fontSize: box.maxWidth * 0.05, ), textAlign: TextAlign.center, diff --git a/lib/qr_code_screen/view/widget/my_qrcode_widget.dart b/lib/qr_code_screen/view/widget/my_qrcode_widget.dart index 5f03ceb..fcaee2c 100644 --- a/lib/qr_code_screen/view/widget/my_qrcode_widget.dart +++ b/lib/qr_code_screen/view/widget/my_qrcode_widget.dart @@ -25,7 +25,7 @@ class MyQrCode extends StatelessWidget { child: Text( "My QR Code", style: TextStyle( - color: Theme.of(context).colorScheme.onTertiary, + color: Theme.of(context).colorScheme.tertiary, fontSize: box.maxWidth * 0.056, ), textAlign: TextAlign.center, @@ -58,7 +58,7 @@ class MyQrCode extends StatelessWidget { Text( "John Doe", style: TextStyle( - color: Theme.of(context).colorScheme.onTertiary, + color: Theme.of(context).colorScheme.tertiary, fontSize: box.maxWidth * 0.056, ), textAlign: TextAlign.center, @@ -72,7 +72,7 @@ class MyQrCode extends StatelessWidget { child: Text( "@johndoe", style: TextStyle( - color: Theme.of(context).colorScheme.onTertiary.withOpacity(0.5), + color: Theme.of(context).colorScheme.tertiary.withOpacity(0.5), fontSize: box.maxWidth * 0.04, fontWeight: FontWeight.normal, ), diff --git a/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart b/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart index 6fbdf95..72d32f3 100644 --- a/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart +++ b/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart @@ -26,7 +26,7 @@ class ScanQrCodeWidget extends StatelessWidget { "Scan a code", style: TextStyle( color: - Theme.of(context).colorScheme.onTertiary, + Theme.of(context).colorScheme.tertiary, fontSize: box.maxWidth * 0.056, ), textAlign: TextAlign.center, diff --git a/lib/router/app_route.dart b/lib/router/app_route.dart index 7f7ba41..f0473f4 100644 --- a/lib/router/app_route.dart +++ b/lib/router/app_route.dart @@ -4,6 +4,7 @@ import 'package:fpb/home/view/home_screen.dart'; import 'package:fpb/latest_activities/view/latest_activities_screen.dart'; import 'package:fpb/onboarding/view/onboarding_screens.dart'; import 'package:fpb/onboarding/view/splash_screen.dart'; +import 'package:fpb/payment_methods/payment_method_screen.dart'; import 'package:fpb/phone_number_confirmation/view/phone_number_confirmation.dart'; import 'package:fpb/profile/view/profile_page.dart'; import 'package:fpb/qr_code_screen/view/qr_code_screen.dart'; @@ -20,6 +21,7 @@ import 'package:fpb/sign_up/view/signup_page.dart'; AutoRoute(page: EmailConfirmationScreen), AutoRoute(page: SignUpScreen), AutoRoute(page: SaveMoneyScreen), + AutoRoute(page: PaymentMethodScreen), AutoRoute( name: 'HomeRouter', page: HomeScreen, diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 9d58a39..01f91b6 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,152 +11,163 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i12; -import 'package:flutter/material.dart' as _i13; +import 'package:auto_route/auto_route.dart' as _i13; +import 'package:flutter/material.dart' as _i14; -import '../core/domain/user.dart' as _i14; +import '../core/domain/user.dart' as _i15; import '../email_confirmation/email_confirmation.dart' as _i4; -import '../home/view/home_screen.dart' as _i7; -import '../latest_activities/view/latest_activities_screen.dart' as _i8; -import '../onboarding/view/onboarding_screens.dart' as _i10; +import '../home/view/home_screen.dart' as _i8; +import '../latest_activities/view/latest_activities_screen.dart' as _i9; +import '../onboarding/view/onboarding_screens.dart' as _i11; import '../onboarding/view/splash_screen.dart' as _i1; +import '../payment_methods/payment_method_screen.dart' as _i7; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i11; -import '../qr_code_screen/view/qr_code_screen.dart' as _i9; +import '../profile/view/profile_page.dart' as _i12; +import '../qr_code_screen/view/qr_code_screen.dart' as _i10; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i12.RootStackRouter { - AppRoute([_i13.GlobalKey<_i13.NavigatorState>? navigatorKey]) +class AppRoute extends _i13.RootStackRouter { + AppRoute([_i14.GlobalKey<_i14.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); }, + PaymentMethodRoute.name: (routeData) { + return _i13.MaterialPageX( + routeData: routeData, + child: const _i7.PaymentMethodScreen(), + ); + }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, - child: _i7.HomeScreen( + child: _i8.HomeScreen( key: args.key, user: args.user, ), ); }, LatestActivitiesPage.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, - child: const _i8.LatestActivitiesPage(), + child: const _i9.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, - child: const _i9.QrCodeScreen(), + child: const _i10.QrCodeScreen(), ); }, OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, - child: _i10.OnboardingScreen( + child: _i11.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, key: args.key, ), ); }, ProfileRoute.name: (routeData) { - return _i12.MaterialPageX( + return _i13.MaterialPageX( routeData: routeData, - child: const _i11.ProfileScreen(), + child: const _i12.ProfileScreen(), ); }, }; @override - List<_i12.RouteConfig> get routes => [ - _i12.RouteConfig( + List<_i13.RouteConfig> get routes => [ + _i13.RouteConfig( SplashRoute.name, path: '/', ), - _i12.RouteConfig( + _i13.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( + PaymentMethodRoute.name, + path: '/payment-method-screen', + ), + _i13.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i12.RouteConfig( + _i13.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, ) ], ), - _i12.RouteConfig( + _i13.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i12.RouteConfig( + _i13.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i12.RouteConfig( + _i13.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), @@ -165,7 +176,7 @@ class AppRoute extends _i12.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i12.PageRouteInfo { +class SplashRoute extends _i13.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -177,7 +188,7 @@ class SplashRoute extends _i12.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i12.PageRouteInfo { +class SignInRoute extends _i13.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -189,7 +200,7 @@ class SignInRoute extends _i12.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i12.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i13.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -201,7 +212,7 @@ class PhoneNumberConfirmationRoute extends _i12.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i12.PageRouteInfo { +class EmailConfirmationRoute extends _i13.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -213,7 +224,7 @@ class EmailConfirmationRoute extends _i12.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i12.PageRouteInfo { +class SignUpRoute extends _i13.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -225,7 +236,7 @@ class SignUpRoute extends _i12.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i12.PageRouteInfo { +class SaveMoneyRoute extends _i13.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -236,12 +247,24 @@ class SaveMoneyRoute extends _i12.PageRouteInfo { } /// generated route for -/// [_i7.HomeScreen] -class HomeRouter extends _i12.PageRouteInfo { +/// [_i7.PaymentMethodScreen] +class PaymentMethodRoute extends _i13.PageRouteInfo { + const PaymentMethodRoute() + : super( + PaymentMethodRoute.name, + path: '/payment-method-screen', + ); + + static const String name = 'PaymentMethodRoute'; +} + +/// generated route for +/// [_i8.HomeScreen] +class HomeRouter extends _i13.PageRouteInfo { HomeRouter({ - _i13.Key? key, - required _i14.User user, - List<_i12.PageRouteInfo>? children, + _i14.Key? key, + required _i15.User user, + List<_i13.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -261,9 +284,9 @@ class HomeRouterArgs { required this.user, }); - final _i13.Key? key; + final _i14.Key? key; - final _i14.User user; + final _i15.User user; @override String toString() { @@ -272,8 +295,8 @@ class HomeRouterArgs { } /// generated route for -/// [_i8.LatestActivitiesPage] -class LatestActivitiesPage extends _i12.PageRouteInfo { +/// [_i9.LatestActivitiesPage] +class LatestActivitiesPage extends _i13.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -284,8 +307,8 @@ class LatestActivitiesPage extends _i12.PageRouteInfo { } /// generated route for -/// [_i9.QrCodeScreen] -class QrCodeRoute extends _i12.PageRouteInfo { +/// [_i10.QrCodeScreen] +class QrCodeRoute extends _i13.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -296,11 +319,11 @@ class QrCodeRoute extends _i12.PageRouteInfo { } /// generated route for -/// [_i10.OnboardingScreen] -class OnboardingRoute extends _i12.PageRouteInfo { +/// [_i11.OnboardingScreen] +class OnboardingRoute extends _i13.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i13.Key? key, + _i14.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -321,7 +344,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i13.Key? key; + final _i14.Key? key; @override String toString() { @@ -330,8 +353,8 @@ class OnboardingRouteArgs { } /// generated route for -/// [_i11.ProfileScreen] -class ProfileRoute extends _i12.PageRouteInfo { +/// [_i12.ProfileScreen] +class ProfileRoute extends _i13.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, From 9df4c3277f414745efc28cda4a5a8ebab25d97dd Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 16 Mar 2023 16:24:46 +0100 Subject: [PATCH 08/28] feat: implemented linked account widgets --- lib/payment_methods/view/payment_methods.dart | 17 +++------- .../view/widget/account_linked.dart | 21 +++++++++++++ .../view/widget/card_number_dot.dart | 10 +++--- .../view/widget/link_accounts.dart | 31 +++++++++++++++++++ .../view/widget/mycard_item.dart | 7 +++++ 5 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 lib/payment_methods/view/widget/account_linked.dart create mode 100644 lib/payment_methods/view/widget/link_accounts.dart diff --git a/lib/payment_methods/view/payment_methods.dart b/lib/payment_methods/view/payment_methods.dart index 933bc5f..34a73c2 100644 --- a/lib/payment_methods/view/payment_methods.dart +++ b/lib/payment_methods/view/payment_methods.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:fpb/home/view/widgets/custom_appbar.dart'; +import 'package:fpb/payment_methods/view/widget/link_accounts.dart'; import 'package:fpb/payment_methods/view/widget/payment_cards_widget.dart'; class PaymentMethodScreen extends StatelessWidget { @@ -32,20 +33,12 @@ class PaymentMethodScreen extends StatelessWidget { PaymentCardsWidget( box: box, ), + // link accounts + LinkAccounts( + box: box, + ), ], ), - // SliverFixedExtentList( - // itemExtent: 50.0, - // delegate: SliverChildBuilderDelegate( - // (BuildContext context, int index) { - // return Container( - // alignment: Alignment.center, - // color: Colors.lightBlue[100 * (index % 9)], - // child: Text('List Item $index'), - // ); - // }, - // ), - // ), ), ), ); diff --git a/lib/payment_methods/view/widget/account_linked.dart b/lib/payment_methods/view/widget/account_linked.dart new file mode 100644 index 0000000..9c2c870 --- /dev/null +++ b/lib/payment_methods/view/widget/account_linked.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class AccountLinked extends StatelessWidget { + const AccountLinked({super.key}); + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Text( + 'Paypal', + ), + Text( + 'Widget for linked account', + ), + ], + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/card_number_dot.dart b/lib/payment_methods/view/widget/card_number_dot.dart index 1ec7062..a7114ac 100644 --- a/lib/payment_methods/view/widget/card_number_dot.dart +++ b/lib/payment_methods/view/widget/card_number_dot.dart @@ -7,26 +7,26 @@ class CardNumberDot extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Wrap( - spacing: 5.0, + spacing: 2.0, children: [ Icon( Icons.circle, - size: 12.0, + size: 10.0, color: theme.cardColor, ), Icon( Icons.circle, - size: 12.0, + size: 10.0, color: theme.cardColor, ), Icon( Icons.circle, - size: 12.0, + size: 10.0, color: theme.cardColor, ), Icon( Icons.circle, - size: 12.0, + size: 10.0, color: theme.cardColor, ), ], diff --git a/lib/payment_methods/view/widget/link_accounts.dart b/lib/payment_methods/view/widget/link_accounts.dart new file mode 100644 index 0000000..3f87d92 --- /dev/null +++ b/lib/payment_methods/view/widget/link_accounts.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class LinkAccounts extends StatelessWidget { + const LinkAccounts({ + super.key, + required this.box, + }); + + final BoxConstraints box; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + + return Container( + width: box.maxWidth * 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Other accounts', + style: theme.textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.w400, + ), + ), + // btn link account + ], + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/mycard_item.dart b/lib/payment_methods/view/widget/mycard_item.dart index f851d6c..2504865 100644 --- a/lib/payment_methods/view/widget/mycard_item.dart +++ b/lib/payment_methods/view/widget/mycard_item.dart @@ -54,10 +54,17 @@ class MyCardItem extends StatelessWidget { width: box.maxWidth, child: Wrap( alignment: WrapAlignment.spaceBetween, + crossAxisAlignment: WrapCrossAlignment.center, children: [ CardNumberDot(), CardNumberDot(), CardNumberDot(), + Text( + '1234', + style: theme.textTheme.titleSmall?.copyWith( + color: colors.surface, + ), + ), ], ), ) From 8bbaa2a19a7c601e84e852859eb718b60e47655e Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 16 Mar 2023 16:31:07 +0100 Subject: [PATCH 09/28] update: pull lastest code from dev branch --- lib/injection.config.dart | 116 ++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 66 deletions(-) diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 702ab0c..e23a1e0 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,55 +13,49 @@ import 'package:firebase_auth/firebase_auth.dart' as _i7; import 'package:firebase_core/firebase_core.dart' as _i6; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' - as _i19; + as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i33; + as _i28; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' - as _i21; + as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' as _i10; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i35; + as _i29; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' - as _i27; -import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' as _i24; +import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' + as _i21; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' - as _i25; + as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i34; + as _i30; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' - as _i23; + as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' - as _i14; + as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' as _i31; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' - as _i15; + as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' - as _i28; + as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' - as _i30; + as _i27; import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; -import 'package:fpb/core/settings/app_settings_helper.dart' as _i26; -import 'package:fpb/core/settings/cached.dart' as _i20; -import 'package:fpb/forgot_password_flow/application/bloc/forgot_password_bloc.dart' - as _i22; -import 'package:fpb/forgot_password_flow/domain/i_forgot_password_facade.dart' - as _i12; -import 'package:fpb/forgot_password_flow/infrastructure/forgot_password_repository.dart' - as _i13; +import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; +import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' - as _i29; + as _i26; import 'package:get_it/get_it.dart' as _i1; import 'package:google_sign_in/google_sign_in.dart' as _i9; import 'package:injectable/injectable.dart' as _i2; -import 'package:ntp/ntp.dart' as _i16; -import 'package:shared_preferences/shared_preferences.dart' as _i17; +import 'package:ntp/ntp.dart' as _i14; +import 'package:shared_preferences/shared_preferences.dart' as _i15; import 'package:user_repository/user_repository.dart' - as _i18; // ignore_for_file: unnecessary_lambdas + as _i16; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars extension GetItInjectableX on _i1.GetIt { @@ -104,66 +98,56 @@ extension GetItInjectableX on _i1.GetIt { gh<_i5.FacebookAuth>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i12.IForgotPasswordRepositoryFacade>( - () => _i13.ForgotPasswordRepository( - gh<_i7.FirebaseAuth>(), - gh(), - )); - gh.lazySingleton<_i14.IGoogleRepositoryFacade>( - () => _i15.GoogleAuthenticationRepository( + gh.lazySingleton<_i12.IGoogleRepositoryFacade>( + () => _i13.GoogleAuthenticationRepository( gh<_i9.GoogleSignIn>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i16.NTP>(() => coreInjectableModule.ntp); - await gh.factoryAsync<_i17.SharedPreferences>( + gh.lazySingleton<_i14.NTP>(() => coreInjectableModule.ntp); + await gh.factoryAsync<_i15.SharedPreferences>( () => firebaseAuthInjectableModule.sharePreferences, preResolve: true, ); - gh.singleton<_i18.UserRepository>( + gh.singleton<_i16.UserRepository>( authenticationMockModuleInjection.userRepository); - gh.factory<_i19.AuthenticationBloc>(() => _i19.AuthenticationBloc( + gh.factory<_i17.AuthenticationBloc>(() => _i17.AuthenticationBloc( authenticationRepository: gh<_i3.AuthenticationRepository>(), - userRepository: gh<_i18.UserRepository>(), + userRepository: gh<_i16.UserRepository>(), )); - gh.singleton<_i20.Cached>(_i20.Cached(gh<_i17.SharedPreferences>())); - gh.factory<_i21.FacebookAuthBloc>(() => _i21.FacebookAuthBloc( + gh.singleton<_i18.Cached>(_i18.Cached(gh<_i15.SharedPreferences>())); + gh.factory<_i19.FacebookAuthBloc>(() => _i19.FacebookAuthBloc( authenticationRepository: gh<_i10.IFacebookRepositoryFacade>())); - gh.factory<_i22.ForgotPasswordBloc>(() => _i22.ForgotPasswordBloc( - gh<_i22.ForgotPasswordState>(), - forgotPasswordRepositoryFacade: - gh<_i12.IForgotPasswordRepositoryFacade>(), - )); - gh.factory<_i23.GoogleSignInBloc>(() => _i23.GoogleSignInBloc( - authenticationRepository: gh<_i14.IGoogleRepositoryFacade>())); - gh.lazySingleton<_i24.IAuthFacade>(() => _i25.FirebaseAuthFacade( + gh.factory<_i20.GoogleSignInBloc>(() => _i20.GoogleSignInBloc( + authenticationRepository: gh<_i12.IGoogleRepositoryFacade>())); + gh.lazySingleton<_i21.IAuthFacade>(() => _i22.FirebaseAuthFacade( gh<_i7.FirebaseAuth>(), - gh<_i20.Cached>(), + gh<_i18.Cached>(), )); - gh.lazySingleton<_i26.AppSettingsHelper>(() => _i26.AppSettingsHelper( - gh<_i20.Cached>(), + gh.lazySingleton<_i23.AppSettingsHelper>(() => _i23.AppSettingsHelper( + gh<_i18.Cached>(), gh<_i4.Connectivity>(), )); - gh.factory<_i27.AuthBloc>(() => _i27.AuthBloc(gh<_i24.IAuthFacade>())); - gh.singleton<_i28.EmailPasswordBloc>(_i28.EmailPasswordBloc( - authenticationRepository: gh<_i24.IAuthFacade>())); - gh.factory<_i29.HomeViewBloc>( - () => _i29.HomeViewBloc(gh<_i26.AppSettingsHelper>())); - gh.factory<_i30.InternetAndTimeBloc>( - () => _i30.InternetAndTimeBloc(gh<_i26.AppSettingsHelper>())); + gh.factory<_i24.AuthBloc>(() => _i24.AuthBloc(gh<_i21.IAuthFacade>())); + gh.singleton<_i25.EmailPasswordBloc>(_i25.EmailPasswordBloc( + authenticationRepository: gh<_i21.IAuthFacade>())); + gh.factory<_i26.HomeViewBloc>( + () => _i26.HomeViewBloc(gh<_i23.AppSettingsHelper>())); + gh.factory<_i27.InternetAndTimeBloc>( + () => _i27.InternetAndTimeBloc(gh<_i23.AppSettingsHelper>())); return this; } } -class _$GoogleAuthenticationInjectableModule - extends _i31.GoogleAuthenticationInjectableModule {} - -class _$CoreInjectableModule extends _i32.CoreInjectableModule {} - class _$AuthenticationMockModuleInjection - extends _i33.AuthenticationMockModuleInjection {} + extends _i28.AuthenticationMockModuleInjection {} + +class _$FacebookAuthenticationInjectableModule + extends _i29.FacebookAuthenticationInjectableModule {} class _$FirebaseAuthInjectableModule - extends _i34.FirebaseAuthInjectableModule {} + extends _i30.FirebaseAuthInjectableModule {} -class _$FacebookAuthenticationInjectableModule - extends _i35.FacebookAuthenticationInjectableModule {} +class _$GoogleAuthenticationInjectableModule + extends _i31.GoogleAuthenticationInjectableModule {} + +class _$CoreInjectableModule extends _i32.CoreInjectableModule {} From ddbf25e3a83e3ed571a671e2b92ab526ebcda163 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 17 Mar 2023 06:03:17 +0100 Subject: [PATCH 10/28] fix: resolve emerge issues in generated auto_route, comment an invalid URI import for contact_us --- lib/injection.config.dart | 116 +++++++++++++++------------------- lib/router/app_route.dart | 3 +- lib/router/app_route.gr.dart | 119 ++++++++++++++++++----------------- 3 files changed, 112 insertions(+), 126 deletions(-) diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 702ab0c..e23a1e0 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,55 +13,49 @@ import 'package:firebase_auth/firebase_auth.dart' as _i7; import 'package:firebase_core/firebase_core.dart' as _i6; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' - as _i19; + as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i33; + as _i28; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' - as _i21; + as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' as _i10; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i35; + as _i29; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' - as _i27; -import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' as _i24; +import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' + as _i21; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' - as _i25; + as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i34; + as _i30; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' - as _i23; + as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' - as _i14; + as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' as _i31; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' - as _i15; + as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' - as _i28; + as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' - as _i30; + as _i27; import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; -import 'package:fpb/core/settings/app_settings_helper.dart' as _i26; -import 'package:fpb/core/settings/cached.dart' as _i20; -import 'package:fpb/forgot_password_flow/application/bloc/forgot_password_bloc.dart' - as _i22; -import 'package:fpb/forgot_password_flow/domain/i_forgot_password_facade.dart' - as _i12; -import 'package:fpb/forgot_password_flow/infrastructure/forgot_password_repository.dart' - as _i13; +import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; +import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' - as _i29; + as _i26; import 'package:get_it/get_it.dart' as _i1; import 'package:google_sign_in/google_sign_in.dart' as _i9; import 'package:injectable/injectable.dart' as _i2; -import 'package:ntp/ntp.dart' as _i16; -import 'package:shared_preferences/shared_preferences.dart' as _i17; +import 'package:ntp/ntp.dart' as _i14; +import 'package:shared_preferences/shared_preferences.dart' as _i15; import 'package:user_repository/user_repository.dart' - as _i18; // ignore_for_file: unnecessary_lambdas + as _i16; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars extension GetItInjectableX on _i1.GetIt { @@ -104,66 +98,56 @@ extension GetItInjectableX on _i1.GetIt { gh<_i5.FacebookAuth>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i12.IForgotPasswordRepositoryFacade>( - () => _i13.ForgotPasswordRepository( - gh<_i7.FirebaseAuth>(), - gh(), - )); - gh.lazySingleton<_i14.IGoogleRepositoryFacade>( - () => _i15.GoogleAuthenticationRepository( + gh.lazySingleton<_i12.IGoogleRepositoryFacade>( + () => _i13.GoogleAuthenticationRepository( gh<_i9.GoogleSignIn>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i16.NTP>(() => coreInjectableModule.ntp); - await gh.factoryAsync<_i17.SharedPreferences>( + gh.lazySingleton<_i14.NTP>(() => coreInjectableModule.ntp); + await gh.factoryAsync<_i15.SharedPreferences>( () => firebaseAuthInjectableModule.sharePreferences, preResolve: true, ); - gh.singleton<_i18.UserRepository>( + gh.singleton<_i16.UserRepository>( authenticationMockModuleInjection.userRepository); - gh.factory<_i19.AuthenticationBloc>(() => _i19.AuthenticationBloc( + gh.factory<_i17.AuthenticationBloc>(() => _i17.AuthenticationBloc( authenticationRepository: gh<_i3.AuthenticationRepository>(), - userRepository: gh<_i18.UserRepository>(), + userRepository: gh<_i16.UserRepository>(), )); - gh.singleton<_i20.Cached>(_i20.Cached(gh<_i17.SharedPreferences>())); - gh.factory<_i21.FacebookAuthBloc>(() => _i21.FacebookAuthBloc( + gh.singleton<_i18.Cached>(_i18.Cached(gh<_i15.SharedPreferences>())); + gh.factory<_i19.FacebookAuthBloc>(() => _i19.FacebookAuthBloc( authenticationRepository: gh<_i10.IFacebookRepositoryFacade>())); - gh.factory<_i22.ForgotPasswordBloc>(() => _i22.ForgotPasswordBloc( - gh<_i22.ForgotPasswordState>(), - forgotPasswordRepositoryFacade: - gh<_i12.IForgotPasswordRepositoryFacade>(), - )); - gh.factory<_i23.GoogleSignInBloc>(() => _i23.GoogleSignInBloc( - authenticationRepository: gh<_i14.IGoogleRepositoryFacade>())); - gh.lazySingleton<_i24.IAuthFacade>(() => _i25.FirebaseAuthFacade( + gh.factory<_i20.GoogleSignInBloc>(() => _i20.GoogleSignInBloc( + authenticationRepository: gh<_i12.IGoogleRepositoryFacade>())); + gh.lazySingleton<_i21.IAuthFacade>(() => _i22.FirebaseAuthFacade( gh<_i7.FirebaseAuth>(), - gh<_i20.Cached>(), + gh<_i18.Cached>(), )); - gh.lazySingleton<_i26.AppSettingsHelper>(() => _i26.AppSettingsHelper( - gh<_i20.Cached>(), + gh.lazySingleton<_i23.AppSettingsHelper>(() => _i23.AppSettingsHelper( + gh<_i18.Cached>(), gh<_i4.Connectivity>(), )); - gh.factory<_i27.AuthBloc>(() => _i27.AuthBloc(gh<_i24.IAuthFacade>())); - gh.singleton<_i28.EmailPasswordBloc>(_i28.EmailPasswordBloc( - authenticationRepository: gh<_i24.IAuthFacade>())); - gh.factory<_i29.HomeViewBloc>( - () => _i29.HomeViewBloc(gh<_i26.AppSettingsHelper>())); - gh.factory<_i30.InternetAndTimeBloc>( - () => _i30.InternetAndTimeBloc(gh<_i26.AppSettingsHelper>())); + gh.factory<_i24.AuthBloc>(() => _i24.AuthBloc(gh<_i21.IAuthFacade>())); + gh.singleton<_i25.EmailPasswordBloc>(_i25.EmailPasswordBloc( + authenticationRepository: gh<_i21.IAuthFacade>())); + gh.factory<_i26.HomeViewBloc>( + () => _i26.HomeViewBloc(gh<_i23.AppSettingsHelper>())); + gh.factory<_i27.InternetAndTimeBloc>( + () => _i27.InternetAndTimeBloc(gh<_i23.AppSettingsHelper>())); return this; } } -class _$GoogleAuthenticationInjectableModule - extends _i31.GoogleAuthenticationInjectableModule {} - -class _$CoreInjectableModule extends _i32.CoreInjectableModule {} - class _$AuthenticationMockModuleInjection - extends _i33.AuthenticationMockModuleInjection {} + extends _i28.AuthenticationMockModuleInjection {} + +class _$FacebookAuthenticationInjectableModule + extends _i29.FacebookAuthenticationInjectableModule {} class _$FirebaseAuthInjectableModule - extends _i34.FirebaseAuthInjectableModule {} + extends _i30.FirebaseAuthInjectableModule {} -class _$FacebookAuthenticationInjectableModule - extends _i35.FacebookAuthenticationInjectableModule {} +class _$GoogleAuthenticationInjectableModule + extends _i31.GoogleAuthenticationInjectableModule {} + +class _$CoreInjectableModule extends _i32.CoreInjectableModule {} diff --git a/lib/router/app_route.dart b/lib/router/app_route.dart index 0437617..5bc2bb2 100644 --- a/lib/router/app_route.dart +++ b/lib/router/app_route.dart @@ -1,6 +1,7 @@ import 'package:auto_route/annotations.dart'; -import 'package:fpb/contact_us/contact_us_page.dart'; +// import 'package:fpb/contact_us/contact_us_page.dart'; import 'package:fpb/contact_us/view/contact_us_screen.dart'; +import 'package:fpb/contact_us/view/contact_us_success_screen.dart'; import 'package:fpb/email_confirmation/email_confirmation.dart'; import 'package:fpb/home/view/home_screen.dart'; import 'package:fpb/latest_activities/view/latest_activities_screen.dart'; diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 7a5a657..fd2774b 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,11 +11,12 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i13; -import 'package:flutter/material.dart' as _i14; +import 'package:auto_route/auto_route.dart' as _i14; +import 'package:flutter/material.dart' as _i15; -import '../contact_us/contact_us_page.dart' as _i11; -import '../core/domain/user.dart' as _i15; +import '../contact_us/view/contact_us_screen.dart' as _i11; +import '../contact_us/view/contact_us_success_screen.dart' as _i12; +import '../core/domain/user.dart' as _i16; import '../email_confirmation/email_confirmation.dart' as _i4; import '../home/view/home_screen.dart' as _i7; import '../latest_activities/view/latest_activities_screen.dart' as _i8; @@ -23,57 +24,57 @@ import '../onboarding/view/onboarding_screens.dart' as _i10; import '../onboarding/view/splash_screen.dart' as _i1; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i12; +import '../profile/view/profile_page.dart' as _i13; import '../qr_code_screen/view/qr_code_screen.dart' as _i9; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i13.RootStackRouter { - AppRoute([_i14.GlobalKey<_i14.NavigatorState>? navigatorKey]) +class AppRoute extends _i14.RootStackRouter { + AppRoute([_i15.GlobalKey<_i15.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: _i7.HomeScreen( key: args.key, @@ -82,13 +83,13 @@ class AppRoute extends _i13.RootStackRouter { ); }, LatestActivitiesPage.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i8.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i9.QrCodeScreen(), ); @@ -96,7 +97,7 @@ class AppRoute extends _i13.RootStackRouter { OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: _i10.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, @@ -105,79 +106,79 @@ class AppRoute extends _i13.RootStackRouter { ); }, ContactUsRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, child: const _i11.ContactUsScreen(), ); }, ContactUsSuccessRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, - child: const _i11.ContactUsSuccessScreen(), + child: const _i12.ContactUsSuccessScreen(), ); }, ProfileRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i14.MaterialPageX( routeData: routeData, - child: const _i12.ProfileScreen(), + child: const _i13.ProfileScreen(), ); }, }; @override - List<_i13.RouteConfig> get routes => [ - _i13.RouteConfig( + List<_i14.RouteConfig> get routes => [ + _i14.RouteConfig( SplashRoute.name, path: '/', ), - _i13.RouteConfig( + _i14.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i13.RouteConfig( + _i14.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, ) ], ), - _i13.RouteConfig( + _i14.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i13.RouteConfig( + _i14.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( ContactUsRoute.name, path: '/contact-us-screen', ), - _i13.RouteConfig( + _i14.RouteConfig( ContactUsSuccessRoute.name, path: '/contact-us-success-screen', ), @@ -186,7 +187,7 @@ class AppRoute extends _i13.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i13.PageRouteInfo { +class SplashRoute extends _i14.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -198,7 +199,7 @@ class SplashRoute extends _i13.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i13.PageRouteInfo { +class SignInRoute extends _i14.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -210,7 +211,7 @@ class SignInRoute extends _i13.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i13.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i14.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -222,7 +223,7 @@ class PhoneNumberConfirmationRoute extends _i13.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i13.PageRouteInfo { +class EmailConfirmationRoute extends _i14.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -234,7 +235,7 @@ class EmailConfirmationRoute extends _i13.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i13.PageRouteInfo { +class SignUpRoute extends _i14.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -246,7 +247,7 @@ class SignUpRoute extends _i13.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i13.PageRouteInfo { +class SaveMoneyRoute extends _i14.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -258,11 +259,11 @@ class SaveMoneyRoute extends _i13.PageRouteInfo { /// generated route for /// [_i7.HomeScreen] -class HomeRouter extends _i13.PageRouteInfo { +class HomeRouter extends _i14.PageRouteInfo { HomeRouter({ - _i14.Key? key, - required _i15.User user, - List<_i13.PageRouteInfo>? children, + _i15.Key? key, + required _i16.User user, + List<_i14.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -282,9 +283,9 @@ class HomeRouterArgs { required this.user, }); - final _i14.Key? key; + final _i15.Key? key; - final _i15.User user; + final _i16.User user; @override String toString() { @@ -294,7 +295,7 @@ class HomeRouterArgs { /// generated route for /// [_i8.LatestActivitiesPage] -class LatestActivitiesPage extends _i13.PageRouteInfo { +class LatestActivitiesPage extends _i14.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -306,7 +307,7 @@ class LatestActivitiesPage extends _i13.PageRouteInfo { /// generated route for /// [_i9.QrCodeScreen] -class QrCodeRoute extends _i13.PageRouteInfo { +class QrCodeRoute extends _i14.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -318,10 +319,10 @@ class QrCodeRoute extends _i13.PageRouteInfo { /// generated route for /// [_i10.OnboardingScreen] -class OnboardingRoute extends _i13.PageRouteInfo { +class OnboardingRoute extends _i14.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i14.Key? key, + _i15.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -342,7 +343,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i14.Key? key; + final _i15.Key? key; @override String toString() { @@ -352,7 +353,7 @@ class OnboardingRouteArgs { /// generated route for /// [_i11.ContactUsScreen] -class ContactUsRoute extends _i13.PageRouteInfo { +class ContactUsRoute extends _i14.PageRouteInfo { const ContactUsRoute() : super( ContactUsRoute.name, @@ -363,8 +364,8 @@ class ContactUsRoute extends _i13.PageRouteInfo { } /// generated route for -/// [_i11.ContactUsSuccessScreen] -class ContactUsSuccessRoute extends _i13.PageRouteInfo { +/// [_i12.ContactUsSuccessScreen] +class ContactUsSuccessRoute extends _i14.PageRouteInfo { const ContactUsSuccessRoute() : super( ContactUsSuccessRoute.name, @@ -375,8 +376,8 @@ class ContactUsSuccessRoute extends _i13.PageRouteInfo { } /// generated route for -/// [_i12.ProfileScreen] -class ProfileRoute extends _i13.PageRouteInfo { +/// [_i13.ProfileScreen] +class ProfileRoute extends _i14.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, From a24531ccd5a9580e0ed3bff6b4ff5dd78d691766 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 17 Mar 2023 06:28:04 +0100 Subject: [PATCH 11/28] fix: resolove PR review change, remove scroll on display contact and changed search input to FbpTextFormfield --- .../widget/selected_user_item.dart | 5 +- lib/home/view/user_search_screen.dart | 54 ++--- lib/home/view/widgets/search_input.dart | 29 ++- lib/home/view/widgets/user_search_list.dart | 185 ++++++++++++------ 4 files changed, 182 insertions(+), 91 deletions(-) diff --git a/lib/core/presentation/widget/selected_user_item.dart b/lib/core/presentation/widget/selected_user_item.dart index dbbbc66..31e28b4 100644 --- a/lib/core/presentation/widget/selected_user_item.dart +++ b/lib/core/presentation/widget/selected_user_item.dart @@ -44,10 +44,7 @@ class SelectedUserItem extends StatelessWidget { ), Text( '${username}', - style: TextStyle( - fontSize: box.maxHeight * 0.02, - fontWeight: FontWeight.w400, - ), + style: Theme.of(context).textTheme.titleSmall, ), GestureDetector( onTap: onTap, diff --git a/lib/home/view/user_search_screen.dart b/lib/home/view/user_search_screen.dart index e6fa3f5..0d18eaf 100644 --- a/lib/home/view/user_search_screen.dart +++ b/lib/home/view/user_search_screen.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart'; import 'package:fpb/core/domain/user.dart'; @@ -17,30 +18,39 @@ class UserSearchScreen extends StatelessWidget { context.read()..add(AuthEvent.logoutRequest()); } return LayoutBuilder(builder: (context, box) { - return SafeArea( - child: GestureDetector( - onTap: () { - // close keyboard - FocusScope.of(context).unfocus(); - }, - child: Scaffold( - resizeToAvoidBottomInset: false, - appBar: CustomAppBar( - titleChildWidget: CircleAvatar( - backgroundImage: NetworkImage('${user.photo}'), - ), - actionChildWidget: [ - RowHeaderIcons(), - ], - ), - body: SingleChildScrollView( - child: Column( - children: [ - UserSearchList( - box: box, - ), + return AnnotatedRegion( + value: SystemUiOverlayStyle( + statusBarColor: Theme.of(context).colorScheme.surface, + statusBarIconBrightness: Brightness.dark, // dark icon for iOS + statusBarBrightness: Brightness.dark, // set dark icon for android + ), + child: SafeArea( + child: GestureDetector( + onTap: () { + // close keyboard + FocusScope.of(context).unfocus(); + }, + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Theme.of(context).colorScheme.surface, + appBar: CustomAppBar( + backgroundColor: Theme.of(context).colorScheme.surface, + titleChildWidget: CircleAvatar( + backgroundImage: NetworkImage('${user.photo}'), + ), + actionChildWidget: [ + RowHeaderIcons(), ], ), + body: SingleChildScrollView( + child: Column( + children: [ + UserSearchList( + box: box, + ), + ], + ), + ), ), ), ), diff --git a/lib/home/view/widgets/search_input.dart b/lib/home/view/widgets/search_input.dart index 9ed7a64..7dc5ec1 100644 --- a/lib/home/view/widgets/search_input.dart +++ b/lib/home/view/widgets/search_input.dart @@ -32,14 +32,33 @@ class SearchInputWidget extends StatelessWidget { VerticalSpacingWidget(box: box), Container( width: box.maxWidth, - child: CustomSearchInput( + child: FpbTextFormField( + onChanged: (value) { + // setState(() {}); + }, + // textController: nameController, + label: '', + showLabelText: false, + hint: 'Name, email, identifier', box: box, - keyboardType: null, - labelText: 'Name, email, identifier', - onChanged: (search) async { - print(search); + validator: (val) { + // if (val!.isEmpty) { + // return 'Field is required'; + // } else if (val.isValidName) { + // return null; + // } else { + // return l10n.contactUsNameErrorText; + // } }, ), + // child: CustomSearchInput( + // box: box, + // keyboardType: null, + // labelText: 'Name, email, identifier', + // onChanged: (search) async { + // print(search); + // }, + // ), ), ], ), diff --git a/lib/home/view/widgets/user_search_list.dart b/lib/home/view/widgets/user_search_list.dart index 9d0a160..bcb422f 100644 --- a/lib/home/view/widgets/user_search_list.dart +++ b/lib/home/view/widgets/user_search_list.dart @@ -50,6 +50,76 @@ class _UserSearchListState extends State { email: 'mary@smith.com', phoneNumber: '15778783', ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), + User( + id: '3', + isNewUser: false, + photo: + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + providerId: '123456789', + name: 'Amanda', + email: 'mary@smith.com', + phoneNumber: '15778783', + ), ]; // recently sent list @@ -122,39 +192,37 @@ class _UserSearchListState extends State { // display user with recent sent transactions Container( width: widget.box.maxWidth, - height: widget.box.maxHeight * 0.2, + // height: widget.box.maxHeight * 0.2, padding: EdgeInsets.symmetric( horizontal: widget.box.maxWidth * 0.01, ), - child: SingleChildScrollView( - child: Column( - children: users - .map( - (e) => UserCheckSelect( - box: widget.box, - fullName: e.name, - username: e.name, - userPhoto: '${e.photo}', - checked: userSelected.contains(e) ? true : false, - onChanged: (bool? value) { - // check if item adde - if yes then remove - if (userSelected.contains(e)) { - userSelected.remove(e); - setState(() { - selectUser = value!; - }); - } else { - // add use to userSelected - userSelected.add(e); - setState(() { - selectUser = value!; - }); - } - }, - ), - ) - .toList(), - ), + child: Column( + children: users + .map( + (e) => UserCheckSelect( + box: widget.box, + fullName: e.name, + username: e.name, + userPhoto: '${e.photo}', + checked: userSelected.contains(e) ? true : false, + onChanged: (bool? value) { + // check if item adde - if yes then remove + if (userSelected.contains(e)) { + userSelected.remove(e); + setState(() { + selectUser = value!; + }); + } else { + // add use to userSelected + userSelected.add(e); + setState(() { + selectUser = value!; + }); + } + }, + ), + ) + .toList(), ), ), @@ -175,39 +243,36 @@ class _UserSearchListState extends State { // display user with recent sent transactions Container( width: widget.box.maxWidth, - height: widget.box.maxHeight * 0.5, padding: EdgeInsets.symmetric( horizontal: widget.box.maxWidth * 0.01, ), - child: SingleChildScrollView( - child: Column( - children: users - .map( - (e) => UserCheckSelect( - box: widget.box, - fullName: e.name, - username: e.name, - userPhoto: '${e.photo}', - checked: userSelected.contains(e) ? true : false, - onChanged: (bool? value) { - // check if item adde - if yes then remove - if (userSelected.contains(e)) { - userSelected.remove(e); - setState(() { - selectUser = value!; - }); - } else { - // add use to userSelected - userSelected.add(e); - setState(() { - selectUser = value!; - }); - } - }, - ), - ) - .toList(), - ), + child: Column( + children: users + .map( + (e) => UserCheckSelect( + box: widget.box, + fullName: e.name, + username: e.name, + userPhoto: '${e.photo}', + checked: userSelected.contains(e) ? true : false, + onChanged: (bool? value) { + // check if item adde - if yes then remove + if (userSelected.contains(e)) { + userSelected.remove(e); + setState(() { + selectUser = value!; + }); + } else { + // add use to userSelected + userSelected.add(e); + setState(() { + selectUser = value!; + }); + } + }, + ), + ) + .toList(), ), ), ], From 5cc3298affd732bfc564cf4665ae4de24fee7570 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 17 Mar 2023 06:43:14 +0100 Subject: [PATCH 12/28] delete: removed custom_search_input since its not need --- .../widget/custom_search_input.dart | 114 ------------------ lib/home/view/widgets/search_input.dart | 25 +--- 2 files changed, 2 insertions(+), 137 deletions(-) delete mode 100644 lib/core/presentation/widget/custom_search_input.dart diff --git a/lib/core/presentation/widget/custom_search_input.dart b/lib/core/presentation/widget/custom_search_input.dart deleted file mode 100644 index e384a82..0000000 --- a/lib/core/presentation/widget/custom_search_input.dart +++ /dev/null @@ -1,114 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class CustomSearchInput extends StatelessWidget { - const CustomSearchInput({ - @required this.labelText, - this.errorText, - this.showSuffix, - this.showSuffixIcon = false, - this.assetSvgPath, - @required this.keyboardType, - this.controller, - this.onChanged, - this.suffixIconWidget, - this.onTap, - this.onTapSuffix, - this.readOnly = false, - this.obscureText = false, - this.showlabel = true, - this.inputFormatters, - required this.box, - }); - - final BoxConstraints box; - final String? labelText; - final String? errorText; - final bool? showSuffix; - final bool? showSuffixIcon; - final String? assetSvgPath; - final TextInputType? keyboardType; - final TextEditingController? controller; - final void Function(String)? onChanged; - final Widget? suffixIconWidget; - final void Function()? onTap; - final void Function()? onTapSuffix; - final bool? readOnly; - final bool? obscureText; - final bool? showlabel; - final List? inputFormatters; - - @override - Widget build(BuildContext context) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - height: box.maxHeight * 0.1, - child: Center( - child: TextField( - controller: controller, - keyboardType: keyboardType, - obscureText: obscureText!, - onChanged: onChanged, - onTap: onTap, - readOnly: readOnly!, - cursorColor: Colors.black, - inputFormatters: inputFormatters, - decoration: InputDecoration( - hintText: labelText, - fillColor: Colors.transparent, - filled: true, - errorText: errorText, - enabledBorder: OutlineInputBorder( - // width: 0.0 produces a thin "hairline" border - borderSide: BorderSide( - color: Colors.grey, - width: 0.0, - ), - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - ), - focusedBorder: const OutlineInputBorder( - // width: 0.0 produces a thin "hairline" border - borderSide: BorderSide( - color: Colors.grey, - width: 1.0, - ), - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - ), - border: OutlineInputBorder(), - hintStyle: TextStyle( - fontSize: box.maxWidth * 0.04, - ), - suffixIcon: showSuffix == true - ? InkWell( - onTap: onTapSuffix, - child: Container( - height: 5, - margin: EdgeInsets.only( - right: 15.0, - ), - child: Image.asset( - assetSvgPath!, - height: box.maxHeight * 0.002, - width: 2, - ), - ), - ) - : showSuffixIcon == true - ? suffixIconWidget - : null, - ), - ), - ), - ), - ], - ), - ); - } -} diff --git a/lib/home/view/widgets/search_input.dart b/lib/home/view/widgets/search_input.dart index 7dc5ec1..4a2aa73 100644 --- a/lib/home/view/widgets/search_input.dart +++ b/lib/home/view/widgets/search_input.dart @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:fpb/core/application/search_user_bloc/search_user_bloc.dart'; import 'package:fpb/core/application/search_user_bloc/search_user_state.dart'; import 'package:fpb/core/domain/user.dart'; -import 'package:fpb/core/presentation/widget/custom_search_input.dart'; import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; import 'package:fpb/core/presentation/widget/fpb_text_form_field.dart'; @@ -33,32 +32,12 @@ class SearchInputWidget extends StatelessWidget { Container( width: box.maxWidth, child: FpbTextFormField( - onChanged: (value) { - // setState(() {}); - }, - // textController: nameController, + onChanged: (value) {}, label: '', showLabelText: false, - hint: 'Name, email, identifier', + hint: 'Name, email, identifier, number', box: box, - validator: (val) { - // if (val!.isEmpty) { - // return 'Field is required'; - // } else if (val.isValidName) { - // return null; - // } else { - // return l10n.contactUsNameErrorText; - // } - }, ), - // child: CustomSearchInput( - // box: box, - // keyboardType: null, - // labelText: 'Name, email, identifier', - // onChanged: (search) async { - // print(search); - // }, - // ), ), ], ), From 0f38544d5572725ca10bff7fae87893164e11bff Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 17 Mar 2023 08:27:35 +0100 Subject: [PATCH 13/28] feat: change select checkbox to custom svg assets --- assets/fpb-assets/active_checkbox.svg | 3 ++ assets/fpb-assets/uncheck_tick.svg | 4 +++ lib/assets/fpb_svg.dart | 3 ++ lib/home/view/widgets/user_check_select.dart | 27 ++++++++++++---- lib/home/view/widgets/user_search_list.dart | 34 +++++++------------- 5 files changed, 43 insertions(+), 28 deletions(-) create mode 100644 assets/fpb-assets/active_checkbox.svg create mode 100644 assets/fpb-assets/uncheck_tick.svg diff --git a/assets/fpb-assets/active_checkbox.svg b/assets/fpb-assets/active_checkbox.svg new file mode 100644 index 0000000..3963a5b --- /dev/null +++ b/assets/fpb-assets/active_checkbox.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/fpb-assets/uncheck_tick.svg b/assets/fpb-assets/uncheck_tick.svg new file mode 100644 index 0000000..e9bf411 --- /dev/null +++ b/assets/fpb-assets/uncheck_tick.svg @@ -0,0 +1,4 @@ + + + + diff --git a/lib/assets/fpb_svg.dart b/lib/assets/fpb_svg.dart index d4238a2..ddb3221 100644 --- a/lib/assets/fpb_svg.dart +++ b/lib/assets/fpb_svg.dart @@ -15,4 +15,7 @@ class SvgNames { static String facebook = '${path}facebook.svg'; static String twitter = '${path}twitter.svg'; static String error = '${path}Cross.svg'; + static String activeCheckbox = '${path}active_checkbox.svg'; + static String inactiveCheckbox = '${path}uncheck_tick.svg'; + } diff --git a/lib/home/view/widgets/user_check_select.dart b/lib/home/view/widgets/user_check_select.dart index f22280a..ad2fc0d 100644 --- a/lib/home/view/widgets/user_check_select.dart +++ b/lib/home/view/widgets/user_check_select.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:fpb/assets/fpb_svg.dart'; class UserCheckSelect extends StatelessWidget { const UserCheckSelect({ @@ -16,7 +18,7 @@ class UserCheckSelect extends StatelessWidget { final String fullName; final String userPhoto; final bool checked; - final void Function(bool?) onChanged; + final void Function() onChanged; @override Widget build(BuildContext context) { @@ -69,12 +71,25 @@ class UserCheckSelect extends StatelessWidget { ), // checkbox select button - SizedBox( - child: Checkbox( - value: checked, - onChanged: onChanged, + if (checked) ...[ + GestureDetector( + onTap: onChanged, + child: SizedBox( + child: SvgPicture.asset( + SvgNames.activeCheckbox, + ), + ), ), - ), + ] else ...[ + GestureDetector( + onTap: onChanged, + child: SizedBox( + child: SvgPicture.asset( + SvgNames.inactiveCheckbox, + ), + ), + ), + ] ], ), ); diff --git a/lib/home/view/widgets/user_search_list.dart b/lib/home/view/widgets/user_search_list.dart index bcb422f..adfe59e 100644 --- a/lib/home/view/widgets/user_search_list.dart +++ b/lib/home/view/widgets/user_search_list.dart @@ -51,17 +51,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', - isNewUser: false, - photo: - 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', - providerId: '123456789', - name: 'Amanda', - email: 'mary@smith.com', - phoneNumber: '15778783', - ), - User( - id: '3', + id: '4', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -71,7 +61,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', + id: '5', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -81,7 +71,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', + id: '6', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -91,7 +81,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', + id: '7', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -101,7 +91,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', + id: '8', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -111,7 +101,7 @@ class _UserSearchListState extends State { phoneNumber: '15778783', ), User( - id: '3', + id: '9', isNewUser: false, photo: 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', @@ -205,18 +195,18 @@ class _UserSearchListState extends State { username: e.name, userPhoto: '${e.photo}', checked: userSelected.contains(e) ? true : false, - onChanged: (bool? value) { + onChanged: () { // check if item adde - if yes then remove if (userSelected.contains(e)) { userSelected.remove(e); setState(() { - selectUser = value!; + selectUser = false; }); } else { // add use to userSelected userSelected.add(e); setState(() { - selectUser = value!; + selectUser = true; }); } }, @@ -255,18 +245,18 @@ class _UserSearchListState extends State { username: e.name, userPhoto: '${e.photo}', checked: userSelected.contains(e) ? true : false, - onChanged: (bool? value) { + onChanged: () { // check if item adde - if yes then remove if (userSelected.contains(e)) { userSelected.remove(e); setState(() { - selectUser = value!; + selectUser = false; }); } else { // add use to userSelected userSelected.add(e); setState(() { - selectUser = value!; + selectUser = true; }); } }, From a498e38bc0a4ab8f1d7cd73579b58e6099e515b7 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 20 Mar 2023 13:51:57 +0100 Subject: [PATCH 14/28] feat: implement custom dialog modals --- .../widget/custom_dialog_widget.dart | 62 +++++++++++++++++++ .../view/widget/link_accounts.dart | 35 ++++++++++- 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 lib/core/presentation/widget/custom_dialog_widget.dart diff --git a/lib/core/presentation/widget/custom_dialog_widget.dart b/lib/core/presentation/widget/custom_dialog_widget.dart new file mode 100644 index 0000000..3bec4fc --- /dev/null +++ b/lib/core/presentation/widget/custom_dialog_widget.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; + +Future> showCustomDialog( + BuildContext context, + double height, + double width, + Widget? widget, +) async { + return showGeneralDialog( + context: context, + barrierDismissible: true, + barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel, + barrierColor: Color.fromARGB(199, 3, 3, 3), + transitionDuration: const Duration( + milliseconds: 200, + ), + pageBuilder: ( + BuildContext buildContext, + Animation animation, + Animation secondaryAnimation, + ) { + return CustomDialogWidget( + height: height, + width: width, + childWidget: widget!, + ); + }, + ); +} + +class CustomDialogWidget extends StatelessWidget { + const CustomDialogWidget({ + super.key, + required this.height, + required this.width, + required this.childWidget, + }); + + final double height; + final double width; + final Widget childWidget; + + @override + Widget build(BuildContext context) { + return Center( + child: Material( + color: Colors.transparent, + child: Container( + width: width, + height: height, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.circular( + 10.0, + ), + ), + child: childWidget, + ), + ), + ); + } +} diff --git a/lib/payment_methods/view/widget/link_accounts.dart b/lib/payment_methods/view/widget/link_accounts.dart index a44af59..5217365 100644 --- a/lib/payment_methods/view/widget/link_accounts.dart +++ b/lib/payment_methods/view/widget/link_accounts.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:fpb/assets/fpb_svg.dart'; import 'package:fpb/core/presentation/widget/custom_btn_outline.dart'; +import 'package:fpb/core/presentation/widget/custom_dialog_widget.dart'; import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; class LinkAccounts extends StatelessWidget { @@ -56,7 +57,9 @@ class LinkAccounts extends StatelessWidget { ), onPressed: () => print('action'), ), - VerticalSpacingWidget(box: box), + VerticalSpacingWidget( + box: box, + ), // btn link account - paypal CustomBtnOutline( style: style, @@ -70,7 +73,35 @@ class LinkAccounts extends StatelessWidget { ), onPressed: () => print('action'), ), - VerticalSpacingWidget(box: box), + // link stripe + VerticalSpacingWidget( + box: box, + ), + // btn link account - google pay + CustomBtnOutline( + style: style, + box: box, + backgroundColor: theme.colorScheme.background, + borderColor: theme.colorScheme.secondary, + text: 'Link Stripe account', + textColor: theme.colorScheme.secondary, + onPressed: () => { + showCustomDialog( + context, + box.maxHeight * 0.4, + box.maxWidth * 0.95, + Column( + children: [ + Text('Hello'), + Text('Hello man'), + ], + ), + ) + }, + ), + VerticalSpacingWidget( + box: box, + ), // btn link account - bank CustomBtnOutline( style: style, From 476d0cb9ca546eb2dbf565c07e24dd5293f48982 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 20 Mar 2023 18:03:53 +0100 Subject: [PATCH 15/28] feat: stripe payment dialog box with payments forms --- .../widget/custom_dialog_widget.dart | 29 ++--- .../widget/fpb_text_form_field.dart | 47 ++++---- .../view/widget/link_accounts.dart | 11 +- .../view/widget/stripe_payments_form.dart | 101 ++++++++++++++++++ 4 files changed, 148 insertions(+), 40 deletions(-) create mode 100644 lib/payment_methods/view/widget/stripe_payments_form.dart diff --git a/lib/core/presentation/widget/custom_dialog_widget.dart b/lib/core/presentation/widget/custom_dialog_widget.dart index 3bec4fc..6865335 100644 --- a/lib/core/presentation/widget/custom_dialog_widget.dart +++ b/lib/core/presentation/widget/custom_dialog_widget.dart @@ -2,8 +2,9 @@ import 'package:flutter/material.dart'; Future> showCustomDialog( BuildContext context, - double height, - double width, + BoxConstraints box, + double? height, + double? width, Widget? widget, ) async { return showGeneralDialog( @@ -20,8 +21,8 @@ Future> showCustomDialog( Animation secondaryAnimation, ) { return CustomDialogWidget( - height: height, - width: width, + height: height ?? box.maxHeight * 0.5, + width: width ?? box.maxWidth * 0.4, childWidget: widget!, ); }, @@ -45,16 +46,20 @@ class CustomDialogWidget extends StatelessWidget { return Center( child: Material( color: Colors.transparent, - child: Container( - width: width, - height: height, - decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, - borderRadius: BorderRadius.circular( - 10.0, + child: GestureDetector( + onTap: () => + FocusScope.of(context).unfocus(), // close keyboard on screen tap + child: Container( + width: width, + height: height, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.circular( + 10.0, + ), ), + child: childWidget, ), - child: childWidget, ), ), ); diff --git a/lib/core/presentation/widget/fpb_text_form_field.dart b/lib/core/presentation/widget/fpb_text_form_field.dart index cfd0983..8990c4d 100644 --- a/lib/core/presentation/widget/fpb_text_form_field.dart +++ b/lib/core/presentation/widget/fpb_text_form_field.dart @@ -3,19 +3,21 @@ import 'package:fpb/assets/fpb_icons/fpb_icons_icons.dart'; import 'package:fpb/core/presentation/extension/extensions.dart'; class FpbTextFormField extends StatefulWidget { - const FpbTextFormField( - {super.key, - required this.label, - required this.hint, - this.textController, - this.node, - this.isEmail = false, - this.isPassword = false, - this.onChanged, - this.errorText, - this.showLabelText = true, - required this.box, - this.validator}); + const FpbTextFormField({ + super.key, + required this.label, + required this.hint, + this.textController, + this.node, + this.isEmail = false, + this.isPassword = false, + this.onChanged, + this.errorText, + this.showLabelText = true, + required this.box, + this.validator, + this.keyboardType = TextInputType.text, + }); final String label; final String hint; @@ -28,6 +30,7 @@ class FpbTextFormField extends StatefulWidget { final BoxConstraints box; final bool showLabelText; final String? Function(String?)? validator; + final TextInputType? keyboardType; @override State createState() => _FpbTextFormFieldState(); @@ -59,14 +62,15 @@ class _FpbTextFormFieldState extends State { : SizedBox(), TextFormField( autovalidateMode: AutovalidateMode.always, - validator: (value) => widget.validator?.call(value) != null ? "" : null, + validator: (value) => + widget.validator?.call(value) != null ? "" : null, controller: widget.textController, focusNode: widget.node, keyboardType: widget.isEmail ? TextInputType.emailAddress : widget.isPassword ? TextInputType.visiblePassword - : TextInputType.text, + : widget.keyboardType, onChanged: widget.onChanged, obscureText: hidePassword ?? false, style: textTheme @@ -117,14 +121,13 @@ class _FpbTextFormFieldState extends State { ), ) .card( - //height: widget.box.maxHeight * 0.14, - padding: EdgeInsets.symmetric( - vertical: widget.box.maxHeight * 0.009, - )).validatorWidget( + //height: widget.box.maxHeight * 0.14, + padding: EdgeInsets.symmetric( + vertical: widget.box.maxHeight * 0.009, + )) + .validatorWidget( //widget.textController != null && widget.textController!.text.isEmpty ? null : - widget.validator?.call( - widget.textController?.text)), - + widget.validator?.call(widget.textController?.text)), ], ); } diff --git a/lib/payment_methods/view/widget/link_accounts.dart b/lib/payment_methods/view/widget/link_accounts.dart index 5217365..ca6b388 100644 --- a/lib/payment_methods/view/widget/link_accounts.dart +++ b/lib/payment_methods/view/widget/link_accounts.dart @@ -4,6 +4,7 @@ import 'package:fpb/assets/fpb_svg.dart'; import 'package:fpb/core/presentation/widget/custom_btn_outline.dart'; import 'package:fpb/core/presentation/widget/custom_dialog_widget.dart'; import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; +import 'package:fpb/payment_methods/view/widget/stripe_payments_form.dart'; class LinkAccounts extends StatelessWidget { const LinkAccounts({ @@ -88,13 +89,11 @@ class LinkAccounts extends StatelessWidget { onPressed: () => { showCustomDialog( context, - box.maxHeight * 0.4, + box, + box.maxHeight * 0.45, box.maxWidth * 0.95, - Column( - children: [ - Text('Hello'), - Text('Hello man'), - ], + StripePaymentsForm( + box: box, ), ) }, diff --git a/lib/payment_methods/view/widget/stripe_payments_form.dart b/lib/payment_methods/view/widget/stripe_payments_form.dart new file mode 100644 index 0000000..8380fcb --- /dev/null +++ b/lib/payment_methods/view/widget/stripe_payments_form.dart @@ -0,0 +1,101 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/core/presentation/widget/fpb_button.dart'; +import 'package:fpb/core/presentation/widget/fpb_text_form_field.dart'; +import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; + +class StripePaymentsForm extends StatefulWidget { + const StripePaymentsForm({ + super.key, + required this.box, + }); + + final BoxConstraints box; + + @override + State createState() => _StripePaymentsFormState(); +} + +class _StripePaymentsFormState extends State { + bool isDefaultPayments = false; + + @override + Widget build(BuildContext context) { + return Container( + width: widget.box.maxWidth, + padding: EdgeInsets.symmetric( + horizontal: widget.box.maxWidth * 0.02, + vertical: widget.box.maxHeight * 0.02, + ), + child: Column( + children: [ + // card number input field + FpbTextFormField( + onChanged: (value) {}, + label: 'Card Number', + hint: '**** **** **** 1234', + box: widget.box, + keyboardType: TextInputType.number, + ), + // ExpiryDate and CVV + SizedBox( + width: widget.box.maxWidth, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + children: [ + SizedBox( + width: widget.box.maxWidth * 0.55, + child: FpbTextFormField( + onChanged: (value) {}, + label: 'Expiry Date', + hint: 'DD.MM.YY', + box: widget.box, + ), + ), + SizedBox( + width: widget.box.maxWidth * 0.3, + child: FpbTextFormField( + onChanged: (value) {}, + label: 'CVV', + hint: '000', + box: widget.box, + keyboardType: TextInputType.number, + ), + ), + ], + ), + ), + // set payments as default + Container( + width: widget.box.maxWidth, + child: Wrap( + alignment: WrapAlignment.start, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + Checkbox( + value: isDefaultPayments, + activeColor: Theme.of(context).colorScheme.primary, + onChanged: (bool? value) { + print(value); + setState(() { + isDefaultPayments = value!; + }); + }, + ), + Text( + 'Set as your default payment method', + style: Theme.of(context).textTheme.bodyMedium, + ), + ], + ), + ), + VerticalSpacingWidget(box: widget.box), + // btn submit - Add payments + FpbButton( + label: 'Add', + onTap: () => print('Add Stripe'), + ), + ], + ), + ); + } +} From 918152aac924948895b9bfe53f3be9cb1fb7c99e Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 20 Mar 2023 18:50:45 +0100 Subject: [PATCH 16/28] feat: linked account status widget --- .../view/widget/account_linked.dart | 68 +++++++++++++++++-- .../view/widget/link_accounts.dart | 42 ++++++++---- .../view/widget/payment_cards_widget.dart | 1 + 3 files changed, 91 insertions(+), 20 deletions(-) diff --git a/lib/payment_methods/view/widget/account_linked.dart b/lib/payment_methods/view/widget/account_linked.dart index 9c2c870..a465420 100644 --- a/lib/payment_methods/view/widget/account_linked.dart +++ b/lib/payment_methods/view/widget/account_linked.dart @@ -1,18 +1,76 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:fpb/assets/fpb_svg.dart'; +import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; class AccountLinked extends StatelessWidget { - const AccountLinked({super.key}); + const AccountLinked({ + super.key, + required this.box, + required this.assetName, + required this.onTap, + }); + + final BoxConstraints box; + final String assetName; + final dynamic Function()? onTap; @override Widget build(BuildContext context) { return Container( + width: box.maxWidth, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - 'Paypal', + SvgPicture.asset( + SvgNames.paypal, ), - Text( - 'Widget for linked account', + VerticalSpacingWidget(box: box), + Container( + width: box.maxWidth, + child: Wrap( + alignment: WrapAlignment.spaceBetween, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + Container( + child: Wrap( + spacing: 5.0, + children: [ + CircleAvatar( + backgroundImage: NetworkImage( + 'https://media.istockphoto.com/id/1381221247/photo/beautiful-afro-girl-with-curly-hairstyle.jpg?b=1&s=170667a&w=0&k=20&c=0x91osZOkL8EfhTEEGNa2EeCGN2gdMTNULOsUFW_0i4=', + ), + radius: box.maxHeight * 0.026, + ), + SizedBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '@john_merry', + style: Theme.of(context).textTheme.titleSmall, + ), + SizedBox( + height: box.maxHeight * 0.009, + ), + Text( + 'John Merry', + style: Theme.of(context).textTheme.labelMedium, + ), + ], + ), + ), + ], + ), + ), + GestureDetector( + onTap: onTap, + child: Icon( + Icons.delete, + ), + ), + ], + ), ), ], ), diff --git a/lib/payment_methods/view/widget/link_accounts.dart b/lib/payment_methods/view/widget/link_accounts.dart index ca6b388..ece2a2d 100644 --- a/lib/payment_methods/view/widget/link_accounts.dart +++ b/lib/payment_methods/view/widget/link_accounts.dart @@ -4,6 +4,7 @@ import 'package:fpb/assets/fpb_svg.dart'; import 'package:fpb/core/presentation/widget/custom_btn_outline.dart'; import 'package:fpb/core/presentation/widget/custom_dialog_widget.dart'; import 'package:fpb/core/presentation/widget/vertical_spacing_widget.dart'; +import 'package:fpb/payment_methods/view/widget/account_linked.dart'; import 'package:fpb/payment_methods/view/widget/stripe_payments_form.dart'; class LinkAccounts extends StatelessWidget { @@ -31,6 +32,16 @@ class LinkAccounts extends StatelessWidget { ), ), VerticalSpacingWidget(box: box), + // Paypay linked + AccountLinked( + assetName: SvgNames.paypal, + box: box, + onTap: () => print('delete'), + ), + VerticalSpacingWidget( + box: box, + height: box.maxHeight * 0.02, + ), // btn link account - apple pay CustomBtnOutline( style: style, @@ -58,22 +69,22 @@ class LinkAccounts extends StatelessWidget { ), onPressed: () => print('action'), ), - VerticalSpacingWidget( - box: box, - ), + // VerticalSpacingWidget( + // box: box, + // ), // btn link account - paypal - CustomBtnOutline( - style: style, - box: box, - backgroundColor: theme.colorScheme.background, - borderColor: theme.colorScheme.secondary, - text: 'Link Paypal ', - textColor: theme.colorScheme.secondary, - leading: SvgPicture.asset( - SvgNames.paypal, - ), - onPressed: () => print('action'), - ), + // CustomBtnOutline( + // style: style, + // box: box, + // backgroundColor: theme.colorScheme.background, + // borderColor: theme.colorScheme.secondary, + // text: 'Link Paypal', + // textColor: theme.colorScheme.secondary, + // leading: SvgPicture.asset( + // SvgNames.paypal, + // ), + // onPressed: () => print('action'), + // ), // link stripe VerticalSpacingWidget( box: box, @@ -111,6 +122,7 @@ class LinkAccounts extends StatelessWidget { textColor: theme.colorScheme.secondary, onPressed: () => print('action'), ), + VerticalSpacingWidget(box: box), ], ), ); diff --git a/lib/payment_methods/view/widget/payment_cards_widget.dart b/lib/payment_methods/view/widget/payment_cards_widget.dart index 02214fc..6fbf14d 100644 --- a/lib/payment_methods/view/widget/payment_cards_widget.dart +++ b/lib/payment_methods/view/widget/payment_cards_widget.dart @@ -71,6 +71,7 @@ class _PaymentCardsWidgetState extends State { width: widget.box.maxWidth * 0.5, height: widget.box.maxHeight * 0.055, label: 'Add Card', + backgroundColor: Theme.of(context).colorScheme.secondary, onTap: () => print('Add Card'), spaceAround: true, leading: Icon( From 99dbc72bc136d514c8ce61a2006e698634547e94 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Mon, 20 Mar 2023 19:06:55 +0100 Subject: [PATCH 17/28] fix: resolve merge conflicts --- assets/fpb-assets/time_circle.svg | 4 + assets/fpb-assets/wallet.svg | 5 + lib/assets/fpb_svg.dart | 2 + lib/router/app_route.dart | 6 +- lib/router/app_route.gr.dart | 144 +++++---- lib/savings/view/savings_page.dart | 292 ++++-------------- lib/savings/view/widgets/account_card.dart | 68 ++++ .../view/widgets/account_card_title.dart | 33 ++ .../view/widgets/account_type_tile.dart | 50 +++ .../view/widgets/new_savings_account_btn.dart | 44 +++ .../view/widgets/savings_screen_title.dart | 32 ++ 11 files changed, 384 insertions(+), 296 deletions(-) create mode 100644 assets/fpb-assets/time_circle.svg create mode 100644 assets/fpb-assets/wallet.svg create mode 100644 lib/savings/view/widgets/account_card.dart create mode 100644 lib/savings/view/widgets/account_card_title.dart create mode 100644 lib/savings/view/widgets/account_type_tile.dart create mode 100644 lib/savings/view/widgets/new_savings_account_btn.dart create mode 100644 lib/savings/view/widgets/savings_screen_title.dart diff --git a/assets/fpb-assets/time_circle.svg b/assets/fpb-assets/time_circle.svg new file mode 100644 index 0000000..87f8b57 --- /dev/null +++ b/assets/fpb-assets/time_circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/fpb-assets/wallet.svg b/assets/fpb-assets/wallet.svg new file mode 100644 index 0000000..c682d37 --- /dev/null +++ b/assets/fpb-assets/wallet.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/assets/fpb_svg.dart b/lib/assets/fpb_svg.dart index 57957d6..1a7369d 100644 --- a/lib/assets/fpb_svg.dart +++ b/lib/assets/fpb_svg.dart @@ -23,4 +23,6 @@ class SvgNames { static String activeCheckbox = '${path}active_checkbox.svg'; static String inactiveCheckbox = '${path}uncheck_tick.svg'; + static String timeCircle = '${path}time_circle.svg'; + static String wallet = '${path}wallet.svg'; } diff --git a/lib/router/app_route.dart b/lib/router/app_route.dart index fc71b1a..1225d28 100644 --- a/lib/router/app_route.dart +++ b/lib/router/app_route.dart @@ -1,5 +1,4 @@ import 'package:auto_route/annotations.dart'; -// import 'package:fpb/contact_us/contact_us_page.dart'; import 'package:fpb/contact_us/view/contact_us_screen.dart'; import 'package:fpb/contact_us/view/contact_us_success_screen.dart'; import 'package:fpb/email_confirmation/email_confirmation.dart'; @@ -12,6 +11,7 @@ import 'package:fpb/phone_number_confirmation/view/phone_number_confirmation.dar import 'package:fpb/profile/view/profile_page.dart'; import 'package:fpb/qr_code_screen/view/qr_code_screen.dart'; import 'package:fpb/savings/save_money_with_bucket/save_money_with_bucket.dart'; +import 'package:fpb/savings/view/savings_page.dart'; import 'package:fpb/sign_in/view/sign_in_page.dart'; import 'package:fpb/sign_up/view/signup_page.dart'; @@ -29,6 +29,10 @@ import 'package:fpb/sign_up/view/signup_page.dart'; name: 'HomeRouter', page: HomeScreen, children: [ + AutoRoute( + path: 'savings', + page: SavingsPage, + ), AutoRoute( path: 'profile', page: ProfileScreen, diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 71ba5ed..0868fac 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,12 +11,12 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i15; -import 'package:flutter/material.dart' as _i16; +import 'package:auto_route/auto_route.dart' as _i16; +import 'package:flutter/material.dart' as _i17; import '../contact_us/view/contact_us_screen.dart' as _i12; import '../contact_us/view/contact_us_success_screen.dart' as _i13; -import '../core/domain/user.dart' as _i17; +import '../core/domain/user.dart' as _i18; import '../email_confirmation/email_confirmation.dart' as _i4; import '../home/view/home_screen.dart' as _i8; import '../latest_activities/view/latest_activities_screen.dart' as _i9; @@ -25,63 +25,64 @@ import '../onboarding/view/splash_screen.dart' as _i1; import '../payment_methods/payment_method_screen.dart' as _i7; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i14; +import '../profile/view/profile_page.dart' as _i15; import '../qr_code_screen/view/qr_code_screen.dart' as _i10; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; +import '../savings/view/savings_page.dart' as _i14; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i15.RootStackRouter { - AppRoute([_i16.GlobalKey<_i16.NavigatorState>? navigatorKey]) +class AppRoute extends _i16.RootStackRouter { + AppRoute([_i17.GlobalKey<_i17.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); }, PaymentMethodRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i7.PaymentMethodScreen(), ); }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: _i8.HomeScreen( key: args.key, @@ -90,13 +91,13 @@ class AppRoute extends _i15.RootStackRouter { ); }, LatestActivitiesPage.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i9.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i10.QrCodeScreen(), ); @@ -104,7 +105,7 @@ class AppRoute extends _i15.RootStackRouter { OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: _i11.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, @@ -113,83 +114,94 @@ class AppRoute extends _i15.RootStackRouter { ); }, ContactUsRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i12.ContactUsScreen(), ); }, ContactUsSuccessRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i13.ContactUsSuccessScreen(), ); }, + SavingsPage.name: (routeData) { + return _i16.MaterialPageX( + routeData: routeData, + child: const _i14.SavingsPage(), + ); + }, ProfileRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, - child: const _i14.ProfileScreen(), + child: const _i15.ProfileScreen(), ); }, }; @override - List<_i15.RouteConfig> get routes => [ - _i15.RouteConfig( + List<_i16.RouteConfig> get routes => [ + _i16.RouteConfig( SplashRoute.name, path: '/', ), - _i15.RouteConfig( + _i16.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( PaymentMethodRoute.name, path: '/payment-method-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i15.RouteConfig( + _i16.RouteConfig( + SavingsPage.name, + path: 'savings', + parent: HomeRouter.name, + ), + _i16.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, - ) + ), ], ), - _i15.RouteConfig( + _i16.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i15.RouteConfig( + _i16.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( ContactUsRoute.name, path: '/contact-us-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( ContactUsSuccessRoute.name, path: '/contact-us-success-screen', ), @@ -198,7 +210,7 @@ class AppRoute extends _i15.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i15.PageRouteInfo { +class SplashRoute extends _i16.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -210,7 +222,7 @@ class SplashRoute extends _i15.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i15.PageRouteInfo { +class SignInRoute extends _i16.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -222,7 +234,7 @@ class SignInRoute extends _i15.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i16.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -234,7 +246,7 @@ class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i15.PageRouteInfo { +class EmailConfirmationRoute extends _i16.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -246,7 +258,7 @@ class EmailConfirmationRoute extends _i15.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i15.PageRouteInfo { +class SignUpRoute extends _i16.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -258,7 +270,7 @@ class SignUpRoute extends _i15.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i15.PageRouteInfo { +class SaveMoneyRoute extends _i16.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -270,7 +282,7 @@ class SaveMoneyRoute extends _i15.PageRouteInfo { /// generated route for /// [_i7.PaymentMethodScreen] -class PaymentMethodRoute extends _i15.PageRouteInfo { +class PaymentMethodRoute extends _i16.PageRouteInfo { const PaymentMethodRoute() : super( PaymentMethodRoute.name, @@ -282,11 +294,11 @@ class PaymentMethodRoute extends _i15.PageRouteInfo { /// generated route for /// [_i8.HomeScreen] -class HomeRouter extends _i15.PageRouteInfo { +class HomeRouter extends _i16.PageRouteInfo { HomeRouter({ - _i16.Key? key, - required _i17.User user, - List<_i15.PageRouteInfo>? children, + _i17.Key? key, + required _i18.User user, + List<_i16.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -306,9 +318,9 @@ class HomeRouterArgs { required this.user, }); - final _i16.Key? key; + final _i17.Key? key; - final _i17.User user; + final _i18.User user; @override String toString() { @@ -318,7 +330,7 @@ class HomeRouterArgs { /// generated route for /// [_i9.LatestActivitiesPage] -class LatestActivitiesPage extends _i15.PageRouteInfo { +class LatestActivitiesPage extends _i16.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -330,7 +342,7 @@ class LatestActivitiesPage extends _i15.PageRouteInfo { /// generated route for /// [_i10.QrCodeScreen] -class QrCodeRoute extends _i15.PageRouteInfo { +class QrCodeRoute extends _i16.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -342,10 +354,10 @@ class QrCodeRoute extends _i15.PageRouteInfo { /// generated route for /// [_i11.OnboardingScreen] -class OnboardingRoute extends _i15.PageRouteInfo { +class OnboardingRoute extends _i16.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i16.Key? key, + _i17.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -366,7 +378,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i16.Key? key; + final _i17.Key? key; @override String toString() { @@ -376,7 +388,7 @@ class OnboardingRouteArgs { /// generated route for /// [_i12.ContactUsScreen] -class ContactUsRoute extends _i15.PageRouteInfo { +class ContactUsRoute extends _i16.PageRouteInfo { const ContactUsRoute() : super( ContactUsRoute.name, @@ -388,7 +400,7 @@ class ContactUsRoute extends _i15.PageRouteInfo { /// generated route for /// [_i13.ContactUsSuccessScreen] -class ContactUsSuccessRoute extends _i15.PageRouteInfo { +class ContactUsSuccessRoute extends _i16.PageRouteInfo { const ContactUsSuccessRoute() : super( ContactUsSuccessRoute.name, @@ -399,8 +411,20 @@ class ContactUsSuccessRoute extends _i15.PageRouteInfo { } /// generated route for -/// [_i14.ProfileScreen] -class ProfileRoute extends _i15.PageRouteInfo { +/// [_i14.SavingsPage] +class SavingsPage extends _i16.PageRouteInfo { + const SavingsPage() + : super( + SavingsPage.name, + path: 'savings', + ); + + static const String name = 'SavingsPage'; +} + +/// generated route for +/// [_i15.ProfileScreen] +class ProfileRoute extends _i16.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, diff --git a/lib/savings/view/savings_page.dart b/lib/savings/view/savings_page.dart index 3e75a4e..f033fa5 100644 --- a/lib/savings/view/savings_page.dart +++ b/lib/savings/view/savings_page.dart @@ -1,9 +1,11 @@ // ignore_for_file: omit_local_variable_types, prefer_final_locals -import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; +import 'package:fpb/assets/fpb_svg.dart'; import 'package:fpb/l10n/l10n.dart'; -import 'package:fpb/router/app_route.gr.dart'; +import 'package:fpb/savings/view/widgets/account_card.dart'; +import 'package:fpb/savings/view/widgets/account_type_tile.dart'; +import 'package:fpb/savings/view/widgets/savings_screen_title.dart'; class SavingsPage extends StatefulWidget { const SavingsPage({super.key}); @@ -14,255 +16,75 @@ class SavingsPage extends StatefulWidget { } class _SavingsPageState extends State { - int pageIndex = 1; - - void onChanged(int index) { - setState(() { - pageIndex = index; - }); - } - + @override Widget build(BuildContext context) { final l10n = context.l10n; - final theme = Theme.of(context); - final colors = theme.colorScheme; return LayoutBuilder( builder: (context, box) { - return Padding( - padding: EdgeInsets.only( - left: box.maxHeight * 0.025, - right: box.maxHeight * 0.025, - top: box.maxHeight * 0.1, - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + return Scaffold( + body: Padding( + padding: EdgeInsets.only( + left: box.maxHeight * 0.025, + right: box.maxHeight * 0.025, + top: box.maxHeight * 0.1, + ), + child: SingleChildScrollView( + child: Column( children: [ - Text( - l10n.savingsTitle, - style: theme.textTheme.titleLarge, + SavingsScreenTitle( + box: box, ), - ElevatedButton( - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(colors.secondary), - ), - onPressed: () { - context.router.push(ProfileRoute()); - }, - child: Row( - children: [ - const Icon( - Icons.add, - color: Colors.white, - size: 12, - ), - SizedBox( - width: box.maxWidth * 0.03, - ), - Text( - l10n.savingsNewSavingsAccountLabel, - style: - Theme.of(context).textTheme.titleSmall?.copyWith( - // color: AppColors.onSurfaceW, - ), - ), - ], - ), + SizedBox( + height: box.maxHeight * 0.05, ), - ], - ), - SizedBox( - height: box.maxHeight * 0.025, - ), - Container( - height: box.maxHeight * 0.3, - width: box.maxWidth * .85, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Padding( - padding: EdgeInsets.only( - left: box.maxHeight * 0.025, - right: box.maxHeight * 0.025, - top: box.maxHeight * 0.025, - bottom: box.maxHeight * 0.015, - ), - child: Column( - children: [ - Row( - children: [ - Image.asset( - 'assets/fpb-assets/orange_clock_icon.png', - ), - SizedBox( - width: box.maxHeight * 0.02, - ), - Text( - l10n.savingsTimeBlockedAccounts, - style: Theme.of(context).textTheme.titleMedium, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - Column( - // ignore: avoid_redundant_argument_values - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - 'My Tesla New Model X', - style: Theme.of(context).textTheme.titleMedium, - ), - Text( - r'$ 1,280.45', - style: Theme.of(context).textTheme.titleSmall, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - Text( + AccountsCard( + accountTitle: l10n.savingsTimeBlockedAccounts, + svgnames: SvgNames.timeCircle, + box: box, + l10n: l10n, + accountTypeTiles: [ + AccountTypeTile( + tileText: 'My Tesla Model X', + amount: '\$ 1,280.45', + tileSubText: l10n.savingsMyTeslaModelXBlockedTimelineText, - style: Theme.of(context).textTheme.labelMedium, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - const Divider(), - SizedBox( - height: box.maxHeight * 0.01, - ), - Column( - // ignore: avoid_redundant_argument_values - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - l10n.savingsNewDroneText, - style: Theme.of(context).textTheme.titleMedium, - ), - Text( - r'$ 79.45', - style: Theme.of(context).textTheme.titleSmall, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - Text( - l10n.savingsNewDroneBlockedTimelineText, - style: Theme.of(context).textTheme.labelMedium, - ), - ], + box: box, ), + AccountTypeTile( + tileText: l10n.savingsNewDroneText, + amount: '\$ 79.45', + box: box, + tileSubText: l10n.savingsNewDroneBlockedTimelineText, + ) ], ), - ), - ), - SizedBox( - height: box.maxHeight * 0.025, - ), - Container( - height: box.maxHeight * 0.3, - width: box.maxWidth * .85, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Padding( - padding: EdgeInsets.only( - left: box.maxHeight * 0.025, - right: box.maxHeight * 0.025, - top: box.maxHeight * 0.025, + SizedBox( + height: box.maxHeight * 0.025, ), - child: Column( - children: [ - Row( - children: [ - Image.asset('assets/fpb-assets/Fill 2.png'), - SizedBox( - width: box.maxHeight * 0.02, - ), - Text( - l10n.savingsStandardAccountsLabel, - style: Theme.of(context).textTheme.titleMedium, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - Column( - // ignore: avoid_redundant_argument_values - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - l10n.savingsMortgageText, - style: Theme.of(context).textTheme.titleMedium, - ), - Text( - r'$ 22,500.50', - style: Theme.of(context).textTheme.titleSmall, - ), - ], - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.025, - ), - const Divider(), - SizedBox( - height: box.maxHeight * 0.01, - ), - Column( - // ignore: avoid_redundant_argument_values - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - l10n.savingsNewDroneText, - style: Theme.of(context).textTheme.titleMedium, - ), - Text( - r'$ 79.45', - style: Theme.of(context).textTheme.titleSmall, - ), - ], - ), - SizedBox( - height: box.maxHeight * 0.01, - ), - ], + AccountsCard( + accountTitle: l10n.savingsStandardAccountsLabel, + svgnames: SvgNames.wallet, + box: box, + l10n: l10n, + accountTypeTiles: [ + AccountTypeTile( + tileText: l10n.savingsMortgageText, + amount: '\$ 22,500.50', + tileSubText: '', + box: box, ), + AccountTypeTile( + tileText: l10n.savingsNewDroneText, + amount: '\$ 79.45', + box: box, + tileSubText: '', + ) ], - ), - ), + ) + ], ), - ], + ), ), ); }, diff --git a/lib/savings/view/widgets/account_card.dart b/lib/savings/view/widgets/account_card.dart new file mode 100644 index 0000000..5932f37 --- /dev/null +++ b/lib/savings/view/widgets/account_card.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/l10n/l10n.dart'; +import 'package:fpb/savings/view/widgets/account_card_title.dart'; +import 'package:fpb/savings/view/widgets/account_type_tile.dart'; + +class AccountsCard extends StatelessWidget { + const AccountsCard( + {super.key, + required this.box, + required this.l10n, + required this.accountTypeTiles, + required this.svgnames, + required this.accountTitle}); + + final BoxConstraints box; + final AppLocalizations l10n; + final String svgnames; + final String accountTitle; + final List accountTypeTiles; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final colors = theme.colorScheme; + + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Padding( + padding: EdgeInsets.only( + left: box.maxHeight * 0.025, + right: box.maxHeight * 0.025, + top: box.maxHeight * 0.025, + bottom: box.maxHeight * 0.015, + ), + child: Column( + children: [ + AccountsCardTitle( + svgname: svgnames, + box: box, + containerTitle: accountTitle, + ), + SizedBox( + height: box.maxHeight * .03, + ), + for (int i = 0; i < accountTypeTiles.length; i++) + () { + final AccountTypeTile tile = accountTypeTiles[i]; + + return Column( + children: [ + tile, + if (i != accountTypeTiles.length - 1) + Divider( + color: colors.onBackground, + thickness: .5, + ), + ], + ); + }() + ], + ), + ), + ); + } +} diff --git a/lib/savings/view/widgets/account_card_title.dart b/lib/savings/view/widgets/account_card_title.dart new file mode 100644 index 0000000..e4743e2 --- /dev/null +++ b/lib/savings/view/widgets/account_card_title.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class AccountsCardTitle extends StatelessWidget { + const AccountsCardTitle( + {super.key, + required this.box, + required this.containerTitle, + required this.svgname}); + + final BoxConstraints box; + final String containerTitle; + final String svgname; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + SvgPicture.asset(svgname), + SizedBox( + width: box.maxHeight * 0.05, + ), + Text( + containerTitle, + style: Theme.of(context) + .textTheme + .titleMedium + ?.copyWith(fontWeight: FontWeight.w400), + ), + ], + ); + } +} diff --git a/lib/savings/view/widgets/account_type_tile.dart b/lib/savings/view/widgets/account_type_tile.dart new file mode 100644 index 0000000..d1bcd7e --- /dev/null +++ b/lib/savings/view/widgets/account_type_tile.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; + +class AccountTypeTile extends StatelessWidget { + const AccountTypeTile({ + super.key, + required this.tileText, + required this.amount, + required this.box, + this.tileSubText, + }); + + final String tileText; + + final String amount; + final BoxConstraints box; + final String? tileSubText; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final style = theme.textTheme; + return Column( + // ignore: avoid_redundant_argument_values + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + tileText, + style: style.titleMedium, + ), + Text( + amount, + style: style.titleMedium?.copyWith(fontWeight: FontWeight.w600), + ), + ], + ), + SizedBox( + height: box.maxHeight * 0.005, + ), + Text( + tileSubText!, + style: style.titleSmall, + ), + ], + ); + } +} diff --git a/lib/savings/view/widgets/new_savings_account_btn.dart b/lib/savings/view/widgets/new_savings_account_btn.dart new file mode 100644 index 0000000..60a7a47 --- /dev/null +++ b/lib/savings/view/widgets/new_savings_account_btn.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/l10n/l10n.dart'; + +class NewSavingsAccountBtn extends StatelessWidget { + const NewSavingsAccountBtn({ + super.key, + required this.colors, + required this.l10n, + required this.box, + }); + + final ColorScheme colors; + final AppLocalizations l10n; + final BoxConstraints box; + + @override + Widget build(BuildContext context) { + return ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(colors.secondary), + ), + onPressed: () {}, + child: Row( + children: [ + Icon( + Icons.add, + color: colors.background, + size: 18, + // weight: 6, + ), + SizedBox( + width: box.maxWidth * 0.03, + ), + Text( + l10n.savingsNewSavingsAccountLabel, + style: Theme.of(context).textTheme.titleSmall?.copyWith( + color: colors.background, + ), + ), + ], + ), + ); + } +} diff --git a/lib/savings/view/widgets/savings_screen_title.dart b/lib/savings/view/widgets/savings_screen_title.dart new file mode 100644 index 0000000..4ed2fde --- /dev/null +++ b/lib/savings/view/widgets/savings_screen_title.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:fpb/l10n/l10n.dart'; +import 'package:fpb/savings/view/widgets/new_savings_account_btn.dart'; + +class SavingsScreenTitle extends StatelessWidget { + const SavingsScreenTitle({super.key, required this.box}); + + final BoxConstraints box; + + @override + Widget build(BuildContext context) { + final l10n = context.l10n; + final theme = Theme.of(context); + final colors = theme.colorScheme; + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + l10n.savingsTitle, + style: theme.textTheme.titleLarge?.copyWith( + fontSize: 32, + ), + ), + NewSavingsAccountBtn( + colors: colors, + l10n: l10n, + box: box, + ), + ], + ); + } +} From 0d07806a2fcb91a061b798869f85e0b267997a0a Mon Sep 17 00:00:00 2001 From: Jeffrey Kengne Date: Tue, 21 Mar 2023 11:55:28 +0100 Subject: [PATCH 18/28] added CI/CD Pipeline for android release to GIthub and firebase --- .github/workflows/android-release.yml | 103 ++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/android-release.yml diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml new file mode 100644 index 0000000..6dfbe3a --- /dev/null +++ b/.github/workflows/android-release.yml @@ -0,0 +1,103 @@ +name: Android App Release for development branch + +on: + push: + branches: + - development + +jobs: + version: + name: Create version number # using GitVersion + runs-on: ubuntu-latest #macos-latest + steps: + - uses: actions/checkout@v3 + - name: Fetch all history for all tags and branches + run: git fetch --prune --depth=10000 + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + - name: Use GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.15 + - name: Create android-version.txt with nuGetVersion + run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > android-version.txt + - name: Upload android-version.txt + uses: actions/upload-artifact@v3 + with: + name: gitversion + path: android-version.txt + build: + name: Build Appbundle and Apks + needs: [ version ] + runs-on: ubuntu-latest #macos-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '12.x' + distribution: 'zulu' + cache: 'gradle' + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.3.7' + cache: true + channel: 'stable' + - run: flutter upgrade + - run: flutter --version + - run: flutter pub get + - run: flutter test + - run: flutter build apk --release --flavor development --target lib/main_development.dart + - run: flutter build appbundle + - name: upload app builds files + uses: actions/upload-artifact@v3 + with: + name: flutter-app-builds + path: | + build/app/outputs/flutter-apk/app-development-release.apk + build/app/outputs/bundle/release/app-development-release.aab + github-deploy: + name: Deploy Build to Github + needs: [ build, version ] + runs-on: ubuntu-latest #macos-latest + steps: + - name: Get android-version.txt + uses: actions/download-artifact@v3 + with: + name: gitversion + - name: Read version + id: version + uses: juliangruber/read-file-action@v1 + with: + path: android-version.txt + - name: Get app builds + uses: actions/download-artifact@v3 + with: + name: flutter-app-builds + - name: Echo android-version.txt + run: echo "${{ steps.version.outputs.content }}" + - name: Display structure of downloaded files + run: ls -R + - name: Create a Release in GitHub + uses: ncipollo/release-action@v1 + with: + artifacts: "flutter-apk/app-development-release.apk,bundle/release/app-development-release.aab" + token: ${{ secrets.GH_TOKEN }} + tag: ${{ steps.version.outputs.content }} + commit: ${{ github.sha }} + firebase-deploy: + name: Deploy Build to Firebase App Distribution + needs: [ build ] + runs-on: ubuntu-latest #macos-latest + steps: + - name: Get app builds + uses: actions/download-artifact@v3 + with: + name: flutter-app-builds + - name: upload artifact to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 + with: + appId: ${{secrets.FIREBASE_ANDROID_APP_ID}} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: testers + file: flutter-apk/app-development-release.apk \ No newline at end of file From c3b7f46de9d7ad75ec3e922d5c3423e49cac26ba Mon Sep 17 00:00:00 2001 From: Jeffrey Kengne Date: Tue, 21 Mar 2023 14:39:16 +0100 Subject: [PATCH 19/28] changed fluttter build from release to profile in the CI/CD pipeline --- .github/workflows/android-release.yml | 9 +- android/build.gradle | 2 +- lib/injection.config.dart | 112 +++++++++----------- lib/router/app_route.gr.dart | 145 +++++++++++++++----------- 4 files changed, 138 insertions(+), 130 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 6dfbe3a..210cadd 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -47,15 +47,14 @@ jobs: - run: flutter --version - run: flutter pub get - run: flutter test - - run: flutter build apk --release --flavor development --target lib/main_development.dart + - run: flutter build apk --profile --flavor development --target lib/main_development.dart - run: flutter build appbundle - name: upload app builds files uses: actions/upload-artifact@v3 with: name: flutter-app-builds path: | - build/app/outputs/flutter-apk/app-development-release.apk - build/app/outputs/bundle/release/app-development-release.aab + build/app/outputs/flutter-apk/app-development-profile.apk github-deploy: name: Deploy Build to Github needs: [ build, version ] @@ -81,7 +80,7 @@ jobs: - name: Create a Release in GitHub uses: ncipollo/release-action@v1 with: - artifacts: "flutter-apk/app-development-release.apk,bundle/release/app-development-release.aab" + artifacts: "flutter-apk/app-development-profile.apk" token: ${{ secrets.GH_TOKEN }} tag: ${{ steps.version.outputs.content }} commit: ${{ github.sha }} @@ -100,4 +99,4 @@ jobs: appId: ${{secrets.FIREBASE_ANDROID_APP_ID}} serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} groups: testers - file: flutter-apk/app-development-release.apk \ No newline at end of file + file: flutter-apk/app-development-profile.apk \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 0a1af40..916d8cc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.6.10'//1.8.10 -> 1.8.10 because of release build failures repositories { google() mavenCentral() diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 702ab0c..41bc4d3 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -13,55 +13,49 @@ import 'package:firebase_auth/firebase_auth.dart' as _i7; import 'package:firebase_core/firebase_core.dart' as _i6; import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' - as _i19; + as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i33; + as _i30; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' - as _i21; + as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' as _i10; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i35; + as _i32; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' - as _i27; -import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' as _i24; +import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' + as _i21; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' - as _i25; + as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i34; + as _i31; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' - as _i23; + as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' - as _i14; + as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' - as _i31; + as _i28; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' - as _i15; + as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' - as _i28; + as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' - as _i30; -import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; -import 'package:fpb/core/settings/app_settings_helper.dart' as _i26; -import 'package:fpb/core/settings/cached.dart' as _i20; -import 'package:fpb/forgot_password_flow/application/bloc/forgot_password_bloc.dart' - as _i22; -import 'package:fpb/forgot_password_flow/domain/i_forgot_password_facade.dart' - as _i12; -import 'package:fpb/forgot_password_flow/infrastructure/forgot_password_repository.dart' - as _i13; + as _i27; +import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i29; +import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; +import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' - as _i29; + as _i26; import 'package:get_it/get_it.dart' as _i1; import 'package:google_sign_in/google_sign_in.dart' as _i9; import 'package:injectable/injectable.dart' as _i2; -import 'package:ntp/ntp.dart' as _i16; -import 'package:shared_preferences/shared_preferences.dart' as _i17; +import 'package:ntp/ntp.dart' as _i14; +import 'package:shared_preferences/shared_preferences.dart' as _i15; import 'package:user_repository/user_repository.dart' - as _i18; // ignore_for_file: unnecessary_lambdas + as _i16; // ignore_for_file: unnecessary_lambdas // ignore_for_file: lines_longer_than_80_chars extension GetItInjectableX on _i1.GetIt { @@ -104,66 +98,56 @@ extension GetItInjectableX on _i1.GetIt { gh<_i5.FacebookAuth>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i12.IForgotPasswordRepositoryFacade>( - () => _i13.ForgotPasswordRepository( - gh<_i7.FirebaseAuth>(), - gh(), - )); - gh.lazySingleton<_i14.IGoogleRepositoryFacade>( - () => _i15.GoogleAuthenticationRepository( + gh.lazySingleton<_i12.IGoogleRepositoryFacade>( + () => _i13.GoogleAuthenticationRepository( gh<_i9.GoogleSignIn>(), gh<_i7.FirebaseAuth>(), )); - gh.lazySingleton<_i16.NTP>(() => coreInjectableModule.ntp); - await gh.factoryAsync<_i17.SharedPreferences>( + gh.lazySingleton<_i14.NTP>(() => coreInjectableModule.ntp); + await gh.factoryAsync<_i15.SharedPreferences>( () => firebaseAuthInjectableModule.sharePreferences, preResolve: true, ); - gh.singleton<_i18.UserRepository>( + gh.singleton<_i16.UserRepository>( authenticationMockModuleInjection.userRepository); - gh.factory<_i19.AuthenticationBloc>(() => _i19.AuthenticationBloc( + gh.factory<_i17.AuthenticationBloc>(() => _i17.AuthenticationBloc( authenticationRepository: gh<_i3.AuthenticationRepository>(), - userRepository: gh<_i18.UserRepository>(), + userRepository: gh<_i16.UserRepository>(), )); - gh.singleton<_i20.Cached>(_i20.Cached(gh<_i17.SharedPreferences>())); - gh.factory<_i21.FacebookAuthBloc>(() => _i21.FacebookAuthBloc( + gh.singleton<_i18.Cached>(_i18.Cached(gh<_i15.SharedPreferences>())); + gh.factory<_i19.FacebookAuthBloc>(() => _i19.FacebookAuthBloc( authenticationRepository: gh<_i10.IFacebookRepositoryFacade>())); - gh.factory<_i22.ForgotPasswordBloc>(() => _i22.ForgotPasswordBloc( - gh<_i22.ForgotPasswordState>(), - forgotPasswordRepositoryFacade: - gh<_i12.IForgotPasswordRepositoryFacade>(), - )); - gh.factory<_i23.GoogleSignInBloc>(() => _i23.GoogleSignInBloc( - authenticationRepository: gh<_i14.IGoogleRepositoryFacade>())); - gh.lazySingleton<_i24.IAuthFacade>(() => _i25.FirebaseAuthFacade( + gh.factory<_i20.GoogleSignInBloc>(() => _i20.GoogleSignInBloc( + authenticationRepository: gh<_i12.IGoogleRepositoryFacade>())); + gh.lazySingleton<_i21.IAuthFacade>(() => _i22.FirebaseAuthFacade( gh<_i7.FirebaseAuth>(), - gh<_i20.Cached>(), + gh<_i18.Cached>(), )); - gh.lazySingleton<_i26.AppSettingsHelper>(() => _i26.AppSettingsHelper( - gh<_i20.Cached>(), + gh.lazySingleton<_i23.AppSettingsHelper>(() => _i23.AppSettingsHelper( + gh<_i18.Cached>(), gh<_i4.Connectivity>(), )); - gh.factory<_i27.AuthBloc>(() => _i27.AuthBloc(gh<_i24.IAuthFacade>())); - gh.singleton<_i28.EmailPasswordBloc>(_i28.EmailPasswordBloc( - authenticationRepository: gh<_i24.IAuthFacade>())); - gh.factory<_i29.HomeViewBloc>( - () => _i29.HomeViewBloc(gh<_i26.AppSettingsHelper>())); - gh.factory<_i30.InternetAndTimeBloc>( - () => _i30.InternetAndTimeBloc(gh<_i26.AppSettingsHelper>())); + gh.factory<_i24.AuthBloc>(() => _i24.AuthBloc(gh<_i21.IAuthFacade>())); + gh.singleton<_i25.EmailPasswordBloc>(_i25.EmailPasswordBloc( + authenticationRepository: gh<_i21.IAuthFacade>())); + gh.factory<_i26.HomeViewBloc>( + () => _i26.HomeViewBloc(gh<_i23.AppSettingsHelper>())); + gh.factory<_i27.InternetAndTimeBloc>( + () => _i27.InternetAndTimeBloc(gh<_i23.AppSettingsHelper>())); return this; } } class _$GoogleAuthenticationInjectableModule - extends _i31.GoogleAuthenticationInjectableModule {} + extends _i28.GoogleAuthenticationInjectableModule {} -class _$CoreInjectableModule extends _i32.CoreInjectableModule {} +class _$CoreInjectableModule extends _i29.CoreInjectableModule {} class _$AuthenticationMockModuleInjection - extends _i33.AuthenticationMockModuleInjection {} + extends _i30.AuthenticationMockModuleInjection {} class _$FirebaseAuthInjectableModule - extends _i34.FirebaseAuthInjectableModule {} + extends _i31.FirebaseAuthInjectableModule {} class _$FacebookAuthenticationInjectableModule - extends _i35.FacebookAuthenticationInjectableModule {} + extends _i32.FacebookAuthenticationInjectableModule {} diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 7a5a657..c50a83f 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,11 +11,12 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i13; -import 'package:flutter/material.dart' as _i14; +import 'package:auto_route/auto_route.dart' as _i15; +import 'package:flutter/material.dart' as _i16; -import '../contact_us/contact_us_page.dart' as _i11; -import '../core/domain/user.dart' as _i15; +import '../contact_us/view/contact_us_screen.dart' as _i11; +import '../contact_us/view/contact_us_success_screen.dart' as _i12; +import '../core/domain/user.dart' as _i17; import '../email_confirmation/email_confirmation.dart' as _i4; import '../home/view/home_screen.dart' as _i7; import '../latest_activities/view/latest_activities_screen.dart' as _i8; @@ -23,57 +24,58 @@ import '../onboarding/view/onboarding_screens.dart' as _i10; import '../onboarding/view/splash_screen.dart' as _i1; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i12; +import '../profile/view/profile_page.dart' as _i14; import '../qr_code_screen/view/qr_code_screen.dart' as _i9; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; +import '../savings/view/savings_page.dart' as _i13; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i13.RootStackRouter { - AppRoute([_i14.GlobalKey<_i14.NavigatorState>? navigatorKey]) +class AppRoute extends _i15.RootStackRouter { + AppRoute([_i16.GlobalKey<_i16.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: _i7.HomeScreen( key: args.key, @@ -82,13 +84,13 @@ class AppRoute extends _i13.RootStackRouter { ); }, LatestActivitiesPage.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i8.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i9.QrCodeScreen(), ); @@ -96,7 +98,7 @@ class AppRoute extends _i13.RootStackRouter { OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: _i10.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, @@ -105,79 +107,90 @@ class AppRoute extends _i13.RootStackRouter { ); }, ContactUsRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i11.ContactUsScreen(), ); }, ContactUsSuccessRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, - child: const _i11.ContactUsSuccessScreen(), + child: const _i12.ContactUsSuccessScreen(), + ); + }, + SavingsPage.name: (routeData) { + return _i15.MaterialPageX( + routeData: routeData, + child: const _i13.SavingsPage(), ); }, ProfileRoute.name: (routeData) { - return _i13.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, - child: const _i12.ProfileScreen(), + child: const _i14.ProfileScreen(), ); }, }; @override - List<_i13.RouteConfig> get routes => [ - _i13.RouteConfig( + List<_i15.RouteConfig> get routes => [ + _i15.RouteConfig( SplashRoute.name, path: '/', ), - _i13.RouteConfig( + _i15.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i13.RouteConfig( + _i15.RouteConfig( + SavingsPage.name, + path: 'savings', + parent: HomeRouter.name, + ), + _i15.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, - ) + ), ], ), - _i13.RouteConfig( + _i15.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i13.RouteConfig( + _i15.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( ContactUsRoute.name, path: '/contact-us-screen', ), - _i13.RouteConfig( + _i15.RouteConfig( ContactUsSuccessRoute.name, path: '/contact-us-success-screen', ), @@ -186,7 +199,7 @@ class AppRoute extends _i13.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i13.PageRouteInfo { +class SplashRoute extends _i15.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -198,7 +211,7 @@ class SplashRoute extends _i13.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i13.PageRouteInfo { +class SignInRoute extends _i15.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -210,7 +223,7 @@ class SignInRoute extends _i13.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i13.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -222,7 +235,7 @@ class PhoneNumberConfirmationRoute extends _i13.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i13.PageRouteInfo { +class EmailConfirmationRoute extends _i15.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -234,7 +247,7 @@ class EmailConfirmationRoute extends _i13.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i13.PageRouteInfo { +class SignUpRoute extends _i15.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -246,7 +259,7 @@ class SignUpRoute extends _i13.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i13.PageRouteInfo { +class SaveMoneyRoute extends _i15.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -258,11 +271,11 @@ class SaveMoneyRoute extends _i13.PageRouteInfo { /// generated route for /// [_i7.HomeScreen] -class HomeRouter extends _i13.PageRouteInfo { +class HomeRouter extends _i15.PageRouteInfo { HomeRouter({ - _i14.Key? key, - required _i15.User user, - List<_i13.PageRouteInfo>? children, + _i16.Key? key, + required _i17.User user, + List<_i15.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -282,9 +295,9 @@ class HomeRouterArgs { required this.user, }); - final _i14.Key? key; + final _i16.Key? key; - final _i15.User user; + final _i17.User user; @override String toString() { @@ -294,7 +307,7 @@ class HomeRouterArgs { /// generated route for /// [_i8.LatestActivitiesPage] -class LatestActivitiesPage extends _i13.PageRouteInfo { +class LatestActivitiesPage extends _i15.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -306,7 +319,7 @@ class LatestActivitiesPage extends _i13.PageRouteInfo { /// generated route for /// [_i9.QrCodeScreen] -class QrCodeRoute extends _i13.PageRouteInfo { +class QrCodeRoute extends _i15.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -318,10 +331,10 @@ class QrCodeRoute extends _i13.PageRouteInfo { /// generated route for /// [_i10.OnboardingScreen] -class OnboardingRoute extends _i13.PageRouteInfo { +class OnboardingRoute extends _i15.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i14.Key? key, + _i16.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -342,7 +355,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i14.Key? key; + final _i16.Key? key; @override String toString() { @@ -352,7 +365,7 @@ class OnboardingRouteArgs { /// generated route for /// [_i11.ContactUsScreen] -class ContactUsRoute extends _i13.PageRouteInfo { +class ContactUsRoute extends _i15.PageRouteInfo { const ContactUsRoute() : super( ContactUsRoute.name, @@ -363,8 +376,8 @@ class ContactUsRoute extends _i13.PageRouteInfo { } /// generated route for -/// [_i11.ContactUsSuccessScreen] -class ContactUsSuccessRoute extends _i13.PageRouteInfo { +/// [_i12.ContactUsSuccessScreen] +class ContactUsSuccessRoute extends _i15.PageRouteInfo { const ContactUsSuccessRoute() : super( ContactUsSuccessRoute.name, @@ -375,8 +388,20 @@ class ContactUsSuccessRoute extends _i13.PageRouteInfo { } /// generated route for -/// [_i12.ProfileScreen] -class ProfileRoute extends _i13.PageRouteInfo { +/// [_i13.SavingsPage] +class SavingsPage extends _i15.PageRouteInfo { + const SavingsPage() + : super( + SavingsPage.name, + path: 'savings', + ); + + static const String name = 'SavingsPage'; +} + +/// generated route for +/// [_i14.ProfileScreen] +class ProfileRoute extends _i15.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, From 0c76182712b6df2eff2fd860301ff59a546471a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Kengne Date: Tue, 21 Mar 2023 15:01:32 +0100 Subject: [PATCH 20/28] removed tests from the android-release pipeline to prevent it to fail for now --- .github/workflows/android-release.yml | 4 +- pubspec.lock | 226 +++++++++++++++++++------- 2 files changed, 171 insertions(+), 59 deletions(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 210cadd..44ed198 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -46,9 +46,9 @@ jobs: - run: flutter upgrade - run: flutter --version - run: flutter pub get - - run: flutter test + # - run: flutter test - run: flutter build apk --profile --flavor development --target lib/main_development.dart - - run: flutter build appbundle + # - run: flutter build appbundle - name: upload app builds files uses: actions/upload-artifact@v3 with: diff --git a/pubspec.lock b/pubspec.lock index 5f4fd57..270dd13 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "64fcb0dbca4386356386c085142fa6e79c00a3326ceaa778a2d25f5d9ba61441" + sha256: "330d7fcbb72624f5b6d374af8b059b0ef4ba96ba5b8987f874964a1287eb617d" url: "https://pub.dev" source: hosted - version: "1.0.16" + version: "1.0.18" analyzer: dependency: transitive description: @@ -180,26 +180,26 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: "65f148d9f5b4f389320abb45847120cf5e46094c1a8cbc64934ffc1e29688596" + sha256: "0ad93f01816ab7e59560bffeece2d19cec872fedfea04a7ad5be418cad25d574" url: "https://pub.dev" source: hosted - version: "4.4.3" + version: "4.4.5" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: "43ccae09f7e0c82752e69c251c6dc5efcdff4ddcfc09564175a28657bbd74188" + sha256: "6255cf3ad845d44c6c69a7db51139c8d90691e435dd175578f6365f10c023fcc" url: "https://pub.dev" source: hosted - version: "5.11.3" + version: "5.11.5" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: e054c007217e28e07179bbae0564c2a4f6338a60bddb0c139e4834e953f4b95c + sha256: "3bc08abdeb21a59e80491aee827895aaa3c6da602bad9ab68d83e1ab13c951b1" url: "https://pub.dev" source: hosted - version: "3.3.3" + version: "3.3.5" code_builder: dependency: transitive description: @@ -248,6 +248,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.6.3" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" + url: "https://pub.dev" + source: hosted + version: "0.3.3+4" crypto: dependency: transitive description: @@ -348,34 +356,34 @@ packages: dependency: "direct main" description: name: firebase_auth - sha256: "9907d80446466e638dad31c195150b305dffd145dc57610fcd12c72289432143" + sha256: "94c229e296a5b9ee5c8cda918e0b320e3a0cc4f6a349cd410c427da347f2a244" url: "https://pub.dev" source: hosted - version: "4.2.9" + version: "4.3.0" firebase_auth_platform_interface: dependency: "direct dev" description: name: firebase_auth_platform_interface - sha256: c645fec50b0391aa878288f58fa4fe9762c271380c457aedf5c7c9b718604f68 + sha256: "1217d8aa313b49d58b489aa8879544563abc8793d9612ff20d8df193f202aedc" url: "https://pub.dev" source: hosted - version: "6.11.11" + version: "6.12.0" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "2dcf2a36852b9091741b4a4047a02e1f2c43a62c6cacec7df573a793a6543e6d" + sha256: bf7f1a87995a58b0f07dc617806dabd7ff25c64be7fa47b41ab1bb9a485b0062 url: "https://pub.dev" source: hosted - version: "5.2.8" + version: "5.2.10" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: fe30ac230f12f8836bb97e6e09197340d3c584526825b1746ea362a82e1e43f7 + sha256: "75f747cafd7cbd6c00b908e3a7aa59fc31593d46ba8165d9ee8a79e69464a394" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.8.0" firebase_core_platform_interface: dependency: "direct main" description: @@ -388,10 +396,10 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "291fbcace608aca6c860652e1358ef89752be8cc3ef227f8bbcd1e62775b833a" + sha256: "0c1cf1f1022d2245ac117443bb95207952ca770281524d2908e323bc063fb8ff" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" fixnum: dependency: transitive description: @@ -510,10 +518,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "97c5b291b4fd34ae4f55d6a4c05841d4d0ed94952e033c5a6529e1b47b4d2a29" + sha256: "12006889e2987c549c4c1ec1a5ba4ec4b24d34d2469ee5f9476c926dcecff266" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.4" flutter_test: dependency: "direct dev" description: flutter @@ -592,18 +600,18 @@ packages: dependency: transitive description: name: google_sign_in_android - sha256: f27bd56527c567594167bd0a46f7ceb93122ed064d2eee612413d6af0bb2e2e5 + sha256: "6a740e8498920ecf5fc2849ae0e4412536d700230bc3169493a1d031fdfe1cca" url: "https://pub.dev" source: hosted - version: "6.1.7" + version: "6.1.8" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - sha256: "2575ef0d06dbe6923cedf39766da8305d407bb891d9f4a59502c642719776c5c" + sha256: "2e1df687b17f7fddcaf9a0c7f994d0d19b5d41e8ce1d943013befd0a0ae67403" url: "https://pub.dev" source: hosted - version: "5.6.0" + version: "5.6.1" google_sign_in_platform_interface: dependency: transitive description: @@ -728,18 +736,18 @@ packages: dependency: transitive description: name: local_auth_android - sha256: "6e97e997530f7bfcc696cc0ed84a019209719dd6e854675da81803d02f10d8fc" + sha256: "2ccfadbb6fbc63e6674ad58a350b06188829e62669d67a0c752c4e43cb88272a" url: "https://pub.dev" source: hosted - version: "1.0.20" + version: "1.0.21" local_auth_ios: dependency: transitive description: name: local_auth_ios - sha256: b4b7a02eec2bd8ffea78026658264e7a720c841cca7732dfa27e36af2f727dd8 + sha256: "604078f6492fe7730fc5bb8e4f2cfe2bc287a9b499ea0ff30a29925fc1873728" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" local_auth_platform_interface: dependency: transitive description: @@ -752,10 +760,10 @@ packages: dependency: transitive description: name: local_auth_windows - sha256: "69c4a6b1201e7b5467e7180c7dd84cf96c308982680cc1778984552bea84b0bc" + sha256: bfe0deede77fb36faa62799977074f35ac096d7cafce0c29a44a173d2a2a4b94 url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.7" logging: dependency: "direct main" description: @@ -861,37 +869,37 @@ packages: source: hosted version: "1.0.1" path_provider: - dependency: transitive + dependency: "direct main" description: name: path_provider - sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9" + sha256: c7edf82217d4b2952b2129a61d3ad60f1075b9299e629e149a8d2e39c2e6aad4 url: "https://pub.dev" source: hosted - version: "2.0.13" + version: "2.0.14" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "7623b7d4be0f0f7d9a8b5ee6879fc13e4522d4c875ab86801dee4af32b54b83e" + sha256: "019f18c9c10ae370b08dce1f3e3b73bc9f58e7f087bb5e921f06529438ac0ae7" url: "https://pub.dev" source: hosted - version: "2.0.23" + version: "2.0.24" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: eec003594f19fe2456ea965ae36b3fc967bc5005f508890aafe31fa75e41d972 + sha256: "12eee51abdf4d34c590f043f45073adbb45514a108bd9db4491547a2fd891059" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "525ad5e07622d19447ad740b1ed5070031f7a5437f44355ae915ff56e986429a" + sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" url: "https://pub.dev" source: hosted - version: "2.1.9" + version: "2.1.10" path_provider_platform_interface: dependency: transitive description: @@ -904,10 +912,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: "642ddf65fde5404f83267e8459ddb4556316d3ee6d511ed193357e25caa3632d" + sha256: f53720498d5a543f9607db4b0e997c4b5438884de25b0f73098cc2671a51b130 url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" petitparser: dependency: transitive description: @@ -972,6 +980,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + qr: + dependency: transitive + description: + name: qr + sha256: "5c4208b4dc0d55c3184d10d83ee0ded6212dc2b5e2ba17c5a0c0aab279128d21" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + qr_code_scanner: + dependency: "direct main" + description: + name: qr_code_scanner + sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd + url: "https://pub.dev" + source: hosted + version: "1.0.1" + qr_flutter: + dependency: "direct main" + description: + name: qr_flutter + sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e + url: "https://pub.dev" + source: hosted + version: "4.0.0" quiver: dependency: transitive description: @@ -988,6 +1020,22 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.0" + share_plus: + dependency: "direct main" + description: + name: share_plus + sha256: "8c6892037b1824e2d7e8f59d54b3105932899008642e6372e5079c6939b4b625" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + share_plus_platform_interface: + dependency: transitive + description: + name: share_plus_platform_interface + sha256: "82ddd4ab9260c295e6e39612d4ff00390b9a7a21f1bb1da771e2f232d80ab8a1" + url: "https://pub.dev" + source: hosted + version: "3.2.0" shared_preferences: dependency: "direct main" description: @@ -1000,26 +1048,26 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: a51a4f9375097f94df1c6e0a49c0374440d31ab026b59d58a7e7660675879db4 + sha256: ad423a80fe7b4e48b50d6111b3ea1027af0e959e49d485712e134863d9c1c521 url: "https://pub.dev" source: hosted - version: "2.0.16" + version: "2.0.17" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "6b84fdf06b32bb336f972d373cd38b63734f3461ba56ac2ba01b56d052796259" + sha256: "1e755f8583229f185cfca61b1d80fb2344c9d660e1c69ede5450d8f478fa5310" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: d7fb71e6e20cd3dfffcc823a28da3539b392e53ed5fc5c2b90b55fdaa8a7e8fa + sha256: "3a59ed10890a8409ad0faad7bb2957dab4b92b8fbe553257b05d30ed8af2c707" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" shared_preferences_platform_interface: dependency: transitive description: @@ -1032,18 +1080,18 @@ packages: dependency: transitive description: name: shared_preferences_web - sha256: "6737b757e49ba93de2a233df229d0b6a87728cea1684da828cbc718b65dcf9d7" + sha256: "0dc2633f215a3d4aa3184c9b2c5766f4711e4e5a6b256e62aafee41f89f1bfb8" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.6" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: bd014168e8484837c39ef21065b78f305810ceabc1d4f90be6e3b392ce81b46d + sha256: "71bcd669bb9cdb6b39f22c4a7728b6d49e934f6cba73157ffa5a54f1eed67436" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" shelf: dependency: transitive description: @@ -1201,6 +1249,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "206fb8334a700ef7754d6a9ed119e7349bc830448098f21a69bf1b4ed038cabc" + url: "https://pub.dev" + source: hosted + version: "3.0.4" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" + url: "https://pub.dev" + source: hosted + version: "2.0.16" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: a83ba3607a507758669cfafb03f9de09bf6e6280c14d9b9cb18f013e406dcacd + url: "https://pub.dev" + source: hosted + version: "3.0.5" user_repository: dependency: "direct main" description: @@ -1220,26 +1300,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: e43c38822e7d2facd790fd617ce16b10cc359a4b094d5772e3198904270918ef + sha256: "4cf8e60dbe4d3a693d37dff11255a172594c0793da542183cbfe7fe978ae4aaa" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.4" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "4a85a8563405bfe223052a85d6f8bc276ba3a22e12acfa3fd9a7108c67b32076" + sha256: "278ad5f816f58b1967396d1f78ced470e3e58c9fe4b27010102c0a595c764468" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.4" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "9e8066d2f18e88f2fb1cf6c8ca567417bdfb0145ac28519dcca3c15d42a10b3e" + sha256: "0bf61ad56e6fd6688a2865d3ceaea396bc6a0a90ea0d7ad5049b1b76c09d6163" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.4" vector_math: dependency: transitive description: @@ -1288,6 +1368,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + webview_flutter: + dependency: "direct main" + description: + name: webview_flutter + sha256: "47663d51a9061451aa3880a214ee9a65dcbb933b77bc44388e194279ab3ccaf6" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + sha256: "34f83c2f0f64c75ad75c77a2ccfc8d2e531afbe8ad41af1fd787d6d33336aa90" + url: "https://pub.dev" + source: hosted + version: "3.4.3" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + sha256: "1939c39e2150fb4d30fd3cc59a891a49fed9935db53007df633ed83581b6117b" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + sha256: ab12479f7a0cf112b9420c36aaf206a1ca47cd60cd42de74a4be2e97a697587b + url: "https://pub.dev" + source: hosted + version: "3.2.1" widgetbook: dependency: "direct main" description: From 4aef6b94f80e1aabe6e479bd48fd5f28654790ff Mon Sep 17 00:00:00 2001 From: Jeffrey Kengne Date: Tue, 21 Mar 2023 15:12:27 +0100 Subject: [PATCH 21/28] made google-service.json file available in the right location from the secrets --- .github/workflows/android-release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 44ed198..7fad732 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -45,6 +45,10 @@ jobs: channel: 'stable' - run: flutter upgrade - run: flutter --version + - name: Get DEV_GOOGLE_SERVICES_JSON content write it into app/src/development/google-services.json + env: + DEV_GOOGLE_SERVICES_JSON: ${{ secrets.DEV_GOOGLE_SERVICES_JSON }} + run: echo "$DEV_GOOGLE_SERVICES_JSON" > android/app/src/development/google-services.json - run: flutter pub get # - run: flutter test - run: flutter build apk --profile --flavor development --target lib/main_development.dart From c669339702fe80032ffdbcd8299daec6988acec5 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 23 Mar 2023 08:11:26 +0100 Subject: [PATCH 22/28] fix: update all color code to match all available color from design (figma) --- .../presentation/theming/colors/colors.dart | 39 ++++++++---- .../theming/themes/light_theme.dart | 61 +++++++++++-------- 2 files changed, 62 insertions(+), 38 deletions(-) diff --git a/lib/core/presentation/theming/colors/colors.dart b/lib/core/presentation/theming/colors/colors.dart index 3f879ee..83a3457 100644 --- a/lib/core/presentation/theming/colors/colors.dart +++ b/lib/core/presentation/theming/colors/colors.dart @@ -1,23 +1,36 @@ part of 'package:fpb/core/presentation/theming/themes/theme.dart'; class _AppColors { - static Color primaryColorW = const Color(0xff48A2DF); + static Color primaryColorW = const Color(0xFF5db1eb); + static Color primaryColorW2 = const Color(0xFF4285F4); + static Color primaryColorW3 = const Color(0xFF48A1DF); + static Color secondaryColorW = const Color(0xff000000); - static Color secondaryContainerW = const Color(0xffDF602F); + static Color secondaryColorW2 = const Color(0xff181818); + static Color secondaryColorW3 = const Color(0xff414141); + static Color secondaryColorW4 = const Color(0xff0B0B0B); + + static Color greyWhite = Color(0xFFF0F0F0); + static Color lightGrey = Color(0xFFABABAB); + static Color greyMedium = Color(0xFFB2B3BD); + static Color greyOutline = Color(0xFFE4E4E4); + static Color greyDark = Color(0xFF808080); + + static Color warningColor = const Color(0xffFBBC04); + + static Color successColor = const Color(0xff34A853); + static Color errorContainerW = const Color(0xffFFE5E7); - static Color onErrorW = const Color(0xffFF000D); - // static Color bgColorW = const Color(0xffF7F7F7); - static Color bgColorW = Color(0xffFFFFFF); - static Color onBgColorW = Color(0xffD9D9D9); - // static Color surfaceW = const Color(0xffF5F5F5); // ; - // static Color surfacerW = Color(0xffFFFFFF); + static Color onErrorW = const Color(0xffEA4335); - static Color onSurfaceW = Color(0xfff7f7f7); // const Color(0xff808191); - static Color greyLight = Color(0xFFABABAB); + static Color orangePrimary = const Color(0xffDF602F); + static Color orangePrimaryW2 = const Color(0xffC95528); + static Color orangePrimaryW3 = const Color(0xffEC6936); + static Color orangePrimaryW4 = const Color(0xffA34420); // has shades of dark - static Color lightGrey = Color(0xffA7A7A7); - static Color orangePrimary = Color(0xffDF602F); - static Color orangeDark = Color(0xffA34420); + static Color bgColorW = Color(0xffFFFFFF); // use for some screen as bgColor + static Color onSurfaceW = Color(0xfff7f7f7); // use for some screen as bgColor + static Color onBgColorW = Color(0xffD9D9D9); static Color getShade(Color color, {bool darker = false, double value = .1}) { assert(value >= 0 && value <= 1, 'verify domain interval'); diff --git a/lib/core/presentation/theming/themes/light_theme.dart b/lib/core/presentation/theming/themes/light_theme.dart index ee65422..60c78ae 100644 --- a/lib/core/presentation/theming/themes/light_theme.dart +++ b/lib/core/presentation/theming/themes/light_theme.dart @@ -20,33 +20,44 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { ), ), colorScheme: ColorScheme.light( - primary: _AppColors.primaryColorW, - onPrimary: _AppColors.onSurfaceW, + primary: _AppColors.primaryColorW, // main blue color + onPrimary: _AppColors.primaryColorW2, + primaryContainer: _AppColors.primaryColorW, - onPrimaryContainer: _AppColors.onSurfaceW, - secondary: _AppColors.secondaryColorW, - onSecondary: _AppColors.primaryColorW, - secondaryContainer: _AppColors.secondaryContainerW, - tertiary: _AppColors.onSurfaceW, // use for static code (qrCode screen) - onTertiary: _AppColors.orangePrimary, // use for cards and icon - Orange + onPrimaryContainer: _AppColors.primaryColorW3, + + secondary: _AppColors.secondaryColorW, // black color (Text, btn etc) + onSecondary: _AppColors.secondaryColorW2, + + secondaryContainer: _AppColors.secondaryColorW3, + onSecondaryContainer: _AppColors.secondaryColorW4, + + tertiary: _AppColors.orangePrimary, // use orange + onTertiary: _AppColors.orangePrimaryW2, // use for cards and icon - Orange + + tertiaryContainer: _AppColors.orangePrimaryW3, onTertiaryContainer: - _AppColors.orangeDark, // use for cards and icon - OrangeDark - inverseSurface: Colors - .green, // set to odd color so we can see which component in the UI is affected - inversePrimary: Colors - .yellow, // set to odd color so we can see which component in the UI is affected - outline: _AppColors - .lightGrey, // set to odd color so we can see which component in the UI is affected - surface: _AppColors.bgColorW, - onSurface: _AppColors.onSurfaceW, - background: _AppColors.bgColorW, - onBackground: _AppColors.onBgColorW, - error: _AppColors.primaryColorW, + _AppColors.orangePrimaryW4, // use for cards and icon - OrangeDark + + inverseSurface: _AppColors.successColor, // success color + inversePrimary: _AppColors.warningColor, // warning color + + outline: + _AppColors.greyOutline, // use for input borders - container borders + outlineVariant: _AppColors.greyMedium, + onInverseSurface: _AppColors.greyDark, + + surface: _AppColors.bgColorW, // white bg + onSurface: _AppColors.onSurfaceW, // darkGrey bg + onSurfaceVariant: _AppColors.onBgColorW, + + background: _AppColors.greyWhite, // used on tabBar bgColor, some text + onBackground: _AppColors.lightGrey, + + error: _AppColors.onErrorW, // error display onError: _AppColors.onErrorW, errorContainer: _AppColors.errorContainerW, - // onError: AppColors.errorColor, - brightness: Brightness.light, ), // primarySwatch: AppColors.getPrimaryMaterialColorWhiteTheme, @@ -72,7 +83,7 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { ), titleSmall: style.titleSmall?.copyWith( fontSize: cts.maxWidth * 0.04, - color: _AppColors.greyLight, + color: _AppColors.lightGrey, ), bodyLarge: style.bodyLarge?.copyWith( fontSize: cts.maxWidth * 0.042, @@ -158,7 +169,7 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { .purple, // _AppColors.onSurfaceW, // theme.colorScheme.onSurface, labelStyle: style.bodySmall, unselectedLabelStyle: style.bodySmall, - unselectedLabelColor: theme.colorScheme.onSurface, + unselectedLabelColor: theme.colorScheme.background, labelColor: theme.colorScheme.onBackground, dividerColor: Colors.purple, indicator: BoxDecoration( @@ -170,7 +181,7 @@ ThemeData whiteTheme(BuildContext context, BoxConstraints cts) { ), iconTheme: IconThemeData( - color: _AppColors.greyLight, + color: _AppColors.lightGrey, size: cts.maxWidth * 0.07, ), ); From 9ca3c91f2279c869e9b724e95eaa926833ffd19f Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 23 Mar 2023 08:22:55 +0100 Subject: [PATCH 23/28] pull from mainstream and resolved conflicts --- .github/workflows/android-release.yml | 106 ++++++++++++++++++++++++++ android/build.gradle | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/android-release.yml diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml new file mode 100644 index 0000000..7fad732 --- /dev/null +++ b/.github/workflows/android-release.yml @@ -0,0 +1,106 @@ +name: Android App Release for development branch + +on: + push: + branches: + - development + +jobs: + version: + name: Create version number # using GitVersion + runs-on: ubuntu-latest #macos-latest + steps: + - uses: actions/checkout@v3 + - name: Fetch all history for all tags and branches + run: git fetch --prune --depth=10000 + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + - name: Use GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.15 + - name: Create android-version.txt with nuGetVersion + run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > android-version.txt + - name: Upload android-version.txt + uses: actions/upload-artifact@v3 + with: + name: gitversion + path: android-version.txt + build: + name: Build Appbundle and Apks + needs: [ version ] + runs-on: ubuntu-latest #macos-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '12.x' + distribution: 'zulu' + cache: 'gradle' + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.3.7' + cache: true + channel: 'stable' + - run: flutter upgrade + - run: flutter --version + - name: Get DEV_GOOGLE_SERVICES_JSON content write it into app/src/development/google-services.json + env: + DEV_GOOGLE_SERVICES_JSON: ${{ secrets.DEV_GOOGLE_SERVICES_JSON }} + run: echo "$DEV_GOOGLE_SERVICES_JSON" > android/app/src/development/google-services.json + - run: flutter pub get + # - run: flutter test + - run: flutter build apk --profile --flavor development --target lib/main_development.dart + # - run: flutter build appbundle + - name: upload app builds files + uses: actions/upload-artifact@v3 + with: + name: flutter-app-builds + path: | + build/app/outputs/flutter-apk/app-development-profile.apk + github-deploy: + name: Deploy Build to Github + needs: [ build, version ] + runs-on: ubuntu-latest #macos-latest + steps: + - name: Get android-version.txt + uses: actions/download-artifact@v3 + with: + name: gitversion + - name: Read version + id: version + uses: juliangruber/read-file-action@v1 + with: + path: android-version.txt + - name: Get app builds + uses: actions/download-artifact@v3 + with: + name: flutter-app-builds + - name: Echo android-version.txt + run: echo "${{ steps.version.outputs.content }}" + - name: Display structure of downloaded files + run: ls -R + - name: Create a Release in GitHub + uses: ncipollo/release-action@v1 + with: + artifacts: "flutter-apk/app-development-profile.apk" + token: ${{ secrets.GH_TOKEN }} + tag: ${{ steps.version.outputs.content }} + commit: ${{ github.sha }} + firebase-deploy: + name: Deploy Build to Firebase App Distribution + needs: [ build ] + runs-on: ubuntu-latest #macos-latest + steps: + - name: Get app builds + uses: actions/download-artifact@v3 + with: + name: flutter-app-builds + - name: upload artifact to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 + with: + appId: ${{secrets.FIREBASE_ANDROID_APP_ID}} + serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} + groups: testers + file: flutter-apk/app-development-profile.apk \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 0a1af40..916d8cc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.6.10'//1.8.10 -> 1.8.10 because of release build failures repositories { google() mavenCentral() From de5f8df17ab0a0af53f82b5b7b4b12ce96f2538e Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 23 Mar 2023 08:34:29 +0100 Subject: [PATCH 24/28] fix: resolve config from injectable and app_router --- lib/injection.config.dart | 28 +++--- lib/router/app_route.gr.dart | 160 ++++++++++++++++------------------- 2 files changed, 86 insertions(+), 102 deletions(-) diff --git a/lib/injection.config.dart b/lib/injection.config.dart index e23a1e0..41bc4d3 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -15,7 +15,7 @@ import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i28; + as _i30; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' @@ -23,7 +23,7 @@ import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_fa import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i29; + as _i32; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' as _i24; import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' @@ -31,20 +31,20 @@ import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i30; + as _i31; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' - as _i31; + as _i28; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' as _i27; -import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; +import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i29; import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' @@ -138,16 +138,16 @@ extension GetItInjectableX on _i1.GetIt { } } -class _$AuthenticationMockModuleInjection - extends _i28.AuthenticationMockModuleInjection {} +class _$GoogleAuthenticationInjectableModule + extends _i28.GoogleAuthenticationInjectableModule {} -class _$FacebookAuthenticationInjectableModule - extends _i29.FacebookAuthenticationInjectableModule {} +class _$CoreInjectableModule extends _i29.CoreInjectableModule {} -class _$FirebaseAuthInjectableModule - extends _i30.FirebaseAuthInjectableModule {} +class _$AuthenticationMockModuleInjection + extends _i30.AuthenticationMockModuleInjection {} -class _$GoogleAuthenticationInjectableModule - extends _i31.GoogleAuthenticationInjectableModule {} +class _$FirebaseAuthInjectableModule + extends _i31.FirebaseAuthInjectableModule {} -class _$CoreInjectableModule extends _i32.CoreInjectableModule {} +class _$FacebookAuthenticationInjectableModule + extends _i32.FacebookAuthenticationInjectableModule {} diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 0868fac..9eca0f9 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,12 +11,12 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i16; -import 'package:flutter/material.dart' as _i17; +import 'package:auto_route/auto_route.dart' as _i15; +import 'package:flutter/material.dart' as _i16; -import '../contact_us/view/contact_us_screen.dart' as _i12; -import '../contact_us/view/contact_us_success_screen.dart' as _i13; -import '../core/domain/user.dart' as _i18; +import '../contact_us/view/contact_us_screen.dart' as _i11; +import '../contact_us/view/contact_us_success_screen.dart' as _i12; +import '../core/domain/user.dart' as _i17; import '../email_confirmation/email_confirmation.dart' as _i4; import '../home/view/home_screen.dart' as _i8; import '../latest_activities/view/latest_activities_screen.dart' as _i9; @@ -25,51 +25,51 @@ import '../onboarding/view/splash_screen.dart' as _i1; import '../payment_methods/payment_method_screen.dart' as _i7; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i15; -import '../qr_code_screen/view/qr_code_screen.dart' as _i10; +import '../profile/view/profile_page.dart' as _i14; +import '../qr_code_screen/view/qr_code_screen.dart' as _i9; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; -import '../savings/view/savings_page.dart' as _i14; +import '../savings/view/savings_page.dart' as _i13; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i16.RootStackRouter { - AppRoute([_i17.GlobalKey<_i17.NavigatorState>? navigatorKey]) +class AppRoute extends _i15.RootStackRouter { + AppRoute([_i16.GlobalKey<_i16.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); @@ -82,7 +82,7 @@ class AppRoute extends _i16.RootStackRouter { }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: _i8.HomeScreen( key: args.key, @@ -91,13 +91,13 @@ class AppRoute extends _i16.RootStackRouter { ); }, LatestActivitiesPage.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i9.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i10.QrCodeScreen(), ); @@ -105,7 +105,7 @@ class AppRoute extends _i16.RootStackRouter { OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: _i11.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, @@ -114,94 +114,90 @@ class AppRoute extends _i16.RootStackRouter { ); }, ContactUsRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, child: const _i12.ContactUsScreen(), ); }, ContactUsSuccessRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, - child: const _i13.ContactUsSuccessScreen(), + child: const _i12.ContactUsSuccessScreen(), ); }, SavingsPage.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, - child: const _i14.SavingsPage(), + child: const _i13.SavingsPage(), ); }, ProfileRoute.name: (routeData) { - return _i16.MaterialPageX( + return _i15.MaterialPageX( routeData: routeData, - child: const _i15.ProfileScreen(), + child: const _i14.ProfileScreen(), ); }, }; @override - List<_i16.RouteConfig> get routes => [ - _i16.RouteConfig( + List<_i15.RouteConfig> get routes => [ + _i15.RouteConfig( SplashRoute.name, path: '/', ), - _i16.RouteConfig( + _i15.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i16.RouteConfig( - PaymentMethodRoute.name, - path: '/payment-method-screen', - ), - _i16.RouteConfig( + _i15.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i16.RouteConfig( + _i15.RouteConfig( SavingsPage.name, path: 'savings', parent: HomeRouter.name, ), - _i16.RouteConfig( + _i15.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, ), ], ), - _i16.RouteConfig( + _i15.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i16.RouteConfig( + _i15.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( ContactUsRoute.name, path: '/contact-us-screen', ), - _i16.RouteConfig( + _i15.RouteConfig( ContactUsSuccessRoute.name, path: '/contact-us-success-screen', ), @@ -210,7 +206,7 @@ class AppRoute extends _i16.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i16.PageRouteInfo { +class SplashRoute extends _i15.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -222,7 +218,7 @@ class SplashRoute extends _i16.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i16.PageRouteInfo { +class SignInRoute extends _i15.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -234,7 +230,7 @@ class SignInRoute extends _i16.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i16.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -246,7 +242,7 @@ class PhoneNumberConfirmationRoute extends _i16.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i16.PageRouteInfo { +class EmailConfirmationRoute extends _i15.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -258,7 +254,7 @@ class EmailConfirmationRoute extends _i16.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i16.PageRouteInfo { +class SignUpRoute extends _i15.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -270,7 +266,7 @@ class SignUpRoute extends _i16.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i16.PageRouteInfo { +class SaveMoneyRoute extends _i15.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -281,24 +277,12 @@ class SaveMoneyRoute extends _i16.PageRouteInfo { } /// generated route for -/// [_i7.PaymentMethodScreen] -class PaymentMethodRoute extends _i16.PageRouteInfo { - const PaymentMethodRoute() - : super( - PaymentMethodRoute.name, - path: '/payment-method-screen', - ); - - static const String name = 'PaymentMethodRoute'; -} - -/// generated route for -/// [_i8.HomeScreen] -class HomeRouter extends _i16.PageRouteInfo { +/// [_i7.HomeScreen] +class HomeRouter extends _i15.PageRouteInfo { HomeRouter({ - _i17.Key? key, - required _i18.User user, - List<_i16.PageRouteInfo>? children, + _i16.Key? key, + required _i17.User user, + List<_i15.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -318,9 +302,9 @@ class HomeRouterArgs { required this.user, }); - final _i17.Key? key; + final _i16.Key? key; - final _i18.User user; + final _i17.User user; @override String toString() { @@ -329,8 +313,8 @@ class HomeRouterArgs { } /// generated route for -/// [_i9.LatestActivitiesPage] -class LatestActivitiesPage extends _i16.PageRouteInfo { +/// [_i8.LatestActivitiesPage] +class LatestActivitiesPage extends _i15.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -341,8 +325,8 @@ class LatestActivitiesPage extends _i16.PageRouteInfo { } /// generated route for -/// [_i10.QrCodeScreen] -class QrCodeRoute extends _i16.PageRouteInfo { +/// [_i9.QrCodeScreen] +class QrCodeRoute extends _i15.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -353,11 +337,11 @@ class QrCodeRoute extends _i16.PageRouteInfo { } /// generated route for -/// [_i11.OnboardingScreen] -class OnboardingRoute extends _i16.PageRouteInfo { +/// [_i10.OnboardingScreen] +class OnboardingRoute extends _i15.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i17.Key? key, + _i16.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -378,7 +362,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i17.Key? key; + final _i16.Key? key; @override String toString() { @@ -387,8 +371,8 @@ class OnboardingRouteArgs { } /// generated route for -/// [_i12.ContactUsScreen] -class ContactUsRoute extends _i16.PageRouteInfo { +/// [_i11.ContactUsScreen] +class ContactUsRoute extends _i15.PageRouteInfo { const ContactUsRoute() : super( ContactUsRoute.name, @@ -399,8 +383,8 @@ class ContactUsRoute extends _i16.PageRouteInfo { } /// generated route for -/// [_i13.ContactUsSuccessScreen] -class ContactUsSuccessRoute extends _i16.PageRouteInfo { +/// [_i12.ContactUsSuccessScreen] +class ContactUsSuccessRoute extends _i15.PageRouteInfo { const ContactUsSuccessRoute() : super( ContactUsSuccessRoute.name, @@ -411,8 +395,8 @@ class ContactUsSuccessRoute extends _i16.PageRouteInfo { } /// generated route for -/// [_i14.SavingsPage] -class SavingsPage extends _i16.PageRouteInfo { +/// [_i13.SavingsPage] +class SavingsPage extends _i15.PageRouteInfo { const SavingsPage() : super( SavingsPage.name, @@ -423,8 +407,8 @@ class SavingsPage extends _i16.PageRouteInfo { } /// generated route for -/// [_i15.ProfileScreen] -class ProfileRoute extends _i16.PageRouteInfo { +/// [_i14.ProfileScreen] +class ProfileRoute extends _i15.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, From 36d19cf616e9abf96a9468e222119825e9f5bfe5 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 23 Mar 2023 13:03:10 +0100 Subject: [PATCH 25/28] Pull from upstream, alongside the analyzer formater changes --- lib/contact_us/view/contact_us_screen.dart | 4 +- .../view/contact_us_success_screen.dart | 14 +- .../widgets/contact_us_success_texts.dart | 7 +- .../view/widgets/message_textfield.dart | 16 +- .../double_circular_slider.dart | 2 +- .../presentation/theming/colors/colors.dart | 4 +- lib/core/shared/helpers/extensions.dart | 5 +- lib/home/view/budget_screen.dart | 28 ++- lib/home/view/user_search_screen.dart | 10 +- lib/injection.config.dart | 28 +-- lib/onboarding/view/onboarding_screens.dart | 4 +- .../view/widgets/illustration_image.dart | 2 +- .../view/widget/payment_cards_widget.dart | 2 +- .../view/phone_number_confirmation.dart | 3 +- lib/profile/view/profile_page.dart | 137 ++++++--------- .../view/widgets/profileInfoOptions.dart | 44 +++-- lib/qr_code_screen/qr_code_screen.dart | 2 +- lib/qr_code_screen/view/qr_code_screen.dart | 4 +- .../view/widget/my_qrcode_widget.dart | 5 +- .../view/widget/scan_qrcode_widget.dart | 3 +- lib/router/app_route.gr.dart | 160 ++++++++++-------- lib/savings/view/savings_page.dart | 1 - lib/sign_in/view/sign_in_page.dart | 5 +- 23 files changed, 234 insertions(+), 256 deletions(-) diff --git a/lib/contact_us/view/contact_us_screen.dart b/lib/contact_us/view/contact_us_screen.dart index 00598b5..f39a7db 100644 --- a/lib/contact_us/view/contact_us_screen.dart +++ b/lib/contact_us/view/contact_us_screen.dart @@ -147,9 +147,7 @@ class _ContactUsScreenState extends State { label: l10n.contactUsSubmitBtnLabel, onTap: () { if (_formKey.currentState!.validate()) { - context.router.push( - ContactUsSuccessRoute() - ); + context.router.push(ContactUsSuccessRoute()); } else {} }) ]), diff --git a/lib/contact_us/view/contact_us_success_screen.dart b/lib/contact_us/view/contact_us_success_screen.dart index cc94e7d..84cc6d2 100644 --- a/lib/contact_us/view/contact_us_success_screen.dart +++ b/lib/contact_us/view/contact_us_success_screen.dart @@ -7,7 +7,9 @@ import 'package:fpb/l10n/l10n.dart'; import 'package:fpb/sign_in/view/sign_in_page.dart'; class ContactUsSuccessScreen extends StatelessWidget { - const ContactUsSuccessScreen({super.key, }); + const ContactUsSuccessScreen({ + super.key, + }); @override Widget build(BuildContext context) { @@ -16,8 +18,7 @@ class ContactUsSuccessScreen extends StatelessWidget { final style = theme.textTheme; //final colors = theme.colorScheme; - return LayoutBuilder( - builder: (context, box){ + return LayoutBuilder(builder: (context, box) { return Scaffold( resizeToAvoidBottomInset: false, body: Stack(children: [ @@ -45,7 +46,6 @@ class ContactUsSuccessScreen extends StatelessWidget { bottom: box.maxHeight * .005), child: Column( crossAxisAlignment: CrossAxisAlignment.center, - children: [ SizedBox( height: box.maxHeight * .1, @@ -54,9 +54,7 @@ class ContactUsSuccessScreen extends StatelessWidget { SizedBox( height: box.maxHeight * .0001, ), - ContactUsSuccessTexts( - - l10n: l10n, style: style, box: box), + ContactUsSuccessTexts(l10n: l10n, style: style, box: box), SizedBox( height: box.maxHeight * .15, ), @@ -74,6 +72,6 @@ class ContactUsSuccessScreen extends StatelessWidget { )) ]), ); - }); + }); } } diff --git a/lib/contact_us/view/widgets/contact_us_success_texts.dart b/lib/contact_us/view/widgets/contact_us_success_texts.dart index c64935c..689a2c1 100644 --- a/lib/contact_us/view/widgets/contact_us_success_texts.dart +++ b/lib/contact_us/view/widgets/contact_us_success_texts.dart @@ -26,11 +26,8 @@ class ContactUsSuccessTexts extends StatelessWidget { SizedBox( height: box.maxHeight * .025, ), - Text( - l10n.contactUsSuccessText, - maxLines: 3, - textAlign: TextAlign.center, - style: style.titleMedium), + Text(l10n.contactUsSuccessText, + maxLines: 3, textAlign: TextAlign.center, style: style.titleMedium), ], ); } diff --git a/lib/contact_us/view/widgets/message_textfield.dart b/lib/contact_us/view/widgets/message_textfield.dart index 0ad0ea6..1cd946e 100644 --- a/lib/contact_us/view/widgets/message_textfield.dart +++ b/lib/contact_us/view/widgets/message_textfield.dart @@ -40,7 +40,8 @@ class _MessageTextFieldState extends State { }, maxLength: 500, controller: messageController, - validator: (value) => widget.validator?.call(value) != null ? "" : null, + validator: (value) => + widget.validator?.call(value) != null ? "" : null, maxLines: 3, decoration: InputDecoration( hintText: l10n.contactUsMessageTextFieldHintText, @@ -53,12 +54,13 @@ class _MessageTextFieldState extends State { ), ), ), - ).card( - padding: - EdgeInsets.symmetric(vertical: widget.box.maxHeight * .007)). - validatorWidget( - //messageController.text.isEmpty ? null : - widget.validator?.call(messageController.text)), + ) + .card( + padding: + EdgeInsets.symmetric(vertical: widget.box.maxHeight * .007)) + .validatorWidget( + //messageController.text.isEmpty ? null : + widget.validator?.call(messageController.text)), ], ); } diff --git a/lib/core/presentation/animations/circular_slider_animation/double_circular_slider.dart b/lib/core/presentation/animations/circular_slider_animation/double_circular_slider.dart index bbf6acf..6465c72 100644 --- a/lib/core/presentation/animations/circular_slider_animation/double_circular_slider.dart +++ b/lib/core/presentation/animations/circular_slider_animation/double_circular_slider.dart @@ -114,7 +114,7 @@ class _DoubleCircularSliderState extends State { width: widget.width ?? 220, child: CircularSliderPaint( mode: CircularSliderMode.doubleHandler, - init: _init, + init: _init, end: _end, divisions: widget.divisions, primarySectors: widget.primarySectors ?? 0, diff --git a/lib/core/presentation/theming/colors/colors.dart b/lib/core/presentation/theming/colors/colors.dart index 83a3457..d19a5de 100644 --- a/lib/core/presentation/theming/colors/colors.dart +++ b/lib/core/presentation/theming/colors/colors.dart @@ -3,12 +3,12 @@ part of 'package:fpb/core/presentation/theming/themes/theme.dart'; class _AppColors { static Color primaryColorW = const Color(0xFF5db1eb); static Color primaryColorW2 = const Color(0xFF4285F4); - static Color primaryColorW3 = const Color(0xFF48A1DF); + static Color primaryColorW3 = const Color(0xFF5eb1eb); static Color secondaryColorW = const Color(0xff000000); static Color secondaryColorW2 = const Color(0xff181818); static Color secondaryColorW3 = const Color(0xff414141); - static Color secondaryColorW4 = const Color(0xff0B0B0B); + static Color secondaryColorW4 = const Color(0xff0B0B0B); static Color greyWhite = Color(0xFFF0F0F0); static Color lightGrey = Color(0xFFABABAB); diff --git a/lib/core/shared/helpers/extensions.dart b/lib/core/shared/helpers/extensions.dart index 40445d2..2eb02ca 100644 --- a/lib/core/shared/helpers/extensions.dart +++ b/lib/core/shared/helpers/extensions.dart @@ -15,8 +15,9 @@ extension extString on String { bool get isNotNull { // ignore: unnecessary_null_comparison return this != null; - - }} + } +} + /// Padding for screens extension PaddingX on Widget { Widget paddingDefault(BoxConstraints box) { diff --git a/lib/home/view/budget_screen.dart b/lib/home/view/budget_screen.dart index d07f490..52f7cec 100644 --- a/lib/home/view/budget_screen.dart +++ b/lib/home/view/budget_screen.dart @@ -24,17 +24,11 @@ class _BudgetScreenState extends State { final baseColor = Color.fromRGBO(223, 96, 47, 1); - late int initTime; - late int endTime; + late int initBudget; + late int endBudget; - // amount of money - // late int initTime; - // late int endTime; - - - - late int inBedTime; - late int outBedTime; + late int inFinalBudget; + late int outFinalBudget; int days = 0; @override @@ -45,19 +39,19 @@ class _BudgetScreenState extends State { void _shuffle() { setState(() { - initTime = _generateRandomTime(); - endTime = _generateRandomTime(); + initBudget = _generateRandomAmount(); + // endBudget = __generateRandomAmount(); // print({'Gen': _generateRandomTime()}); // print({'Time': _generateRandomTime()}); - inBedTime = initTime; - outBedTime = endTime; + inFinalBudget = initBudget; + outFinalBudget = endBudget; }); } void _updateLabels(int init, int end, int laps) { setState(() { - inBedTime = init; - outBedTime = end; + inFinalBudget = init; + outFinalBudget = end; days = laps; }); } @@ -151,5 +145,5 @@ class _BudgetScreenState extends State { ); } - int _generateRandomTime() => Random().nextInt(288); + int _generateRandomAmount() => Random().nextInt(288); } diff --git a/lib/home/view/user_search_screen.dart b/lib/home/view/user_search_screen.dart index 0d18eaf..b4a8a94 100644 --- a/lib/home/view/user_search_screen.dart +++ b/lib/home/view/user_search_screen.dart @@ -19,11 +19,11 @@ class UserSearchScreen extends StatelessWidget { } return LayoutBuilder(builder: (context, box) { return AnnotatedRegion( - value: SystemUiOverlayStyle( - statusBarColor: Theme.of(context).colorScheme.surface, - statusBarIconBrightness: Brightness.dark, // dark icon for iOS - statusBarBrightness: Brightness.dark, // set dark icon for android - ), + value: SystemUiOverlayStyle( + statusBarColor: Theme.of(context).colorScheme.surface, + statusBarIconBrightness: Brightness.dark, // dark icon for iOS + statusBarBrightness: Brightness.dark, // set dark icon for android + ), child: SafeArea( child: GestureDetector( onTap: () { diff --git a/lib/injection.config.dart b/lib/injection.config.dart index 41bc4d3..e23a1e0 100644 --- a/lib/injection.config.dart +++ b/lib/injection.config.dart @@ -15,7 +15,7 @@ import 'package:flutter_facebook_auth/flutter_facebook_auth.dart' as _i5; import 'package:fpb/authentication_mock_without_backend/application/bloc/authentication_bloc.dart' as _i17; import 'package:fpb/authentication_mock_without_backend/infrastructure/authentication_mock_module_injection.dart' - as _i30; + as _i28; import 'package:fpb/authentication_with_facebook/application/facebook_auth_bloc.dart' as _i19; import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_facade.dart' @@ -23,7 +23,7 @@ import 'package:fpb/authentication_with_facebook/domain/i_facebook_repository_fa import 'package:fpb/authentication_with_facebook/infrastructure/facebook_auth_repository.dart' as _i11; import 'package:fpb/authentication_with_facebook/infrastructure/facebook_authentication_injectable_module.dart' - as _i32; + as _i29; import 'package:fpb/authentication_with_firebase/application/bloc/auth_bloc.dart' as _i24; import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' @@ -31,20 +31,20 @@ import 'package:fpb/authentication_with_firebase/domain/i_auth_facade.dart' import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_facade_impl.dart' as _i22; import 'package:fpb/authentication_with_firebase/infrastructure/firebase_auth_injectable_module.dart' - as _i31; + as _i30; import 'package:fpb/authentication_with_google/application/google_auth_bloc/google_sign_in_bloc.dart' as _i20; import 'package:fpb/authentication_with_google/domain/i_google_repository_facade.dart' as _i12; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_injectable_module.dart' - as _i28; + as _i31; import 'package:fpb/authentication_with_google/infrastructure/google_authentication_repository.dart' as _i13; import 'package:fpb/core/application/email_password_bloc/email_password_bloc.dart' as _i25; import 'package:fpb/core/application/internet_and_time_bloc/internet_and_time_bloc.dart' as _i27; -import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i29; +import 'package:fpb/core/infrastructure/core_injectable_module.dart' as _i32; import 'package:fpb/core/settings/app_settings_helper.dart' as _i23; import 'package:fpb/core/settings/cached.dart' as _i18; import 'package:fpb/home/application/home_view_bloc/home_view_bloc.dart' @@ -138,16 +138,16 @@ extension GetItInjectableX on _i1.GetIt { } } -class _$GoogleAuthenticationInjectableModule - extends _i28.GoogleAuthenticationInjectableModule {} - -class _$CoreInjectableModule extends _i29.CoreInjectableModule {} - class _$AuthenticationMockModuleInjection - extends _i30.AuthenticationMockModuleInjection {} + extends _i28.AuthenticationMockModuleInjection {} + +class _$FacebookAuthenticationInjectableModule + extends _i29.FacebookAuthenticationInjectableModule {} class _$FirebaseAuthInjectableModule - extends _i31.FirebaseAuthInjectableModule {} + extends _i30.FirebaseAuthInjectableModule {} -class _$FacebookAuthenticationInjectableModule - extends _i32.FacebookAuthenticationInjectableModule {} +class _$GoogleAuthenticationInjectableModule + extends _i31.GoogleAuthenticationInjectableModule {} + +class _$CoreInjectableModule extends _i32.CoreInjectableModule {} diff --git a/lib/onboarding/view/onboarding_screens.dart b/lib/onboarding/view/onboarding_screens.dart index 16b6add..15345a2 100644 --- a/lib/onboarding/view/onboarding_screens.dart +++ b/lib/onboarding/view/onboarding_screens.dart @@ -18,13 +18,13 @@ class OnboardingScreen extends HookWidget { final listIllustration = [ Illustration( assetName: SvgNames.sendIllustration, - illustrationBgColor: colors.primary, + illustrationBgColor: colors.onPrimaryContainer, title: l10n.onboardingSendTitle, description: l10n.onboardingSendDescription, ), Illustration( assetName: SvgNames.saveIllustration, - illustrationBgColor: colors.secondaryContainer, + illustrationBgColor: colors.tertiary, title: l10n.onboardingSaveTitle, description: l10n.onboardingSaveDescription, ), diff --git a/lib/onboarding/view/widgets/illustration_image.dart b/lib/onboarding/view/widgets/illustration_image.dart index 7db3d10..44661d3 100644 --- a/lib/onboarding/view/widgets/illustration_image.dart +++ b/lib/onboarding/view/widgets/illustration_image.dart @@ -22,7 +22,7 @@ class IllustrationImage extends StatelessWidget { width: cts.maxWidth, child: Container( padding: EdgeInsets.all(cts.maxWidth * 0.1), - color: color ?? Colors.black, + color: color ?? Theme.of(context).colorScheme.secondary, child: SvgPicture.asset(illustration), ), ); diff --git a/lib/payment_methods/view/widget/payment_cards_widget.dart b/lib/payment_methods/view/widget/payment_cards_widget.dart index 6fbf14d..7a6a0da 100644 --- a/lib/payment_methods/view/widget/payment_cards_widget.dart +++ b/lib/payment_methods/view/widget/payment_cards_widget.dart @@ -71,7 +71,7 @@ class _PaymentCardsWidgetState extends State { width: widget.box.maxWidth * 0.5, height: widget.box.maxHeight * 0.055, label: 'Add Card', - backgroundColor: Theme.of(context).colorScheme.secondary, + backgroundColor: Theme.of(context).colorScheme.secondary, onTap: () => print('Add Card'), spaceAround: true, leading: Icon( diff --git a/lib/phone_number_confirmation/view/phone_number_confirmation.dart b/lib/phone_number_confirmation/view/phone_number_confirmation.dart index 50309e8..0ed8a35 100644 --- a/lib/phone_number_confirmation/view/phone_number_confirmation.dart +++ b/lib/phone_number_confirmation/view/phone_number_confirmation.dart @@ -34,8 +34,7 @@ class _PhoneNumberConfirmationScreenState SingleChildScrollView( child: Padding( padding: EdgeInsets.only( - left: box.maxHeight * .025, - right: box.maxHeight * .025), + left: box.maxHeight * .025, right: box.maxHeight * .025), child: Column( children: [ SizedBox( diff --git a/lib/profile/view/profile_page.dart b/lib/profile/view/profile_page.dart index ace6831..391474a 100644 --- a/lib/profile/view/profile_page.dart +++ b/lib/profile/view/profile_page.dart @@ -17,7 +17,7 @@ class _ProfileScreenState extends State { @override Widget build(BuildContext context) { final l10n = context.l10n; - final theme = Theme.of(context); + final theme = Theme.of(context); return Scaffold( backgroundColor: theme.colorScheme.onBackground, body: LayoutBuilder( @@ -32,39 +32,29 @@ class _ProfileScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TitleText( - box: box, - l10n: l10n), + TitleText(box: box, l10n: l10n), SizedBox( height: box.maxHeight * 0.03, ), - UserPic( - box: box), + UserPic(box: box), SizedBox( height: box.maxHeight * 0.01, ), Center( - child: UserName( - box: box), + child: UserName(box: box), ), SizedBox( height: box.maxHeight * 0.03, ), - UserProfileOptions( - box: box, - l10n: l10n), + UserProfileOptions(box: box, l10n: l10n), SizedBox( height: box.maxHeight * 0.02, ), - LogOutOption( - box:box, - l10n: l10n), + LogOutOption(box: box, l10n: l10n), SizedBox( height: box.maxHeight * 0.1, ), - AppVersion( - box: box, - l10n: l10n) + AppVersion(box: box, l10n: l10n) ], ), ), @@ -76,11 +66,7 @@ class _ProfileScreenState extends State { } class AppVersion extends StatelessWidget { - const AppVersion({ - super.key, - required this.l10n, - required this.box - }); + const AppVersion({super.key, required this.l10n, required this.box}); final AppLocalizations l10n; final BoxConstraints box; @@ -91,7 +77,7 @@ class AppVersion extends StatelessWidget { child: Column( children: [ Text( - 'Version 10.2', + 'Version 10.2', style: Theme.of(context).textTheme.titleSmall, ), SizedBox( @@ -112,11 +98,7 @@ class AppVersion extends StatelessWidget { } class LogOutOption extends StatelessWidget { - const LogOutOption({ - super.key, - required this.l10n, - required this.box - }); + const LogOutOption({super.key, required this.l10n, required this.box}); final AppLocalizations l10n; final BoxConstraints box; @@ -124,24 +106,22 @@ class LogOutOption extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(box.maxHeight * 0.025), - color: Colors.white, - ), - child: Padding( - padding: EdgeInsets.only( - left: box.maxHeight * 0.03, - top: box.maxHeight * 0.01, - bottom: box.maxHeight * 0.01, - ), - child: - ProfileInfoOptions( - text: l10n.profileLogOutText, - icon: FpbIcons.logout, - box: box, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(box.maxHeight * 0.025), + color: Colors.white, ), - ) - ); + child: Padding( + padding: EdgeInsets.only( + left: box.maxHeight * 0.03, + top: box.maxHeight * 0.01, + bottom: box.maxHeight * 0.01, + ), + child: ProfileInfoOptions( + text: l10n.profileLogOutText, + icon: FpbIcons.logout, + box: box, + ), + )); } } @@ -169,23 +149,23 @@ class UserProfileOptions extends StatelessWidget { bottom: box.maxHeight * 0.03, ), child: Column( - children: [ + children: [ ProfileInfoOptions( text: l10n.profileAccountText, icon: FpbIcons.profile, box: box, - ), + ), ProfileInfoOptions( text: l10n.profileSettingsText, icon: FpbIcons.setting, box: box, - ), + ), ProfileInfoOptions( text: l10n.profileNotificationsText, icon: Icons.notifications, box: box, - ), - ProfileInfoOptions( + ), + ProfileInfoOptions( text: l10n.profilePaymentMethodsText, icon: FpbIcons.credit_card, box: box, @@ -197,44 +177,43 @@ class UserProfileOptions extends StatelessWidget { } } -class UserPic extends StatelessWidget{ -const UserPic({ +class UserPic extends StatelessWidget { + const UserPic({ super.key, required this.box, }); -final BoxConstraints box; + final BoxConstraints box; @override Widget build(BuildContext context) { return Container( width: box.maxWidth, child: Stack( - alignment: Alignment(0.0, -1.5), - children: [ - Positioned( + alignment: Alignment(0.0, -1.5), + children: [ + Positioned( child: CircleAvatar( radius: box.maxHeight * 0.060, child: FlutterLogo(size: box.maxHeight * 0.1), ), ), - Positioned( - //top: 0, - right: box.maxWidth * .001, - child: IconButton( - onPressed: () { }, - icon: Icon( - FpbIcons.edit, - size: box.maxHeight * 0.028, + Positioned( + //top: 0, + right: box.maxWidth * .001, + child: IconButton( + onPressed: () {}, + icon: Icon( + FpbIcons.edit, + size: box.maxHeight * 0.028, ), ), - ), + ), ], ), ); } } - class UserName extends StatelessWidget { const UserName({ super.key, @@ -250,17 +229,15 @@ class UserName extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - 'John Merry', - style: style.titleMedium?.copyWith( - fontWeight: FontWeight.w600 - ), - ), - Text( - '@john.merry', - style: style.titleSmall, - ), - ], + Text( + 'John Merry', + style: style.titleMedium?.copyWith(fontWeight: FontWeight.w600), + ), + Text( + '@john.merry', + style: style.titleSmall, + ), + ], ); } } @@ -277,15 +254,13 @@ class TitleText extends StatelessWidget { @override Widget build(BuildContext context) { - // final l10n = context.l10n; + // final l10n = context.l10n; final theme = Theme.of(context); final style = theme.textTheme; return Text( l10n.profileTitle, style: style.displayLarge?.copyWith( - color: theme.colorScheme.secondary, - fontWeight: FontWeight.w600 - ), + color: theme.colorScheme.secondary, fontWeight: FontWeight.w600), ); } } diff --git a/lib/profile/view/widgets/profileInfoOptions.dart b/lib/profile/view/widgets/profileInfoOptions.dart index 2da0286..d2d8796 100644 --- a/lib/profile/view/widgets/profileInfoOptions.dart +++ b/lib/profile/view/widgets/profileInfoOptions.dart @@ -1,44 +1,40 @@ import 'package:flutter/material.dart'; class ProfileInfoOptions extends StatelessWidget { - const ProfileInfoOptions({ - super.key, - required this.box, - required this.icon, - required this.text - }); + const ProfileInfoOptions( + {super.key, required this.box, required this.icon, required this.text}); - final BoxConstraints box; - final String text; - final IconData icon; + final BoxConstraints box; + final String text; + final IconData icon; @override Widget build(BuildContext context) { //final l10n = context.l10n; final theme = Theme.of(context); final style = theme.textTheme; - + return Container( child: Padding( - padding: EdgeInsets.symmetric(vertical: box.maxHeight * .007), + padding: EdgeInsets.symmetric(vertical: box.maxHeight * .007), child: Row( children: [ IconButton( - onPressed: ( ){}, - icon: Icon( - icon, - color: theme.colorScheme.secondaryContainer, - )), - SizedBox( - width: box.maxWidth * .03, - ), - Text(text, - style: style.titleMedium?.copyWith( - fontWeight: FontWeight.w600 - ),) + onPressed: () {}, + icon: Icon( + icon, + color: theme.colorScheme.secondaryContainer, + )), + SizedBox( + width: box.maxWidth * .03, + ), + Text( + text, + style: style.titleMedium?.copyWith(fontWeight: FontWeight.w600), + ) ], ), ), ); } -} \ No newline at end of file +} diff --git a/lib/qr_code_screen/qr_code_screen.dart b/lib/qr_code_screen/qr_code_screen.dart index ffcd3fe..d7bfc35 100644 --- a/lib/qr_code_screen/qr_code_screen.dart +++ b/lib/qr_code_screen/qr_code_screen.dart @@ -1 +1 @@ -export 'view/qr_code_screen.dart'; \ No newline at end of file +export 'view/qr_code_screen.dart'; diff --git a/lib/qr_code_screen/view/qr_code_screen.dart b/lib/qr_code_screen/view/qr_code_screen.dart index fb1e6d2..9571bf8 100644 --- a/lib/qr_code_screen/view/qr_code_screen.dart +++ b/lib/qr_code_screen/view/qr_code_screen.dart @@ -130,9 +130,7 @@ class _QrCodeScreenState extends State child: Text( "Cancel", style: TextStyle( - color: Theme.of(context) - .colorScheme - .tertiary, + color: Theme.of(context).colorScheme.tertiary, fontSize: box.maxWidth * 0.05, ), textAlign: TextAlign.center, diff --git a/lib/qr_code_screen/view/widget/my_qrcode_widget.dart b/lib/qr_code_screen/view/widget/my_qrcode_widget.dart index fcaee2c..cd17d85 100644 --- a/lib/qr_code_screen/view/widget/my_qrcode_widget.dart +++ b/lib/qr_code_screen/view/widget/my_qrcode_widget.dart @@ -72,7 +72,10 @@ class MyQrCode extends StatelessWidget { child: Text( "@johndoe", style: TextStyle( - color: Theme.of(context).colorScheme.tertiary.withOpacity(0.5), + color: Theme.of(context) + .colorScheme + .tertiary + .withOpacity(0.5), fontSize: box.maxWidth * 0.04, fontWeight: FontWeight.normal, ), diff --git a/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart b/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart index 72d32f3..d61f3fe 100644 --- a/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart +++ b/lib/qr_code_screen/view/widget/scan_qrcode_widget.dart @@ -25,8 +25,7 @@ class ScanQrCodeWidget extends StatelessWidget { child: Text( "Scan a code", style: TextStyle( - color: - Theme.of(context).colorScheme.tertiary, + color: Theme.of(context).colorScheme.tertiary, fontSize: box.maxWidth * 0.056, ), textAlign: TextAlign.center, diff --git a/lib/router/app_route.gr.dart b/lib/router/app_route.gr.dart index 9eca0f9..0868fac 100644 --- a/lib/router/app_route.gr.dart +++ b/lib/router/app_route.gr.dart @@ -11,12 +11,12 @@ // ignore_for_file: type=lint // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i15; -import 'package:flutter/material.dart' as _i16; +import 'package:auto_route/auto_route.dart' as _i16; +import 'package:flutter/material.dart' as _i17; -import '../contact_us/view/contact_us_screen.dart' as _i11; -import '../contact_us/view/contact_us_success_screen.dart' as _i12; -import '../core/domain/user.dart' as _i17; +import '../contact_us/view/contact_us_screen.dart' as _i12; +import '../contact_us/view/contact_us_success_screen.dart' as _i13; +import '../core/domain/user.dart' as _i18; import '../email_confirmation/email_confirmation.dart' as _i4; import '../home/view/home_screen.dart' as _i8; import '../latest_activities/view/latest_activities_screen.dart' as _i9; @@ -25,51 +25,51 @@ import '../onboarding/view/splash_screen.dart' as _i1; import '../payment_methods/payment_method_screen.dart' as _i7; import '../phone_number_confirmation/view/phone_number_confirmation.dart' as _i3; -import '../profile/view/profile_page.dart' as _i14; -import '../qr_code_screen/view/qr_code_screen.dart' as _i9; +import '../profile/view/profile_page.dart' as _i15; +import '../qr_code_screen/view/qr_code_screen.dart' as _i10; import '../savings/save_money_with_bucket/save_money_with_bucket.dart' as _i6; -import '../savings/view/savings_page.dart' as _i13; +import '../savings/view/savings_page.dart' as _i14; import '../sign_in/view/sign_in_page.dart' as _i2; import '../sign_up/view/signup_page.dart' as _i5; -class AppRoute extends _i15.RootStackRouter { - AppRoute([_i16.GlobalKey<_i16.NavigatorState>? navigatorKey]) +class AppRoute extends _i16.RootStackRouter { + AppRoute([_i17.GlobalKey<_i17.NavigatorState>? navigatorKey]) : super(navigatorKey); @override - final Map pagesMap = { + final Map pagesMap = { SplashRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i1.SplashScreen(), ); }, SignInRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i2.SignInScreen(), ); }, PhoneNumberConfirmationRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i3.PhoneNumberConfirmationScreen(), ); }, EmailConfirmationRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i4.EmailConfirmationScreen(), ); }, SignUpRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i5.SignUpScreen(), ); }, SaveMoneyRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i6.SaveMoneyScreen(), ); @@ -82,7 +82,7 @@ class AppRoute extends _i15.RootStackRouter { }, HomeRouter.name: (routeData) { final args = routeData.argsAs(); - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: _i8.HomeScreen( key: args.key, @@ -91,13 +91,13 @@ class AppRoute extends _i15.RootStackRouter { ); }, LatestActivitiesPage.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i9.LatestActivitiesPage(), ); }, QrCodeRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i10.QrCodeScreen(), ); @@ -105,7 +105,7 @@ class AppRoute extends _i15.RootStackRouter { OnboardingRoute.name: (routeData) { final args = routeData.argsAs( orElse: () => const OnboardingRouteArgs()); - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: _i11.OnboardingScreen( onGetStartedPressed: args.onGetStartedPressed, @@ -114,90 +114,94 @@ class AppRoute extends _i15.RootStackRouter { ); }, ContactUsRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, child: const _i12.ContactUsScreen(), ); }, ContactUsSuccessRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, - child: const _i12.ContactUsSuccessScreen(), + child: const _i13.ContactUsSuccessScreen(), ); }, SavingsPage.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, - child: const _i13.SavingsPage(), + child: const _i14.SavingsPage(), ); }, ProfileRoute.name: (routeData) { - return _i15.MaterialPageX( + return _i16.MaterialPageX( routeData: routeData, - child: const _i14.ProfileScreen(), + child: const _i15.ProfileScreen(), ); }, }; @override - List<_i15.RouteConfig> get routes => [ - _i15.RouteConfig( + List<_i16.RouteConfig> get routes => [ + _i16.RouteConfig( SplashRoute.name, path: '/', ), - _i15.RouteConfig( + _i16.RouteConfig( SignInRoute.name, path: '/sign-in-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( PhoneNumberConfirmationRoute.name, path: '/phone-number-confirmation-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( EmailConfirmationRoute.name, path: '/email-confirmation-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( SignUpRoute.name, path: '/sign-up-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( SaveMoneyRoute.name, path: '/save-money-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( + PaymentMethodRoute.name, + path: '/payment-method-screen', + ), + _i16.RouteConfig( HomeRouter.name, path: '/home-screen', children: [ - _i15.RouteConfig( + _i16.RouteConfig( SavingsPage.name, path: 'savings', parent: HomeRouter.name, ), - _i15.RouteConfig( + _i16.RouteConfig( ProfileRoute.name, path: 'profile', parent: HomeRouter.name, ), ], ), - _i15.RouteConfig( + _i16.RouteConfig( LatestActivitiesPage.name, path: 'latestActivities', ), - _i15.RouteConfig( + _i16.RouteConfig( QrCodeRoute.name, path: '/qr-code-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( OnboardingRoute.name, path: '/onboarding-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( ContactUsRoute.name, path: '/contact-us-screen', ), - _i15.RouteConfig( + _i16.RouteConfig( ContactUsSuccessRoute.name, path: '/contact-us-success-screen', ), @@ -206,7 +210,7 @@ class AppRoute extends _i15.RootStackRouter { /// generated route for /// [_i1.SplashScreen] -class SplashRoute extends _i15.PageRouteInfo { +class SplashRoute extends _i16.PageRouteInfo { const SplashRoute() : super( SplashRoute.name, @@ -218,7 +222,7 @@ class SplashRoute extends _i15.PageRouteInfo { /// generated route for /// [_i2.SignInScreen] -class SignInRoute extends _i15.PageRouteInfo { +class SignInRoute extends _i16.PageRouteInfo { const SignInRoute() : super( SignInRoute.name, @@ -230,7 +234,7 @@ class SignInRoute extends _i15.PageRouteInfo { /// generated route for /// [_i3.PhoneNumberConfirmationScreen] -class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { +class PhoneNumberConfirmationRoute extends _i16.PageRouteInfo { const PhoneNumberConfirmationRoute() : super( PhoneNumberConfirmationRoute.name, @@ -242,7 +246,7 @@ class PhoneNumberConfirmationRoute extends _i15.PageRouteInfo { /// generated route for /// [_i4.EmailConfirmationScreen] -class EmailConfirmationRoute extends _i15.PageRouteInfo { +class EmailConfirmationRoute extends _i16.PageRouteInfo { const EmailConfirmationRoute() : super( EmailConfirmationRoute.name, @@ -254,7 +258,7 @@ class EmailConfirmationRoute extends _i15.PageRouteInfo { /// generated route for /// [_i5.SignUpScreen] -class SignUpRoute extends _i15.PageRouteInfo { +class SignUpRoute extends _i16.PageRouteInfo { const SignUpRoute() : super( SignUpRoute.name, @@ -266,7 +270,7 @@ class SignUpRoute extends _i15.PageRouteInfo { /// generated route for /// [_i6.SaveMoneyScreen] -class SaveMoneyRoute extends _i15.PageRouteInfo { +class SaveMoneyRoute extends _i16.PageRouteInfo { const SaveMoneyRoute() : super( SaveMoneyRoute.name, @@ -277,12 +281,24 @@ class SaveMoneyRoute extends _i15.PageRouteInfo { } /// generated route for -/// [_i7.HomeScreen] -class HomeRouter extends _i15.PageRouteInfo { +/// [_i7.PaymentMethodScreen] +class PaymentMethodRoute extends _i16.PageRouteInfo { + const PaymentMethodRoute() + : super( + PaymentMethodRoute.name, + path: '/payment-method-screen', + ); + + static const String name = 'PaymentMethodRoute'; +} + +/// generated route for +/// [_i8.HomeScreen] +class HomeRouter extends _i16.PageRouteInfo { HomeRouter({ - _i16.Key? key, - required _i17.User user, - List<_i15.PageRouteInfo>? children, + _i17.Key? key, + required _i18.User user, + List<_i16.PageRouteInfo>? children, }) : super( HomeRouter.name, path: '/home-screen', @@ -302,9 +318,9 @@ class HomeRouterArgs { required this.user, }); - final _i16.Key? key; + final _i17.Key? key; - final _i17.User user; + final _i18.User user; @override String toString() { @@ -313,8 +329,8 @@ class HomeRouterArgs { } /// generated route for -/// [_i8.LatestActivitiesPage] -class LatestActivitiesPage extends _i15.PageRouteInfo { +/// [_i9.LatestActivitiesPage] +class LatestActivitiesPage extends _i16.PageRouteInfo { const LatestActivitiesPage() : super( LatestActivitiesPage.name, @@ -325,8 +341,8 @@ class LatestActivitiesPage extends _i15.PageRouteInfo { } /// generated route for -/// [_i9.QrCodeScreen] -class QrCodeRoute extends _i15.PageRouteInfo { +/// [_i10.QrCodeScreen] +class QrCodeRoute extends _i16.PageRouteInfo { const QrCodeRoute() : super( QrCodeRoute.name, @@ -337,11 +353,11 @@ class QrCodeRoute extends _i15.PageRouteInfo { } /// generated route for -/// [_i10.OnboardingScreen] -class OnboardingRoute extends _i15.PageRouteInfo { +/// [_i11.OnboardingScreen] +class OnboardingRoute extends _i16.PageRouteInfo { OnboardingRoute({ void Function()? onGetStartedPressed, - _i16.Key? key, + _i17.Key? key, }) : super( OnboardingRoute.name, path: '/onboarding-screen', @@ -362,7 +378,7 @@ class OnboardingRouteArgs { final void Function()? onGetStartedPressed; - final _i16.Key? key; + final _i17.Key? key; @override String toString() { @@ -371,8 +387,8 @@ class OnboardingRouteArgs { } /// generated route for -/// [_i11.ContactUsScreen] -class ContactUsRoute extends _i15.PageRouteInfo { +/// [_i12.ContactUsScreen] +class ContactUsRoute extends _i16.PageRouteInfo { const ContactUsRoute() : super( ContactUsRoute.name, @@ -383,8 +399,8 @@ class ContactUsRoute extends _i15.PageRouteInfo { } /// generated route for -/// [_i12.ContactUsSuccessScreen] -class ContactUsSuccessRoute extends _i15.PageRouteInfo { +/// [_i13.ContactUsSuccessScreen] +class ContactUsSuccessRoute extends _i16.PageRouteInfo { const ContactUsSuccessRoute() : super( ContactUsSuccessRoute.name, @@ -395,8 +411,8 @@ class ContactUsSuccessRoute extends _i15.PageRouteInfo { } /// generated route for -/// [_i13.SavingsPage] -class SavingsPage extends _i15.PageRouteInfo { +/// [_i14.SavingsPage] +class SavingsPage extends _i16.PageRouteInfo { const SavingsPage() : super( SavingsPage.name, @@ -407,8 +423,8 @@ class SavingsPage extends _i15.PageRouteInfo { } /// generated route for -/// [_i14.ProfileScreen] -class ProfileRoute extends _i15.PageRouteInfo { +/// [_i15.ProfileScreen] +class ProfileRoute extends _i16.PageRouteInfo { const ProfileRoute() : super( ProfileRoute.name, diff --git a/lib/savings/view/savings_page.dart b/lib/savings/view/savings_page.dart index f033fa5..970a618 100644 --- a/lib/savings/view/savings_page.dart +++ b/lib/savings/view/savings_page.dart @@ -16,7 +16,6 @@ class SavingsPage extends StatefulWidget { } class _SavingsPageState extends State { - @override Widget build(BuildContext context) { final l10n = context.l10n; diff --git a/lib/sign_in/view/sign_in_page.dart b/lib/sign_in/view/sign_in_page.dart index ca8c867..017bb1b 100644 --- a/lib/sign_in/view/sign_in_page.dart +++ b/lib/sign_in/view/sign_in_page.dart @@ -221,7 +221,10 @@ class _SignInBodyState extends State ), TextButton( onPressed: () { - context.router.push(SignUpRoute()); + // context.router.push(SignUpRoute()); + + // test + context.router.push(OnboardingRoute()); }, child: Text( l10n.signInSignUpLabel, From dccb557598adeace0c13dc251802bf249a58ec73 Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Thu, 23 Mar 2023 13:21:05 +0100 Subject: [PATCH 26/28] fix: slider indication icons for each onboarding slide --- lib/onboarding/view/widgets/my_stepper.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/onboarding/view/widgets/my_stepper.dart b/lib/onboarding/view/widgets/my_stepper.dart index 077faeb..60fdb10 100644 --- a/lib/onboarding/view/widgets/my_stepper.dart +++ b/lib/onboarding/view/widgets/my_stepper.dart @@ -19,8 +19,9 @@ class MyStepper extends StatelessWidget { return LayoutBuilder( builder: (context, cts) { return Container( - padding: const EdgeInsets.only(top: 10), + padding: const EdgeInsets.symmetric(vertical: 5), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [const Spacer()] + [ ...List.generate(length - 1, (_) => StepDot(cts: cts)) @@ -50,7 +51,9 @@ class StepBar extends StatelessWidget { width: cts.maxWidth * 0.08, decoration: BoxDecoration( color: Theme.of(context).colorScheme.secondary, - borderRadius: BorderRadius.all(Radius.circular(5)), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), ), ), ), @@ -74,7 +77,7 @@ class StepDot extends StatelessWidget { height: cts.maxWidth * 0.027, width: cts.maxWidth * 0.027, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.onSurface, + color: Theme.of(context).colorScheme.onBackground, borderRadius: const BorderRadius.all(Radius.circular(5)), ), ), From 7e9ec217b2e5a71d192d53a9859ae0ff55b691fa Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 24 Mar 2023 08:46:12 +0100 Subject: [PATCH 27/28] fix design adjustment to match figma design --- lib/core/presentation/widget/fpb_button.dart | 4 ++-- lib/onboarding/view/onboarding_screens.dart | 25 +++++++------------- lib/onboarding/view/widgets/actions.dart | 9 ++++++- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/core/presentation/widget/fpb_button.dart b/lib/core/presentation/widget/fpb_button.dart index 14c0a2d..6e75db0 100644 --- a/lib/core/presentation/widget/fpb_button.dart +++ b/lib/core/presentation/widget/fpb_button.dart @@ -61,10 +61,10 @@ class FpbButton extends StatelessWidget { ), style: ButtonStyle( backgroundColor: - MaterialStateProperty.all(backgroundColor ?? colors.error), + MaterialStateProperty.all(backgroundColor ?? colors.primary), side: MaterialStateProperty.all( BorderSide( - color: borderSideColor ?? colors.error, + color: borderSideColor ?? colors.primary, width: 1.0, style: BorderStyle.solid), ), diff --git a/lib/onboarding/view/onboarding_screens.dart b/lib/onboarding/view/onboarding_screens.dart index 15345a2..012ceb2 100644 --- a/lib/onboarding/view/onboarding_screens.dart +++ b/lib/onboarding/view/onboarding_screens.dart @@ -10,6 +10,7 @@ class OnboardingScreen extends HookWidget { const OnboardingScreen({this.onGetStartedPressed, super.key}); static const routeName = '/getStarted'; final void Function()? onGetStartedPressed; + @override Widget build(BuildContext context) { final l10n = context.l10n; @@ -45,23 +46,15 @@ class OnboardingScreen extends HookWidget { ..currentIndex = currentIndex; return Scaffold( - body: GestureDetector( - onPanUpdate: (details) async { - // Swiping in right direction. -> Back - const sensitivity = 12; - if (details.delta.dx > sensitivity) { - if (currentIndex.value - 1 >= 0) { - currentIndex.value -= 1; - } - } - // Swiping in left direction.-> Forward - if (details.delta.dx < -sensitivity) { - if (currentIndex.value + 1 < listIllustration.length) { - currentIndex.value += 1; - } - } + body: PageView.builder( + scrollDirection: Axis.horizontal, + onPageChanged: (value) { + currentIndex.value = value; + }, + itemCount: listIllustration.length, + itemBuilder: (context, index) { + return illustration; }, - child: illustration, ), ); } diff --git a/lib/onboarding/view/widgets/actions.dart b/lib/onboarding/view/widgets/actions.dart index 428d76e..35079c5 100644 --- a/lib/onboarding/view/widgets/actions.dart +++ b/lib/onboarding/view/widgets/actions.dart @@ -22,6 +22,7 @@ class Actions extends StatelessWidget { final l10n = context.l10n; final theme = Theme.of(context); final textTheme = theme.textTheme; + final colors = theme.colorScheme; return Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -41,7 +42,13 @@ class Actions extends StatelessWidget { onTap: onNextPressed, width: isLastPage ? cts.maxWidth * 0.65 : cts.maxWidth * 0.6, height: cts.maxHeight * 0.07, - trailing: !isLastPage ? Icon(FpbIcons.arrow_right) : null, + trailing: !isLastPage + ? Icon( + FpbIcons.arrow_right, + size: cts.maxHeight * 0.02, + color: colors.background, + ) + : null, ) ], ); From 8b6475fce92f05aa8847689f9be0439508aed1dd Mon Sep 17 00:00:00 2001 From: DesmondTambe Date: Fri, 24 Mar 2023 09:35:15 +0100 Subject: [PATCH 28/28] fix: revert change for testing in signInPage --- lib/sign_in/view/sign_in_page.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/sign_in/view/sign_in_page.dart b/lib/sign_in/view/sign_in_page.dart index 017bb1b..ca8c867 100644 --- a/lib/sign_in/view/sign_in_page.dart +++ b/lib/sign_in/view/sign_in_page.dart @@ -221,10 +221,7 @@ class _SignInBodyState extends State ), TextButton( onPressed: () { - // context.router.push(SignUpRoute()); - - // test - context.router.push(OnboardingRoute()); + context.router.push(SignUpRoute()); }, child: Text( l10n.signInSignUpLabel,