tab navigation
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
import 'package:auth/auth.dart';
|
||||
import 'package:dashboard_shell/dashboard_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
late GoRouter appRouter;
|
||||
|
||||
void configureAppRouter() {
|
||||
appRouter = GoRouter(
|
||||
navigatorKey: navigatorKey,
|
||||
initialLocation: '/login',
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/onboarding',
|
||||
pageBuilder: (context, state) =>
|
||||
OnboardingBuilder().buildPage(context, state),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/link_phone',
|
||||
pageBuilder: (context, state) =>
|
||||
LinkPhoneBuilder().buildPage(context, state),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/phone_code',
|
||||
pageBuilder: (context, state) =>
|
||||
PhoneCodeBuilder().buildPage(context, state),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/login',
|
||||
pageBuilder: (context, state) =>
|
||||
LoginBuilder().buildPage(context, state),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/recover_password',
|
||||
pageBuilder: (context, state) =>
|
||||
RecoverPasswordBuilder().buildPage(context, state),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/dashboard_shell',
|
||||
pageBuilder: (context, state) =>
|
||||
DashboardBuilder().buildPage(context, state),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
GetIt.I<NavigationContract>().setRouter(appRouter);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:sf_app_platform/app_router_config.dart';
|
||||
import 'package:sf_app_platform/navigation/app_router.dart';
|
||||
import 'package:navigation/navigation_module.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
|
||||
94
apps/mobile_app/lib/navigation/app_router.dart
Normal file
94
apps/mobile_app/lib/navigation/app_router.dart
Normal file
@@ -0,0 +1,94 @@
|
||||
import 'package:auth/auth.dart';
|
||||
import 'package:dashboard_shell/dashboard_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:home/home.dart';
|
||||
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
import 'package:profile/profile.dart';
|
||||
|
||||
final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
|
||||
|
||||
late final GoRouter appRouter;
|
||||
|
||||
void configureAppRouter() {
|
||||
appRouter = GoRouter(
|
||||
navigatorKey: rootNavigatorKey,
|
||||
initialLocation: '/login',
|
||||
// redirect: (context, state) {},
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
pageBuilder: LoginBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: '/onboarding',
|
||||
name: 'onboarding',
|
||||
pageBuilder: OnboardingBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: '/link_phone',
|
||||
name: 'link_phone',
|
||||
pageBuilder: LinkPhoneBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: '/phone_code',
|
||||
name: 'phone_code',
|
||||
pageBuilder: PhoneCodeBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: '/recover_password',
|
||||
name: 'recover_password',
|
||||
pageBuilder: RecoverPasswordBuilder().buildPage,
|
||||
),
|
||||
StatefulShellRoute.indexedStack(
|
||||
builder: (context, state, navShell) {
|
||||
return DashboardBuilder().build(context, navShell);
|
||||
},
|
||||
branches: [
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/main/home',
|
||||
name: 'home',
|
||||
pageBuilder: const HomeBuilder().buildPage,
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/main/activity',
|
||||
name: 'activity',
|
||||
pageBuilder: const ActivityBuilder().buildPage,
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/main/notifications',
|
||||
name: 'notifications',
|
||||
pageBuilder: const NotificationsBuilder().buildPage,
|
||||
),
|
||||
],
|
||||
),
|
||||
StatefulShellBranch(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/main/profile',
|
||||
name: 'profile',
|
||||
pageBuilder: const ProfileBuilder().buildPage,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
GetIt.I<NavigationContract>().setRouter(appRouter);
|
||||
}
|
||||
11
apps/mobile_app/lib/navigation/app_routes.dart
Normal file
11
apps/mobile_app/lib/navigation/app_routes.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
enum AppRoutes {
|
||||
onboarding,
|
||||
linkPhone,
|
||||
phoneCode,
|
||||
login,
|
||||
recoverPassword,
|
||||
home,
|
||||
activity,
|
||||
notifications,
|
||||
profile,
|
||||
}
|
||||
@@ -48,6 +48,70 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
sha256: ce76b1d48875e3233fde17717c23d1f60a91cc631597e49a400c89b475395b1d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
sha256: bf05f6e12cfea92d3c09308d7bcdab1906cd8a179b023269eed00c071004b957
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.1"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
sha256: d1d57f7807debd7349b4726a19fd32ec8bc177c71ad0febf91a20f84cd2d4b46
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
build_runner:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: build_runner
|
||||
sha256: b24597fceb695969d47025c958f3837f9f0122e237c6a22cb082a5ac66c3ca30
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.7.1"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_runner_core
|
||||
sha256: "066dda7f73d8eb48ba630a55acb50c4a84a2e6b453b1cb4567f581729e794f7b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.3.1"
|
||||
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: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.12.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -56,6 +120,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.0"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: checked_yaml
|
||||
sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
cli_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -72,6 +144,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
sha256: "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.11.0"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -112,6 +192,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.8"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.1"
|
||||
dashboard_shell:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -150,6 +238,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.1"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
fl_chart:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -197,6 +293,22 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
freezed:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: freezed
|
||||
sha256: "13065f10e135263a4f5a4391b79a8efc5fb8106f8dd555a9e49b750b45393d77"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.3"
|
||||
freezed_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: freezed_annotation
|
||||
sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
frontend_server_client:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -229,6 +341,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "17.0.0"
|
||||
go_router_builder:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: go_router_builder
|
||||
sha256: e0646fb5586e04e1df92678f539059f38e4314848f06dd4f3cd87fed434e16b5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.1"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: graphs
|
||||
sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
home:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -276,6 +404,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.2"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -355,14 +491,6 @@ packages:
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: nested
|
||||
sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
node_preamble:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -425,14 +553,6 @@ packages:
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
provider:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: provider
|
||||
sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.5+1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -441,6 +561,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
riverpod:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -493,6 +621,22 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
sha256: "800f12fb87434defa13432ab37e33051b43b290a174e15259563b043cda40c46"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
source_helper:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_helper
|
||||
sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.8"
|
||||
source_map_stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -541,6 +685,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_transform
|
||||
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -581,6 +733,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.11"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: timing
|
||||
sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -33,10 +33,8 @@ dependencies:
|
||||
flutter_riverpod: ^3.0.3
|
||||
get_it: ^9.0.5
|
||||
go_router: ^17.0.0
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
design_system:
|
||||
path: ../../packages/design_system
|
||||
|
||||
#modules dependencies go here
|
||||
auth:
|
||||
path: ../../modules/auth
|
||||
home:
|
||||
@@ -47,11 +45,18 @@ dependencies:
|
||||
path: ../../modules/notifications
|
||||
dashboard_shell:
|
||||
path: ../../modules/dashboard_shell
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
||||
#packages dependencies go here
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
design_system:
|
||||
path: ../../packages/design_system
|
||||
|
||||
#dependencies go here
|
||||
cupertino_icons: ^1.0.8
|
||||
flutter_svg: ^2.2.1
|
||||
|
||||
go_router_builder: ^4.1.1
|
||||
build_runner: ^2.7.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import 'package:auth/src/device_sign_up/link_watch/create_profile_screen.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/core/dashboard_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/link_watch/create_profile_screen.dart';
|
||||
|
||||
class AddKidScreen extends StatelessWidget {
|
||||
const AddKidScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
||||
@@ -5,9 +5,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class CreateProfileScreen extends ConsumerWidget {
|
||||
CreateProfileScreen({super.key});
|
||||
const CreateProfileScreen({super.key});
|
||||
|
||||
int currentStep = 0;
|
||||
final int currentStep = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
class LoadingGoogleScreen extends StatelessWidget {
|
||||
const LoadingGoogleScreen({super.key});
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import 'package:auth/src/login/presentation/loading_google_screen.dart';
|
||||
import 'package:auth/src/recover_password/presentation/restore_password_screen.dart';
|
||||
import 'package:auth/src/sign_up/signup_screen.dart';
|
||||
import 'package:dashboard_shell/dashboard_shell.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/core/dashboard_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/loading_google_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/restore_password/restore_password_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/signup/signup_screen.dart';
|
||||
|
||||
class LoginScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
@@ -66,8 +60,7 @@ class LoginScreen extends ConsumerWidget {
|
||||
child: Text("¿Has olvidado la contraseña?"),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () =>
|
||||
navigationContract.pushTo('/dashboard_shell'),
|
||||
onPressed: () => navigationContract.pushTo('/main/home'),
|
||||
child: Text("Iniciar sesión"),
|
||||
),
|
||||
Stack(children: [Divider(), Text("o continúa con")]),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:auth/src/login/presentation/login_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
@@ -3,11 +3,6 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
|
||||
// import 'package:sf_app_platform/payments/view/screens/link_phone_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/signup/signup_screen.dart';
|
||||
|
||||
// import '../../../../../apps/mobile_app/lib/payments/view/screens/core/dashboard_screen.dart';
|
||||
|
||||
class WelcomeScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
import 'package:auth/src/recover_password/presentation/new_password_screen.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:sf_app_platform/payments/domain/ports/theme_port.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/restore_password/new_password_screen.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class EmailSentScreen extends StatefulWidget {
|
||||
class EmailSentScreen extends ConsumerWidget {
|
||||
final String email;
|
||||
|
||||
const EmailSentScreen({super.key, required this.email});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => EmailSentScreenState();
|
||||
}
|
||||
|
||||
class EmailSentScreenState extends State<EmailSentScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = context.read<ThemePort>();
|
||||
Widget build(BuildContext contex, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
@@ -65,12 +56,12 @@ class EmailSentScreenState extends State<EmailSentScreen> {
|
||||
Expanded(
|
||||
child: FilledButton(
|
||||
onPressed: () => {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => NewPasswordScreen(),
|
||||
),
|
||||
),
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (_) => NewPasswordScreen(),
|
||||
// ),
|
||||
// ),
|
||||
},
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStatePropertyAll<Color>(
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
// import '../../../domain/ports/theme_port.dart';
|
||||
|
||||
class NewPasswordScreen extends StatefulWidget {
|
||||
class NewPasswordScreen extends ConsumerStatefulWidget {
|
||||
const NewPasswordScreen({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => NewPasswordScreenState();
|
||||
ConsumerState<NewPasswordScreen> createState() => NewPasswordScreenState();
|
||||
}
|
||||
|
||||
class NewPasswordScreenState extends State<NewPasswordScreen> {
|
||||
class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
|
||||
bool passwordVisible = false;
|
||||
bool equalPasswords = false;
|
||||
String password = "";
|
||||
@@ -39,7 +36,7 @@ class NewPasswordScreenState extends State<NewPasswordScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = context.read<ThemePort>();
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
|
||||
@@ -2,13 +2,8 @@ import 'package:auth/src/recover_password/presentation/email_sent_screen.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
// import 'package:sf_app_platform/payments/domain/ports/theme_port.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/restore_password/email_sent_screen.dart';
|
||||
|
||||
class RestorePasswordScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
@@ -16,7 +11,6 @@ class RestorePasswordScreen extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
// ThemePort theme = context.read<ThemePort>();
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
import 'package:auth/src/device_sign_up/add_kid_screen.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/add_kid_screen.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/core/dashboard_screen.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
// import '../../../../../apps/mobile_app/lib/payments/domain/ports/theme_port.dart';
|
||||
class AccountCreatedScreen extends ConsumerWidget {
|
||||
const AccountCreatedScreen({super.key});
|
||||
|
||||
class AccountCreatedScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ThemePort theme = context.read<ThemePort>();
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final email = "usuario@example.com";
|
||||
final fullName = "Carlos Pérez Cruz";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SignupAddressScreen extends StatelessWidget{
|
||||
class SignupAddressScreen extends StatelessWidget {
|
||||
const SignupAddressScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -8,10 +9,25 @@ class SignupAddressScreen extends StatelessWidget{
|
||||
spacing: 30,
|
||||
children: [
|
||||
Text("Domicilio"),
|
||||
Text("Tu dirección", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)),
|
||||
Text("Tu dirección nos ayuda a verificar y mantener la seguridad de tu cuenta"),
|
||||
TextField(decoration: InputDecoration(hintText: "Dirección completa", border: OutlineInputBorder())),
|
||||
TextField(decoration: InputDecoration(hintText: "Ciudad", border: OutlineInputBorder())),
|
||||
Text(
|
||||
"Tu dirección",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
|
||||
),
|
||||
Text(
|
||||
"Tu dirección nos ayuda a verificar y mantener la seguridad de tu cuenta",
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Dirección completa",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Ciudad",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
DropdownMenu(
|
||||
dropdownMenuEntries: List<DropdownMenuEntry>.generate(3, (int index) {
|
||||
return DropdownMenuEntry(value: "España", label: "España");
|
||||
@@ -19,9 +35,13 @@ class SignupAddressScreen extends StatelessWidget{
|
||||
hintText: "País",
|
||||
width: double.infinity,
|
||||
),
|
||||
TextField(decoration: InputDecoration(hintText: "Nacionalidad", border: OutlineInputBorder()))
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Nacionalidad",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +1,11 @@
|
||||
import 'package:auth/src/sign_up/account_created_screen.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// import 'package:sf_app_platform/payments/view/screens/account_created_screen.dart';
|
||||
import 'package:auth/src/sign_up/signup_address_screen.dart';
|
||||
import 'package:auth/src/sign_up/signup_personal_screen.dart';
|
||||
import 'package:auth/src/sign_up/signup_user_screen.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
// import '../../../../../apps/mobile_app/lib/payments/domain/ports/theme_port.dart';
|
||||
|
||||
class SignupScreen extends ConsumerWidget {
|
||||
SignupScreen({super.key});
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export 'src/presentation/dashboard_screen.dart';
|
||||
export 'src/presentation/main_shell_screen.dart';
|
||||
export 'dashboard_builder.dart';
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:home/home.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
import 'package:profile/profile.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class DashboardScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
DashboardScreen({super.key, required this.navigationContract});
|
||||
|
||||
int currentPageIndex = 3;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final bodies = [
|
||||
HomeScreen(),
|
||||
ActivityScreen(),
|
||||
AlertScreen(),
|
||||
ProfileScreen(),
|
||||
];
|
||||
|
||||
return Scaffold(
|
||||
bottomNavigationBar: NavigationBar(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
onDestinationSelected: (int index) {
|
||||
// setState(() {
|
||||
// currentPageIndex = index;
|
||||
// });
|
||||
},
|
||||
selectedIndex: currentPageIndex,
|
||||
destinations: [
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.home_outlined),
|
||||
label: "Inicio",
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.watch_outlined),
|
||||
label: "Movimientos",
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.notifications_outlined),
|
||||
label: "Alertas",
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.person_outline_outlined),
|
||||
label: "Mi perfil",
|
||||
),
|
||||
],
|
||||
),
|
||||
body: bodies[currentPageIndex],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import 'package:dashboard_shell/src/presentation/main_shell_view_model.dart';
|
||||
import 'package:dashboard_shell/src/presentation/main_shell_view_state.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_riverpod/legacy.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
|
||||
final mainShellViewModelProvider =
|
||||
StateNotifierProvider.autoDispose<MainShellViewModel, MainShellViewState>(
|
||||
(ref) => MainShellViewModel(ref: ref),
|
||||
);
|
||||
|
||||
class DashboardScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
final StatefulNavigationShell navigationShell;
|
||||
|
||||
const DashboardScreen({
|
||||
super.key,
|
||||
required this.navigationContract,
|
||||
required this.navigationShell,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final viewState = ref.watch(mainShellViewModelProvider);
|
||||
final viewModel = ref.read(mainShellViewModelProvider.notifier);
|
||||
|
||||
return Scaffold(
|
||||
body: navigationShell,
|
||||
bottomNavigationBar: NavigationBar(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
selectedIndex: viewState.selectedIndex,
|
||||
onDestinationSelected: (index) {
|
||||
viewModel.onTabChanged(index);
|
||||
navigationShell.goBranch(index);
|
||||
},
|
||||
destinations: const [
|
||||
NavigationDestination(icon: Icon(Icons.home_outlined), label: "Home"),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.watch_outlined),
|
||||
label: "Activity",
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.notifications_outlined),
|
||||
label: "Notifications",
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.person_outline_outlined),
|
||||
label: "Profile",
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'package:dashboard_shell/src/presentation/main_shell_view_state.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_riverpod/legacy.dart';
|
||||
|
||||
class MainShellViewModel extends StateNotifier<MainShellViewState> {
|
||||
MainShellViewModel({required this.ref}) : super(MainShellViewState());
|
||||
|
||||
final Ref ref;
|
||||
|
||||
void onTabChanged(int index) {
|
||||
state = state.copyWith(selectedIndex: index);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
part 'main_shell_view_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class MainShellViewState with _$MainShellViewState {
|
||||
const factory MainShellViewState({
|
||||
@Default(0) int selectedIndex,
|
||||
@Default(false) bool isLoading,
|
||||
@Default(false) bool isComplete,
|
||||
String? error,
|
||||
}) = _MainShellViewState;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'main_shell_view_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$MainShellViewState {
|
||||
|
||||
int get selectedIndex; bool get isLoading; bool get isComplete; String? get error;
|
||||
/// Create a copy of MainShellViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$MainShellViewStateCopyWith<MainShellViewState> get copyWith => _$MainShellViewStateCopyWithImpl<MainShellViewState>(this as MainShellViewState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is MainShellViewState&&(identical(other.selectedIndex, selectedIndex) || other.selectedIndex == selectedIndex)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isComplete, isComplete) || other.isComplete == isComplete)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,selectedIndex,isLoading,isComplete,error);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MainShellViewState(selectedIndex: $selectedIndex, isLoading: $isLoading, isComplete: $isComplete, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $MainShellViewStateCopyWith<$Res> {
|
||||
factory $MainShellViewStateCopyWith(MainShellViewState value, $Res Function(MainShellViewState) _then) = _$MainShellViewStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int selectedIndex, bool isLoading, bool isComplete, String? error
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$MainShellViewStateCopyWithImpl<$Res>
|
||||
implements $MainShellViewStateCopyWith<$Res> {
|
||||
_$MainShellViewStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final MainShellViewState _self;
|
||||
final $Res Function(MainShellViewState) _then;
|
||||
|
||||
/// Create a copy of MainShellViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? selectedIndex = null,Object? isLoading = null,Object? isComplete = null,Object? error = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
selectedIndex: null == selectedIndex ? _self.selectedIndex : selectedIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,isComplete: null == isComplete ? _self.isComplete : isComplete // ignore: cast_nullable_to_non_nullable
|
||||
as bool,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [MainShellViewState].
|
||||
extension MainShellViewStatePatterns on MainShellViewState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _MainShellViewState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _MainShellViewState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _MainShellViewState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int selectedIndex, bool isLoading, bool isComplete, String? error)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState() when $default != null:
|
||||
return $default(_that.selectedIndex,_that.isLoading,_that.isComplete,_that.error);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int selectedIndex, bool isLoading, bool isComplete, String? error) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState():
|
||||
return $default(_that.selectedIndex,_that.isLoading,_that.isComplete,_that.error);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int selectedIndex, bool isLoading, bool isComplete, String? error)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _MainShellViewState() when $default != null:
|
||||
return $default(_that.selectedIndex,_that.isLoading,_that.isComplete,_that.error);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _MainShellViewState implements MainShellViewState {
|
||||
const _MainShellViewState({this.selectedIndex = 0, this.isLoading = false, this.isComplete = false, this.error});
|
||||
|
||||
|
||||
@override@JsonKey() final int selectedIndex;
|
||||
@override@JsonKey() final bool isLoading;
|
||||
@override@JsonKey() final bool isComplete;
|
||||
@override final String? error;
|
||||
|
||||
/// Create a copy of MainShellViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$MainShellViewStateCopyWith<_MainShellViewState> get copyWith => __$MainShellViewStateCopyWithImpl<_MainShellViewState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MainShellViewState&&(identical(other.selectedIndex, selectedIndex) || other.selectedIndex == selectedIndex)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isComplete, isComplete) || other.isComplete == isComplete)&&(identical(other.error, error) || other.error == error));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,selectedIndex,isLoading,isComplete,error);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'MainShellViewState(selectedIndex: $selectedIndex, isLoading: $isLoading, isComplete: $isComplete, error: $error)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$MainShellViewStateCopyWith<$Res> implements $MainShellViewStateCopyWith<$Res> {
|
||||
factory _$MainShellViewStateCopyWith(_MainShellViewState value, $Res Function(_MainShellViewState) _then) = __$MainShellViewStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int selectedIndex, bool isLoading, bool isComplete, String? error
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$MainShellViewStateCopyWithImpl<$Res>
|
||||
implements _$MainShellViewStateCopyWith<$Res> {
|
||||
__$MainShellViewStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _MainShellViewState _self;
|
||||
final $Res Function(_MainShellViewState) _then;
|
||||
|
||||
/// Create a copy of MainShellViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? selectedIndex = null,Object? isLoading = null,Object? isComplete = null,Object? error = freezed,}) {
|
||||
return _then(_MainShellViewState(
|
||||
selectedIndex: null == selectedIndex ? _self.selectedIndex : selectedIndex // ignore: cast_nullable_to_non_nullable
|
||||
as int,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,isComplete: null == isComplete ? _self.isComplete : isComplete // ignore: cast_nullable_to_non_nullable
|
||||
as bool,error: freezed == error ? _self.error : error // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -29,11 +29,17 @@ dependencies:
|
||||
get_it: ^9.0.5
|
||||
go_router: ^17.0.0
|
||||
flutter_riverpod: ^3.0.3
|
||||
freezed_annotation: ^3.1.0
|
||||
freezed: ^3.2.3
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
riverpod_generator: ^3.0.3
|
||||
build_runner: ^2.7.1
|
||||
riverpod_lint: ^3.0.3
|
||||
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export 'src/presentation/home_screen.dart';
|
||||
export 'src/home_builder.dart';
|
||||
|
||||
11
modules/home/lib/src/home_builder.dart
Normal file
11
modules/home/lib/src/home_builder.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:home/home.dart';
|
||||
|
||||
class HomeBuilder {
|
||||
const HomeBuilder();
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(child: HomeScreen());
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:home/src/presentation/wallet_management_layout.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:home/src/presentation/wallet_management_layout.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:home/src/presentation/wallet_management_layout.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ dependencies:
|
||||
#dependencies go here
|
||||
flutter_svg: ^2.2.1
|
||||
flutter_riverpod: ^3.0.3
|
||||
|
||||
get_it: ^9.0.5
|
||||
go_router: ^17.0.0
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
export 'src/presentation/alert_screen.dart';
|
||||
export 'src/presentation/activity_screen.dart';
|
||||
export 'src/core/activity_list.dart';
|
||||
export 'src/activity_builder.dart';
|
||||
export 'src/notifications_builder.dart';
|
||||
|
||||
11
modules/notifications/lib/src/activity_builder.dart
Normal file
11
modules/notifications/lib/src/activity_builder.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
|
||||
class ActivityBuilder {
|
||||
const ActivityBuilder();
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(child: ActivityScreen());
|
||||
}
|
||||
}
|
||||
11
modules/notifications/lib/src/notifications_builder.dart
Normal file
11
modules/notifications/lib/src/notifications_builder.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
|
||||
class NotificationsBuilder {
|
||||
const NotificationsBuilder();
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(child: AlertScreen());
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,8 @@ dependencies:
|
||||
path: ../../packages/sf_shared
|
||||
#dependencies go here
|
||||
flutter_riverpod: ^3.0.3
|
||||
|
||||
get_it: ^9.0.5
|
||||
go_router: ^17.0.0
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export 'src/presentation/profile_screen.dart';
|
||||
export 'src/profile_builder.dart';
|
||||
|
||||
12
modules/profile/lib/src/profile_builder.dart
Normal file
12
modules/profile/lib/src/profile_builder.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
import 'package:profile/profile.dart';
|
||||
|
||||
class ProfileBuilder {
|
||||
const ProfileBuilder();
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
return MaterialPage(child: ProfileScreen());
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,8 @@ dependencies:
|
||||
|
||||
#dependencies go here
|
||||
flutter_riverpod: ^3.0.3
|
||||
get_it: ^9.0.5
|
||||
go_router: ^17.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'dart:collection';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:design_system/src/theme/theme_port.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ThemeSfAdapter extends ThemePort {
|
||||
@override
|
||||
Map<ThemeCode, Color> theme = HashMap.from({
|
||||
final Map<ThemeCode, Color> _theme = {
|
||||
ThemeCode.backgroundPrimary: Color(0xFFFFFFFF),
|
||||
ThemeCode.backgroundSecondary: Color(0xFFF7F7F7),
|
||||
ThemeCode.backgroundTertiary: Color(0x4D329E95),
|
||||
@@ -15,11 +13,16 @@ class ThemeSfAdapter extends ThemePort {
|
||||
ThemeCode.textTertiary: Color(0xFFE0E0E0),
|
||||
ThemeCode.buttonPrimary: Color(0xFF329e95),
|
||||
ThemeCode.buttonSecondary: Color(0xFF4B4B4B),
|
||||
});
|
||||
};
|
||||
|
||||
@override
|
||||
List<List<Color>> cardColors = [
|
||||
<Color>[Color(0xFFFA5C9F), Color(0xFFEB2579), Color(0xFFE60866)],
|
||||
<Color>[Color(0xFF00A1C6), Color(0xFF00819E)],
|
||||
Map<ThemeCode, Color> get theme => _theme;
|
||||
|
||||
final List<List<Color>> _cardColors = [
|
||||
[Color(0xFFFA5C9F), Color(0xFFEB2579), Color(0xFFE60866)],
|
||||
[Color(0xFF00A1C6), Color(0xFF00819E)],
|
||||
];
|
||||
|
||||
@override
|
||||
List<List<Color>> get cardColors => _cardColors;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export 'src/kid.dart';
|
||||
export 'src/line_graph.dart';
|
||||
export 'src/deposit_block.dart';
|
||||
export 'src/wallet_management_layout.dart';
|
||||
export 'src/connection_error_screen.dart';
|
||||
export 'src/server_error_screen.dart';
|
||||
export 'src/no_plan_error_screen.dart';
|
||||
export 'src/models/kid.dart';
|
||||
export 'src/widgets/line_graph.dart';
|
||||
export 'src/widgets/deposit_block.dart';
|
||||
export 'src/screens/connection_error_screen.dart';
|
||||
export 'src/screens/server_error_screen.dart';
|
||||
export 'src/screens/no_plan_error_screen.dart';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class MainConstants {
|
||||
static const double minWebAppRatio = 9.0 / 21.0;
|
||||
static const double maxWebAppRatio = 9.0 / 18.0;
|
||||
}
|
||||
// class MainConstants {
|
||||
// static const double minWebAppRatio = 9.0 / 21.0;
|
||||
// static const double maxWebAppRatio = 9.0 / 18.0;
|
||||
// }
|
||||
|
||||
/// Utils for dynamic sizes
|
||||
class SizeUtils {
|
||||
@@ -22,7 +22,7 @@ class SizeUtils {
|
||||
// Padding of the screen where we cannot render elements without the SafeArea
|
||||
static EdgeInsets padding = const EdgeInsets.all(0);
|
||||
|
||||
static const double kWebDesiredAspectRatio = MainConstants.minWebAppRatio;
|
||||
// static const double kWebDesiredAspectRatio = MainConstants.minWebAppRatio;
|
||||
|
||||
const SizeUtils();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user