From b6ea40890de4d29b4bf1fa3b0512942ca3669f7f Mon Sep 17 00:00:00 2001 From: DreXuri Date: Wed, 27 Sep 2023 18:00:17 +0100 Subject: [PATCH 1/4] custom app bar added --- .../common/custom_appbar/custom_appbar.dart | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 lib/ui/widgets/common/custom_appbar/custom_appbar.dart diff --git a/lib/ui/widgets/common/custom_appbar/custom_appbar.dart b/lib/ui/widgets/common/custom_appbar/custom_appbar.dart new file mode 100644 index 0000000..ea89abf --- /dev/null +++ b/lib/ui/widgets/common/custom_appbar/custom_appbar.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:receipe_app/ui/common/app_colors.dart'; +import 'package:receipe_app/ui/common/app_images.dart'; +import 'package:receipe_app/ui/extension/app_typography.dart'; +import 'package:receipe_app/ui/extension/palette.dart'; + +PreferredSizeWidget +customAppBar( + BuildContext context, { + String titleText = '', + String leadText = '', + VoidCallback? onTap, + String text = '', + Widget? title, + double elevation = 0, + double? fontSize, + double? titleSpacing, + bool automaticallyImplyLeading = true, + Widget? leading, + Color? backgroundColor, + IconThemeData? iconThemeData, + TabBar? bottom, + List? action, + bool hasLeading = true, + VoidCallback? onBackTap, + double preferredSize = 56.0, + bool centerTitle = true, + Color? titleColor, + FontWeight? fontWeight = FontWeight.bold, +}) { + ThemeData theme = Theme.of(context); + AppTypography? typography = theme.extension(); + Palette? palette = theme.extension(); + return AppBar( + backgroundColor: kcBackground, + elevation: 0, + leading: InkWell( + onTap: onTap ?? + () { + + // TODO open drawer + Drawer(); + }, + child: leading ?? + SizedBox( + height: 30, + width: 30, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: EdgeInsets.only( + left: 25.0.w, + top: 8.h, + ), + child: SvgPicture.asset( + AppImages.burgerLog, + width: 24.7.w, + height: 24.h, + + ), + ), + ), + ), + ), + title: Padding( + padding: EdgeInsets.only(top: 5.0.h), + child: title ?? + Text( + titleText, + style: + typography?.titleBold16?.copyWith(color: palette?.gray11), + ), + )) + ; + } From 0c0d1de4c5de5e6ce8810b96280f6683279f55c5 Mon Sep 17 00:00:00 2001 From: DreXuri Date: Thu, 28 Sep 2023 17:17:33 +0100 Subject: [PATCH 2/4] sync code --- lib/ui/views/homepage/homepage_view.dart | 104 ++++++++++++++++++ .../common/custom_appbar/custom_appbar.dart | 77 ------------- pubspec.lock | 34 +++--- 3 files changed, 125 insertions(+), 90 deletions(-) create mode 100644 lib/ui/views/homepage/homepage_view.dart delete mode 100644 lib/ui/widgets/common/custom_appbar/custom_appbar.dart diff --git a/lib/ui/views/homepage/homepage_view.dart b/lib/ui/views/homepage/homepage_view.dart new file mode 100644 index 0000000..3744754 --- /dev/null +++ b/lib/ui/views/homepage/homepage_view.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:receipe_app/ui/common/app_colors.dart'; +import 'package:receipe_app/ui/common/app_images.dart'; +import 'package:receipe_app/ui/common/ui_helpers.dart'; +import 'package:receipe_app/ui/extension/app_typography.dart'; +import 'package:receipe_app/ui/extension/palette.dart'; +import 'package:receipe_app/ui/views/homepage/widgets/no_product_screen.dart'; +import 'package:receipe_app/ui/views/homepage/widgets/product_item.dart'; +import 'package:stacked/stacked.dart'; + +import 'homepage_viewmodel.dart'; + +class HomepageView extends StackedView { + const HomepageView({Key? key}) : super(key: key); + + @override + Widget builder( + BuildContext context, + HomepageViewModel viewModel, + Widget? child, + ) { + ThemeData theme = Theme.of(context); + AppTypography? typography = theme.extension(); + Palette? palette = theme.extension(); + return Scaffold( + // appBar: customAppBar(context, titleText: 'Home'), + appBar: AppBar( + backgroundColor: kcBackground, + elevation: 0, + leading: InkWell( + onTap: () { + // TODO open drawer + Drawer(); + }, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: EdgeInsets.only( + left: 16.w, + top: 8.h, + ), + child: SvgPicture.asset( + AppImages.burgerLog, + width: 24.7.w, + height: 24.h, + ), + ), + )), + title: Padding( + padding: EdgeInsets.only(top: 12.0.h, left: 105.w), + child: Text( + 'Home', + style: typography?.titleBold16?.copyWith(color: palette?.gray11), + ), + )), + body: SafeArea( + child: Column( + children: [ + SizedBox( + height: 18.h, + ), + Expanded( + child: SizedBox( + child: GridView.builder( + padding: EdgeInsets.symmetric(horizontal: sidePadding), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: 0.67.h, + mainAxisSpacing: 20.h, + crossAxisSpacing: 16.w, + mainAxisExtent: 252.h, + ), + itemCount: viewModel.productItems.length, + itemBuilder: (context, index) { + if (viewModel.productItems.isEmpty) { + return NoDataFoundWidget(); + } + return ProductItem( + productModel: viewModel.productItems[index], + ); + }, + )), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { +//TODO route to add product + }, + backgroundColor: AppColors.primary6, + child: SvgPicture.asset(AppImages.addcon), + ), + ); + } + + @override + HomepageViewModel viewModelBuilder( + BuildContext context, + ) => + HomepageViewModel(); +} diff --git a/lib/ui/widgets/common/custom_appbar/custom_appbar.dart b/lib/ui/widgets/common/custom_appbar/custom_appbar.dart deleted file mode 100644 index ea89abf..0000000 --- a/lib/ui/widgets/common/custom_appbar/custom_appbar.dart +++ /dev/null @@ -1,77 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:receipe_app/ui/common/app_colors.dart'; -import 'package:receipe_app/ui/common/app_images.dart'; -import 'package:receipe_app/ui/extension/app_typography.dart'; -import 'package:receipe_app/ui/extension/palette.dart'; - -PreferredSizeWidget -customAppBar( - BuildContext context, { - String titleText = '', - String leadText = '', - VoidCallback? onTap, - String text = '', - Widget? title, - double elevation = 0, - double? fontSize, - double? titleSpacing, - bool automaticallyImplyLeading = true, - Widget? leading, - Color? backgroundColor, - IconThemeData? iconThemeData, - TabBar? bottom, - List? action, - bool hasLeading = true, - VoidCallback? onBackTap, - double preferredSize = 56.0, - bool centerTitle = true, - Color? titleColor, - FontWeight? fontWeight = FontWeight.bold, -}) { - ThemeData theme = Theme.of(context); - AppTypography? typography = theme.extension(); - Palette? palette = theme.extension(); - return AppBar( - backgroundColor: kcBackground, - elevation: 0, - leading: InkWell( - onTap: onTap ?? - () { - - // TODO open drawer - Drawer(); - }, - child: leading ?? - SizedBox( - height: 30, - width: 30, - child: Align( - alignment: Alignment.center, - child: Padding( - padding: EdgeInsets.only( - left: 25.0.w, - top: 8.h, - ), - child: SvgPicture.asset( - AppImages.burgerLog, - width: 24.7.w, - height: 24.h, - - ), - ), - ), - ), - ), - title: Padding( - padding: EdgeInsets.only(top: 5.0.h), - child: title ?? - Text( - titleText, - style: - typography?.titleBold16?.copyWith(color: palette?.gray11), - ), - )) - ; - } diff --git a/pubspec.lock b/pubspec.lock index a0eeb55..19ffb69 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -141,10 +141,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" convert: dependency: transitive description: @@ -308,10 +308,10 @@ packages: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" + version: "0.18.1" io: dependency: transitive description: @@ -364,18 +364,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -513,10 +513,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -593,10 +593,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" timing: dependency: transitive description: @@ -661,6 +661,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -686,5 +694,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.3 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.0" From 47d44744c165451e40ad543122c995d3983851f3 Mon Sep 17 00:00:00 2001 From: DreXuri Date: Fri, 29 Sep 2023 16:12:40 +0100 Subject: [PATCH 3/4] home changes --- lib/ui/views/homepage/homepage_view.dart | 104 ----------------------- 1 file changed, 104 deletions(-) delete mode 100644 lib/ui/views/homepage/homepage_view.dart diff --git a/lib/ui/views/homepage/homepage_view.dart b/lib/ui/views/homepage/homepage_view.dart deleted file mode 100644 index 3744754..0000000 --- a/lib/ui/views/homepage/homepage_view.dart +++ /dev/null @@ -1,104 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:receipe_app/ui/common/app_colors.dart'; -import 'package:receipe_app/ui/common/app_images.dart'; -import 'package:receipe_app/ui/common/ui_helpers.dart'; -import 'package:receipe_app/ui/extension/app_typography.dart'; -import 'package:receipe_app/ui/extension/palette.dart'; -import 'package:receipe_app/ui/views/homepage/widgets/no_product_screen.dart'; -import 'package:receipe_app/ui/views/homepage/widgets/product_item.dart'; -import 'package:stacked/stacked.dart'; - -import 'homepage_viewmodel.dart'; - -class HomepageView extends StackedView { - const HomepageView({Key? key}) : super(key: key); - - @override - Widget builder( - BuildContext context, - HomepageViewModel viewModel, - Widget? child, - ) { - ThemeData theme = Theme.of(context); - AppTypography? typography = theme.extension(); - Palette? palette = theme.extension(); - return Scaffold( - // appBar: customAppBar(context, titleText: 'Home'), - appBar: AppBar( - backgroundColor: kcBackground, - elevation: 0, - leading: InkWell( - onTap: () { - // TODO open drawer - Drawer(); - }, - child: Align( - alignment: Alignment.center, - child: Padding( - padding: EdgeInsets.only( - left: 16.w, - top: 8.h, - ), - child: SvgPicture.asset( - AppImages.burgerLog, - width: 24.7.w, - height: 24.h, - ), - ), - )), - title: Padding( - padding: EdgeInsets.only(top: 12.0.h, left: 105.w), - child: Text( - 'Home', - style: typography?.titleBold16?.copyWith(color: palette?.gray11), - ), - )), - body: SafeArea( - child: Column( - children: [ - SizedBox( - height: 18.h, - ), - Expanded( - child: SizedBox( - child: GridView.builder( - padding: EdgeInsets.symmetric(horizontal: sidePadding), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - childAspectRatio: 0.67.h, - mainAxisSpacing: 20.h, - crossAxisSpacing: 16.w, - mainAxisExtent: 252.h, - ), - itemCount: viewModel.productItems.length, - itemBuilder: (context, index) { - if (viewModel.productItems.isEmpty) { - return NoDataFoundWidget(); - } - return ProductItem( - productModel: viewModel.productItems[index], - ); - }, - )), - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { -//TODO route to add product - }, - backgroundColor: AppColors.primary6, - child: SvgPicture.asset(AppImages.addcon), - ), - ); - } - - @override - HomepageViewModel viewModelBuilder( - BuildContext context, - ) => - HomepageViewModel(); -} From 207cdd090eabc9f72cce21351e645ca9270c81c0 Mon Sep 17 00:00:00 2001 From: DreXuri Date: Fri, 29 Sep 2023 17:05:13 +0100 Subject: [PATCH 4/4] implementing my dish ui --- lib/app/app.dart | 2 + lib/app/app.router.dart | 55 +++++++++++++++++-- lib/ui/views/login/login_view.dart | 2 +- .../my_dish_screen/my_dish_screen_view.dart | 28 ++++++++++ .../my_dish_screen_viewmodel.dart | 3 + lib/ui/views/signup/signup_view.dart | 27 +++++---- .../my_dish_screen_viewmodel_test.dart | 11 ++++ 7 files changed, 107 insertions(+), 21 deletions(-) create mode 100644 lib/ui/views/my_dish_screen/my_dish_screen_view.dart create mode 100644 lib/ui/views/my_dish_screen/my_dish_screen_viewmodel.dart create mode 100644 test/viewmodels/my_dish_screen_viewmodel_test.dart diff --git a/lib/app/app.dart b/lib/app/app.dart index baee81f..00138b3 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -9,6 +9,7 @@ import '../ui/views/startup/startup_view.dart'; import 'package:receipe_app/ui/views/onboarding/onboarding_view.dart'; import 'package:receipe_app/ui/views/login/login_view.dart'; import 'package:receipe_app/ui/views/signup/signup_view.dart'; +import 'package:receipe_app/ui/views/my_dish_screen/my_dish_screen_view.dart'; // @stacked-import @StackedApp( @@ -18,6 +19,7 @@ import 'package:receipe_app/ui/views/signup/signup_view.dart'; AdaptiveRoute(page: OnboardingView), AdaptiveRoute(page: LoginView), AdaptiveRoute(page: SignupView), + AdaptiveRoute(page: MyDishScreenView), // @stacked-route ], dependencies: [ diff --git a/lib/app/app.router.dart b/lib/app/app.router.dart index be8ec35..9272f19 100644 --- a/lib/app/app.router.dart +++ b/lib/app/app.router.dart @@ -5,15 +5,17 @@ // ************************************************************************** // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:flutter/material.dart' as _i7; +import 'package:flutter/material.dart' as _i8; import 'package:flutter/material.dart'; import 'package:receipe_app/ui/views/home/home_view.dart' as _i2; import 'package:receipe_app/ui/views/login/login_view.dart' as _i5; +import 'package:receipe_app/ui/views/my_dish_screen/my_dish_screen_view.dart' + as _i7; import 'package:receipe_app/ui/views/onboarding/onboarding_view.dart' as _i4; import 'package:receipe_app/ui/views/signup/signup_view.dart' as _i6; import 'package:receipe_app/ui/views/startup/startup_view.dart' as _i3; import 'package:stacked/stacked.dart' as _i1; -import 'package:stacked_services/stacked_services.dart' as _i8; +import 'package:stacked_services/stacked_services.dart' as _i9; class Routes { static const homeView = '/home-view'; @@ -26,12 +28,15 @@ class Routes { static const signupView = '/signup-view'; + static const myDishScreenView = '/my-dish-screen-view'; + static const all = { homeView, startupView, onboardingView, loginView, signupView, + myDishScreenView, }; } @@ -57,6 +62,10 @@ class StackedRouter extends _i1.RouterBase { Routes.signupView, page: _i6.SignupView, ), + _i1.RouteDef( + Routes.myDishScreenView, + page: _i7.MyDishScreenView, + ), ]; final _pagesMap = { @@ -93,6 +102,12 @@ class StackedRouter extends _i1.RouterBase { settings: data, ); }, + _i7.MyDishScreenView: (data) { + return _i8.MaterialPageRoute( + builder: (context) => const _i7.MyDishScreenView(), + settings: data, + ); + }, }; @override @@ -104,7 +119,7 @@ class StackedRouter extends _i1.RouterBase { class LoginViewArguments { const LoginViewArguments({this.key}); - final _i7.Key? key; + final _i8.Key? key; @override String toString() { @@ -123,7 +138,7 @@ class LoginViewArguments { } } -extension NavigatorStateExtension on _i8.NavigationService { +extension NavigatorStateExtension on _i9.NavigationService { Future navigateToHomeView([ int? routerId, bool preventDuplicates = true, @@ -167,7 +182,7 @@ extension NavigatorStateExtension on _i8.NavigationService { } Future navigateToLoginView({ - _i7.Key? key, + _i8.Key? key, int? routerId, bool preventDuplicates = true, Map? parameters, @@ -196,6 +211,20 @@ extension NavigatorStateExtension on _i8.NavigationService { transition: transition); } + Future navigateToMyDishScreenView([ + int? routerId, + bool preventDuplicates = true, + Map? parameters, + Widget Function(BuildContext, Animation, Animation, Widget)? + transition, + ]) async { + return navigateTo(Routes.myDishScreenView, + id: routerId, + preventDuplicates: preventDuplicates, + parameters: parameters, + transition: transition); + } + Future replaceWithHomeView([ int? routerId, bool preventDuplicates = true, @@ -239,7 +268,7 @@ extension NavigatorStateExtension on _i8.NavigationService { } Future replaceWithLoginView({ - _i7.Key? key, + _i8.Key? key, int? routerId, bool preventDuplicates = true, Map? parameters, @@ -267,4 +296,18 @@ extension NavigatorStateExtension on _i8.NavigationService { parameters: parameters, transition: transition); } + + Future replaceWithMyDishScreenView([ + int? routerId, + bool preventDuplicates = true, + Map? parameters, + Widget Function(BuildContext, Animation, Animation, Widget)? + transition, + ]) async { + return replaceWith(Routes.myDishScreenView, + id: routerId, + preventDuplicates: preventDuplicates, + parameters: parameters, + transition: transition); + } } diff --git a/lib/ui/views/login/login_view.dart b/lib/ui/views/login/login_view.dart index 3f87c38..015300e 100644 --- a/lib/ui/views/login/login_view.dart +++ b/lib/ui/views/login/login_view.dart @@ -74,7 +74,7 @@ class LoginView extends StackedView with $LoginView { autofillHints: const [AutofillHints.email], keyboardType: TextInputType.emailAddress, validator: Validation.validateEmail, - decoration: InputDecoration( + decoration: InputDecoration( labelText: S.current.email_address, hintText: S.current.enter_your_email, ), diff --git a/lib/ui/views/my_dish_screen/my_dish_screen_view.dart b/lib/ui/views/my_dish_screen/my_dish_screen_view.dart new file mode 100644 index 0000000..b66cf66 --- /dev/null +++ b/lib/ui/views/my_dish_screen/my_dish_screen_view.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'my_dish_screen_viewmodel.dart'; + +class MyDishScreenView extends StackedView { + const MyDishScreenView({Key? key}) : super(key: key); + + @override + Widget builder( + BuildContext context, + MyDishScreenViewModel viewModel, + Widget? child, + ) { + return Scaffold( + backgroundColor: Theme.of(context).colorScheme.background, + body: Container( + padding: const EdgeInsets.only(left: 25.0, right: 25.0), + ), + ); + } + + @override + MyDishScreenViewModel viewModelBuilder( + BuildContext context, + ) => + MyDishScreenViewModel(); +} diff --git a/lib/ui/views/my_dish_screen/my_dish_screen_viewmodel.dart b/lib/ui/views/my_dish_screen/my_dish_screen_viewmodel.dart new file mode 100644 index 0000000..1c0cafb --- /dev/null +++ b/lib/ui/views/my_dish_screen/my_dish_screen_viewmodel.dart @@ -0,0 +1,3 @@ +import 'package:stacked/stacked.dart'; + +class MyDishScreenViewModel extends BaseViewModel {} diff --git a/lib/ui/views/signup/signup_view.dart b/lib/ui/views/signup/signup_view.dart index e354b86..ff3e4b7 100644 --- a/lib/ui/views/signup/signup_view.dart +++ b/lib/ui/views/signup/signup_view.dart @@ -20,7 +20,6 @@ import 'signup_viewmodel.dart'; FormTextField(name: 'email'), FormTextField(name: 'password'), ]) - class SignupView extends StackedView with $SignupView { const SignupView({Key? key}) : super(key: key); @@ -32,7 +31,7 @@ class SignupView extends StackedView with $SignupView { SignupViewModel viewModel, Widget? child, ) { - final ThemeData theme = Theme.of(context); + final ThemeData theme = Theme.of(context); final AppTypography? typography = theme.extension(); final Palette? palette = theme.extension(); return Scaffold( @@ -77,10 +76,10 @@ class SignupView extends StackedView with $SignupView { focusNode: firstNameFocusNode, validator: Validation.validateField, textInputAction: TextInputAction.next, - decoration: InputDecoration( - labelText: S.current.first_name, - hintText: S.current.enter_your_first_name, - ), + decoration: InputDecoration( + labelText: S.current.first_name, + hintText: S.current.enter_your_first_name, + ), ), SizedBox( height: 16.h, @@ -90,10 +89,10 @@ class SignupView extends StackedView with $SignupView { focusNode: lastNameFocusNode, validator: Validation.validateField, textInputAction: TextInputAction.next, - decoration: InputDecoration( - labelText: S.current.last_name, - hintText: S.current.enter_your_last_name, - ), + decoration: InputDecoration( + labelText: S.current.last_name, + hintText: S.current.enter_your_last_name, + ), ), SizedBox( height: 16.h, @@ -105,8 +104,8 @@ class SignupView extends StackedView with $SignupView { keyboardType: TextInputType.emailAddress, textInputAction: TextInputAction.next, validator: Validation.validateEmail, - decoration: InputDecoration( - labelText: S.current.email_address, + decoration: InputDecoration( + labelText: S.current.email_address, hintText: S.current.enter_your_email), ), SizedBox( @@ -116,7 +115,7 @@ class SignupView extends StackedView with $SignupView { controller: passwordController, focusNode: passwordFocusNode, obscureText: viewModel.hidePassword, - textInputAction: TextInputAction.done, + textInputAction: TextInputAction.done, validator: Validation.validateField, decoration: InputDecoration( labelText: S.current.password, @@ -167,7 +166,7 @@ class SignupView extends StackedView with $SignupView { ); } - @override + @override void onViewModelReady(SignupViewModel viewModel) { syncFormWithViewModel(viewModel); } diff --git a/test/viewmodels/my_dish_screen_viewmodel_test.dart b/test/viewmodels/my_dish_screen_viewmodel_test.dart new file mode 100644 index 0000000..f78b4d1 --- /dev/null +++ b/test/viewmodels/my_dish_screen_viewmodel_test.dart @@ -0,0 +1,11 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:receipe_app/app/app.locator.dart'; + +import '../helpers/test_helpers.dart'; + +void main() { + group('MyDishScreenViewModel Tests -', () { + setUp(() => registerServices()); + tearDown(() => locator.reset()); + }); +}