Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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: [
Expand Down
55 changes: 49 additions & 6 deletions lib/app/app.router.dart

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

2 changes: 1 addition & 1 deletion lib/ui/views/login/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class LoginView extends StackedView<LoginViewModel> 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,
),
Expand Down
28 changes: 28 additions & 0 deletions lib/ui/views/my_dish_screen/my_dish_screen_view.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';

import 'my_dish_screen_viewmodel.dart';

class MyDishScreenView extends StackedView<MyDishScreenViewModel> {
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();
}
3 changes: 3 additions & 0 deletions lib/ui/views/my_dish_screen/my_dish_screen_viewmodel.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:stacked/stacked.dart';

class MyDishScreenViewModel extends BaseViewModel {}
27 changes: 13 additions & 14 deletions lib/ui/views/signup/signup_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import 'signup_viewmodel.dart';
FormTextField(name: 'email'),
FormTextField(name: 'password'),
])

class SignupView extends StackedView<SignupViewModel> with $SignupView {
const SignupView({Key? key}) : super(key: key);

Expand All @@ -32,7 +31,7 @@ class SignupView extends StackedView<SignupViewModel> with $SignupView {
SignupViewModel viewModel,
Widget? child,
) {
final ThemeData theme = Theme.of(context);
final ThemeData theme = Theme.of(context);
final AppTypography? typography = theme.extension<AppTypography>();
final Palette? palette = theme.extension<Palette>();
return Scaffold(
Expand Down Expand Up @@ -77,10 +76,10 @@ class SignupView extends StackedView<SignupViewModel> 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,
Expand All @@ -90,10 +89,10 @@ class SignupView extends StackedView<SignupViewModel> 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,
Expand All @@ -105,8 +104,8 @@ class SignupView extends StackedView<SignupViewModel> 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(
Expand All @@ -116,7 +115,7 @@ class SignupView extends StackedView<SignupViewModel> with $SignupView {
controller: passwordController,
focusNode: passwordFocusNode,
obscureText: viewModel.hidePassword,
textInputAction: TextInputAction.done,
textInputAction: TextInputAction.done,
validator: Validation.validateField,
decoration: InputDecoration(
labelText: S.current.password,
Expand Down Expand Up @@ -167,7 +166,7 @@ class SignupView extends StackedView<SignupViewModel> with $SignupView {
);
}

@override
@override
void onViewModelReady(SignupViewModel viewModel) {
syncFormWithViewModel(viewModel);
}
Expand Down
34 changes: 21 additions & 13 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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"
11 changes: 11 additions & 0 deletions test/viewmodels/my_dish_screen_viewmodel_test.dart
Original file line number Diff line number Diff line change
@@ -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());
});
}