diff --git a/.dart_tool/extension_discovery/README.md b/.dart_tool/extension_discovery/README.md new file mode 100644 index 00000000..9dc6757b --- /dev/null +++ b/.dart_tool/extension_discovery/README.md @@ -0,0 +1,31 @@ +Extension Discovery Cache +========================= + +This folder is used by `package:extension_discovery` to cache lists of +packages that contains extensions for other packages. + +DO NOT USE THIS FOLDER +---------------------- + + * Do not read (or rely) the contents of this folder. + * Do write to this folder. + +If you're interested in the lists of extensions stored in this folder use the +API offered by package `extension_discovery` to get this information. + +If this package doesn't work for your use-case, then don't try to read the +contents of this folder. It may change, and will not remain stable. + +Use package `extension_discovery` +--------------------------------- + +If you want to access information from this folder. + +Feel free to delete this folder +------------------------------- + +Files in this folder act as a cache, and the cache is discarded if the files +are older than the modification time of `.dart_tool/package_config.json`. + +Hence, it should never be necessary to clear this cache manually, if you find a +need to do please file a bug. diff --git a/.dart_tool/extension_discovery/vs_code.json b/.dart_tool/extension_discovery/vs_code.json new file mode 100644 index 00000000..0951d9cb --- /dev/null +++ b/.dart_tool/extension_discovery/vs_code.json @@ -0,0 +1 @@ +{"version":2,"entries":[{"package":"design_system","rootUri":"../packages/design_system/","packageUri":"lib/"},{"package":"sf_shared","rootUri":"../sf_shared/","packageUri":"lib/"},{"package":"sf_app_platform_mono_repo","rootUri":"../","packageUri":"lib/"},{"package":"navigation","rootUri":"../packages/navigation/","packageUri":"lib/"},{"package":"auth","rootUri":"../modules/auth/","packageUri":"lib/"},{"package":"home","rootUri":"../modules/home/","packageUri":"lib/"},{"package":"profile","rootUri":"../modules/profile/","packageUri":"lib/"},{"package":"notifications","rootUri":"../modules/notifications/","packageUri":"lib/"},{"package":"dashboard_shell","rootUri":"../modules/dashboard_shell/","packageUri":"lib/"}]} \ No newline at end of file diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json new file mode 100644 index 00000000..3b00a9d9 --- /dev/null +++ b/.dart_tool/package_config.json @@ -0,0 +1,364 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "ansi_styles", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/ansi_styles-0.3.2+1", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "args", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/args-2.7.0", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "async", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/async-2.13.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "characters", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/characters-1.4.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "charcode", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/charcode-1.4.0", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "checked_yaml", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/checked_yaml-2.0.4", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "cli_launcher", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/cli_launcher-0.3.2+1", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "cli_util", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/cli_util-0.4.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "collection", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/collection-1.19.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "conventional_commit", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/conventional_commit-0.6.1+1", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "ffi", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/ffi-2.1.4", + "packageUri": "lib/", + "languageVersion": "3.7" + }, + { + "name": "file", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/file-7.0.1", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "flutter", + "rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "flutter_secure_storage", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_secure_storage_linux", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_secure_storage_macos", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_secure_storage_platform_interface", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_platform_interface-1.1.2", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_secure_storage_web", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_secure_storage_windows", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "flutter_web_plugins", + "rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter_web_plugins", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "glob", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/glob-2.1.3", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "graphs", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/graphs-2.3.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "http", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/http-1.5.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "http_parser", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/http_parser-4.1.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "io", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/io-1.0.5", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "js", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/js-0.6.7", + "packageUri": "lib/", + "languageVersion": "2.19" + }, + { + "name": "json_annotation", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/json_annotation-4.9.0", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "material_color_utilities", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1", + "packageUri": "lib/", + "languageVersion": "2.17" + }, + { + "name": "melos", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/melos-6.3.3", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "meta", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/meta-1.16.0", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "mustache_template", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/mustache_template-2.0.2", + "packageUri": "lib/", + "languageVersion": "3.7" + }, + { + "name": "path", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path-1.9.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "path_provider", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider-2.1.5", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "path_provider_android", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_android-2.2.20", + "packageUri": "lib/", + "languageVersion": "3.9" + }, + { + "name": "path_provider_foundation", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.3", + "packageUri": "lib/", + "languageVersion": "3.9" + }, + { + "name": "path_provider_linux", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1", + "packageUri": "lib/", + "languageVersion": "2.19" + }, + { + "name": "path_provider_platform_interface", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_platform_interface-2.1.2", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "path_provider_windows", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0", + "packageUri": "lib/", + "languageVersion": "3.2" + }, + { + "name": "platform", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/platform-3.1.6", + "packageUri": "lib/", + "languageVersion": "3.2" + }, + { + "name": "plugin_platform_interface", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "pool", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pool-1.5.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "process", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/process-5.0.5", + "packageUri": "lib/", + "languageVersion": "3.5" + }, + { + "name": "prompts", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/prompts-2.0.0", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "pub_semver", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pub_semver-2.2.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "pub_updater", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pub_updater-0.5.0", + "packageUri": "lib/", + "languageVersion": "3.5" + }, + { + "name": "pubspec_parse", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0", + "packageUri": "lib/", + "languageVersion": "3.6" + }, + { + "name": "sky_engine", + "rootUri": "file:///Users/juliandalcalaf/Development/flutter/bin/cache/pkg/sky_engine", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "source_span", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/source_span-1.10.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "stack_trace", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/stack_trace-1.12.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "string_scanner", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/string_scanner-1.4.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "term_glyph", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/term_glyph-1.2.2", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "typed_data", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/typed_data-1.4.0", + "packageUri": "lib/", + "languageVersion": "3.5" + }, + { + "name": "vector_math", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/vector_math-2.2.0", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "web", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/web-1.1.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "win32", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/win32-5.15.0", + "packageUri": "lib/", + "languageVersion": "3.8" + }, + { + "name": "xdg_directories", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/xdg_directories-1.1.0", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "yaml", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/yaml-3.1.3", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "yaml_edit", + "rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/yaml_edit-2.2.2", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "sf_app_platform_mono_repo", + "rootUri": "../", + "packageUri": "lib/", + "languageVersion": "3.0" + } + ], + "generator": "pub", + "generatorVersion": "3.9.2", + "flutterRoot": "file:///Users/juliandalcalaf/Development/flutter", + "flutterVersion": "3.35.7", + "pubCache": "file:///Users/juliandalcalaf/.pub-cache" +} diff --git a/.dart_tool/package_graph.json b/.dart_tool/package_graph.json new file mode 100644 index 00000000..c8198228 --- /dev/null +++ b/.dart_tool/package_graph.json @@ -0,0 +1,491 @@ +{ + "roots": [ + "sf_app_platform_mono_repo" + ], + "packages": [ + { + "name": "sf_app_platform_mono_repo", + "version": "0.0.0", + "dependencies": [ + "flutter_secure_storage" + ], + "devDependencies": [ + "melos" + ] + }, + { + "name": "flutter_secure_storage", + "version": "9.2.4", + "dependencies": [ + "flutter", + "flutter_secure_storage_linux", + "flutter_secure_storage_macos", + "flutter_secure_storage_platform_interface", + "flutter_secure_storage_web", + "flutter_secure_storage_windows", + "meta" + ] + }, + { + "name": "melos", + "version": "6.3.3", + "dependencies": [ + "ansi_styles", + "args", + "async", + "cli_launcher", + "cli_util", + "collection", + "conventional_commit", + "file", + "glob", + "graphs", + "http", + "meta", + "mustache_template", + "path", + "platform", + "pool", + "prompts", + "pub_semver", + "pub_updater", + "pubspec_parse", + "string_scanner", + "yaml", + "yaml_edit" + ] + }, + { + "name": "meta", + "version": "1.16.0", + "dependencies": [] + }, + { + "name": "flutter_secure_storage_windows", + "version": "3.1.2", + "dependencies": [ + "ffi", + "flutter", + "flutter_secure_storage_platform_interface", + "path", + "path_provider", + "win32" + ] + }, + { + "name": "flutter_secure_storage_web", + "version": "1.2.1", + "dependencies": [ + "flutter", + "flutter_secure_storage_platform_interface", + "flutter_web_plugins", + "js" + ] + }, + { + "name": "flutter_secure_storage_platform_interface", + "version": "1.1.2", + "dependencies": [ + "flutter", + "plugin_platform_interface" + ] + }, + { + "name": "flutter_secure_storage_macos", + "version": "3.1.3", + "dependencies": [ + "flutter", + "flutter_secure_storage_platform_interface" + ] + }, + { + "name": "flutter_secure_storage_linux", + "version": "1.2.3", + "dependencies": [ + "flutter", + "flutter_secure_storage_platform_interface" + ] + }, + { + "name": "flutter", + "version": "0.0.0", + "dependencies": [ + "characters", + "collection", + "material_color_utilities", + "meta", + "sky_engine", + "vector_math" + ] + }, + { + "name": "yaml_edit", + "version": "2.2.2", + "dependencies": [ + "collection", + "meta", + "source_span", + "yaml" + ] + }, + { + "name": "yaml", + "version": "3.1.3", + "dependencies": [ + "collection", + "source_span", + "string_scanner" + ] + }, + { + "name": "string_scanner", + "version": "1.4.1", + "dependencies": [ + "source_span" + ] + }, + { + "name": "pubspec_parse", + "version": "1.5.0", + "dependencies": [ + "checked_yaml", + "collection", + "json_annotation", + "pub_semver", + "yaml" + ] + }, + { + "name": "pub_updater", + "version": "0.5.0", + "dependencies": [ + "http", + "json_annotation", + "process", + "pub_semver" + ] + }, + { + "name": "pub_semver", + "version": "2.2.0", + "dependencies": [ + "collection" + ] + }, + { + "name": "prompts", + "version": "2.0.0", + "dependencies": [ + "charcode", + "io" + ] + }, + { + "name": "pool", + "version": "1.5.2", + "dependencies": [ + "async", + "stack_trace" + ] + }, + { + "name": "platform", + "version": "3.1.6", + "dependencies": [] + }, + { + "name": "path", + "version": "1.9.1", + "dependencies": [] + }, + { + "name": "mustache_template", + "version": "2.0.2", + "dependencies": [] + }, + { + "name": "http", + "version": "1.5.0", + "dependencies": [ + "async", + "http_parser", + "meta", + "web" + ] + }, + { + "name": "graphs", + "version": "2.3.2", + "dependencies": [ + "collection" + ] + }, + { + "name": "glob", + "version": "2.1.3", + "dependencies": [ + "async", + "collection", + "file", + "path", + "string_scanner" + ] + }, + { + "name": "file", + "version": "7.0.1", + "dependencies": [ + "meta", + "path" + ] + }, + { + "name": "conventional_commit", + "version": "0.6.1+1", + "dependencies": [] + }, + { + "name": "collection", + "version": "1.19.1", + "dependencies": [] + }, + { + "name": "cli_util", + "version": "0.4.2", + "dependencies": [ + "meta", + "path" + ] + }, + { + "name": "cli_launcher", + "version": "0.3.2+1", + "dependencies": [ + "path", + "yaml" + ] + }, + { + "name": "async", + "version": "2.13.0", + "dependencies": [ + "collection", + "meta" + ] + }, + { + "name": "args", + "version": "2.7.0", + "dependencies": [] + }, + { + "name": "ansi_styles", + "version": "0.3.2+1", + "dependencies": [] + }, + { + "name": "win32", + "version": "5.15.0", + "dependencies": [ + "ffi" + ] + }, + { + "name": "path_provider", + "version": "2.1.5", + "dependencies": [ + "flutter", + "path_provider_android", + "path_provider_foundation", + "path_provider_linux", + "path_provider_platform_interface", + "path_provider_windows" + ] + }, + { + "name": "ffi", + "version": "2.1.4", + "dependencies": [] + }, + { + "name": "js", + "version": "0.6.7", + "dependencies": [ + "meta" + ] + }, + { + "name": "flutter_web_plugins", + "version": "0.0.0", + "dependencies": [ + "flutter" + ] + }, + { + "name": "plugin_platform_interface", + "version": "2.1.8", + "dependencies": [ + "meta" + ] + }, + { + "name": "sky_engine", + "version": "0.0.0", + "dependencies": [] + }, + { + "name": "vector_math", + "version": "2.2.0", + "dependencies": [] + }, + { + "name": "material_color_utilities", + "version": "0.11.1", + "dependencies": [ + "collection" + ] + }, + { + "name": "characters", + "version": "1.4.0", + "dependencies": [] + }, + { + "name": "source_span", + "version": "1.10.1", + "dependencies": [ + "collection", + "path", + "term_glyph" + ] + }, + { + "name": "json_annotation", + "version": "4.9.0", + "dependencies": [ + "meta" + ] + }, + { + "name": "checked_yaml", + "version": "2.0.4", + "dependencies": [ + "json_annotation", + "source_span", + "yaml" + ] + }, + { + "name": "process", + "version": "5.0.5", + "dependencies": [ + "file", + "path", + "platform" + ] + }, + { + "name": "io", + "version": "1.0.5", + "dependencies": [ + "meta", + "path", + "string_scanner" + ] + }, + { + "name": "charcode", + "version": "1.4.0", + "dependencies": [] + }, + { + "name": "stack_trace", + "version": "1.12.1", + "dependencies": [ + "path" + ] + }, + { + "name": "web", + "version": "1.1.1", + "dependencies": [] + }, + { + "name": "http_parser", + "version": "4.1.2", + "dependencies": [ + "collection", + "source_span", + "string_scanner", + "typed_data" + ] + }, + { + "name": "path_provider_windows", + "version": "2.3.0", + "dependencies": [ + "ffi", + "flutter", + "path", + "path_provider_platform_interface" + ] + }, + { + "name": "path_provider_platform_interface", + "version": "2.1.2", + "dependencies": [ + "flutter", + "platform", + "plugin_platform_interface" + ] + }, + { + "name": "path_provider_linux", + "version": "2.2.1", + "dependencies": [ + "ffi", + "flutter", + "path", + "path_provider_platform_interface", + "xdg_directories" + ] + }, + { + "name": "path_provider_foundation", + "version": "2.4.3", + "dependencies": [ + "flutter", + "path_provider_platform_interface" + ] + }, + { + "name": "path_provider_android", + "version": "2.2.20", + "dependencies": [ + "flutter", + "path_provider_platform_interface" + ] + }, + { + "name": "term_glyph", + "version": "1.2.2", + "dependencies": [] + }, + { + "name": "typed_data", + "version": "1.4.0", + "dependencies": [ + "collection" + ] + }, + { + "name": "xdg_directories", + "version": "1.1.0", + "dependencies": [ + "meta", + "path" + ] + } + ], + "configVersion": 1 +} \ No newline at end of file diff --git a/.dart_tool/pub/bin/melos/melos.dart-3.9.2.snapshot b/.dart_tool/pub/bin/melos/melos.dart-3.9.2.snapshot new file mode 100644 index 00000000..4d144da8 Binary files /dev/null and b/.dart_tool/pub/bin/melos/melos.dart-3.9.2.snapshot differ diff --git a/.dart_tool/pub/workspace_ref.json b/.dart_tool/pub/workspace_ref.json new file mode 100644 index 00000000..308baae2 --- /dev/null +++ b/.dart_tool/pub/workspace_ref.json @@ -0,0 +1,3 @@ +{ + "workspaceRoot": "../.." +} diff --git a/.dart_tool/version b/.dart_tool/version new file mode 100644 index 00000000..e119acda --- /dev/null +++ b/.dart_tool/version @@ -0,0 +1 @@ +3.35.7 \ No newline at end of file diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies new file mode 100644 index 00000000..13ad00d0 --- /dev/null +++ b/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.3/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"flutter_secure_storage","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.2.4/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_android-2.2.20/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"flutter_secure_storage_macos","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.3/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"flutter_secure_storage_linux","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"flutter_secure_storage_windows","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[{"name":"flutter_secure_storage_web","path":"/Users/juliandalcalaf/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2025-11-10 13:39:20.696891","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 00000000..2408ee7f --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +sf-app-platform \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..e41ccc6e --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_bootstrap.xml b/.idea/runConfigurations/melos_bootstrap.xml new file mode 100644 index 00000000..0365420f --- /dev/null +++ b/.idea/runConfigurations/melos_bootstrap.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/.idea/runConfigurations/melos_clean.xml b/.idea/runConfigurations/melos_clean.xml new file mode 100644 index 00000000..82bd9567 --- /dev/null +++ b/.idea/runConfigurations/melos_clean.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/.idea/runConfigurations/melos_flutter_run_sf_app_platform.xml b/.idea/runConfigurations/melos_flutter_run_sf_app_platform.xml new file mode 100644 index 00000000..e2a9ffba --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_run_sf_app_platform.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_auth.xml b/.idea/runConfigurations/melos_flutter_test_auth.xml new file mode 100644 index 00000000..7ccb196b --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_auth.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_dashboard_shell.xml b/.idea/runConfigurations/melos_flutter_test_dashboard_shell.xml new file mode 100644 index 00000000..368577a4 --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_dashboard_shell.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_design_system.xml b/.idea/runConfigurations/melos_flutter_test_design_system.xml new file mode 100644 index 00000000..5f9f3264 --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_design_system.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_home.xml b/.idea/runConfigurations/melos_flutter_test_home.xml new file mode 100644 index 00000000..745b2563 --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_home.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_notifications.xml b/.idea/runConfigurations/melos_flutter_test_notifications.xml new file mode 100644 index 00000000..dbb9e750 --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_notifications.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_profile.xml b/.idea/runConfigurations/melos_flutter_test_profile.xml new file mode 100644 index 00000000..d725a00e --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_profile.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_sf_shared.xml b/.idea/runConfigurations/melos_flutter_test_sf_shared.xml new file mode 100644 index 00000000..0f8426a0 --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_sf_shared.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_flutter_test_utils.xml b/.idea/runConfigurations/melos_flutter_test_utils.xml new file mode 100644 index 00000000..4a2783eb --- /dev/null +++ b/.idea/runConfigurations/melos_flutter_test_utils.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/melos_run_bootstrap.xml b/.idea/runConfigurations/melos_run_bootstrap.xml new file mode 100644 index 00000000..10011a79 --- /dev/null +++ b/.idea/runConfigurations/melos_run_bootstrap.xml @@ -0,0 +1,11 @@ + + + + + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..7f88519d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "sf_app_platform", + "cwd": "apps/mobile_app", + "request": "launch", + "type": "dart", + // "toolArgs": [ + // "--dart-define=ELEVENLABS_API_KEY=sk_2351c16102e66b5b5c26d022d73e8af203fda111f60516f6", + // "--dart-define=ELEVENLABS_VOICE_ID=kaOF79CUr1VcYoAoVbqa" + // ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..487fdbe0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,11 @@ +{ + "dart.flutterSdkPath": "/Users/juliandalcalaf/Development/flutter", + "dart.sdkPath": "/Users/juliandalcalaf/Development/flutter/bin/cache/dart-sdk", + "dart.enableSdkFormatter": true, + "dart.analysisExcludedFolders": [ + "**/build", + "**/.dart_tool" + ], + "editor.formatOnSave": true, + "editor.tabSize": 2 +} \ No newline at end of file diff --git a/README.md b/README.md index e7cc6955..d9d0db10 100644 --- a/README.md +++ b/README.md @@ -1,16 +1 @@ -# sf-app-platform - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +# SF-APP-PLATFORM \ No newline at end of file diff --git a/.gitignore b/apps/mobile_app/.gitignore similarity index 100% rename from .gitignore rename to apps/mobile_app/.gitignore diff --git a/.metadata b/apps/mobile_app/.metadata similarity index 100% rename from .metadata rename to apps/mobile_app/.metadata diff --git a/apps/mobile_app/README.md b/apps/mobile_app/README.md new file mode 100644 index 00000000..e7cc6955 --- /dev/null +++ b/apps/mobile_app/README.md @@ -0,0 +1,16 @@ +# sf-app-platform + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/analysis_options.yaml b/apps/mobile_app/analysis_options.yaml similarity index 100% rename from analysis_options.yaml rename to apps/mobile_app/analysis_options.yaml diff --git a/android/.gitignore b/apps/mobile_app/android/.gitignore similarity index 100% rename from android/.gitignore rename to apps/mobile_app/android/.gitignore diff --git a/android/app/build.gradle.kts b/apps/mobile_app/android/app/build.gradle.kts similarity index 100% rename from android/app/build.gradle.kts rename to apps/mobile_app/android/app/build.gradle.kts diff --git a/android/app/src/debug/AndroidManifest.xml b/apps/mobile_app/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from android/app/src/debug/AndroidManifest.xml rename to apps/mobile_app/android/app/src/debug/AndroidManifest.xml diff --git a/android/app/src/main/AndroidManifest.xml b/apps/mobile_app/android/app/src/main/AndroidManifest.xml similarity index 100% rename from android/app/src/main/AndroidManifest.xml rename to apps/mobile_app/android/app/src/main/AndroidManifest.xml diff --git a/android/app/src/main/kotlin/com/savefamily/sf_payments/MainActivity.kt b/apps/mobile_app/android/app/src/main/kotlin/com/savefamily/sf_payments/MainActivity.kt similarity index 100% rename from android/app/src/main/kotlin/com/savefamily/sf_payments/MainActivity.kt rename to apps/mobile_app/android/app/src/main/kotlin/com/savefamily/sf_payments/MainActivity.kt diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/mobile_app/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable-v21/launch_background.xml rename to apps/mobile_app/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/android/app/src/main/res/drawable/launch_background.xml b/apps/mobile_app/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from android/app/src/main/res/drawable/launch_background.xml rename to apps/mobile_app/android/app/src/main/res/drawable/launch_background.xml diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/mobile_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/mobile_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/mobile_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/mobile_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/mobile_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/mobile_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/mobile_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/mobile_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/mobile_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/mobile_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/android/app/src/main/res/values-night/styles.xml b/apps/mobile_app/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from android/app/src/main/res/values-night/styles.xml rename to apps/mobile_app/android/app/src/main/res/values-night/styles.xml diff --git a/android/app/src/main/res/values/styles.xml b/apps/mobile_app/android/app/src/main/res/values/styles.xml similarity index 100% rename from android/app/src/main/res/values/styles.xml rename to apps/mobile_app/android/app/src/main/res/values/styles.xml diff --git a/android/app/src/profile/AndroidManifest.xml b/apps/mobile_app/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from android/app/src/profile/AndroidManifest.xml rename to apps/mobile_app/android/app/src/profile/AndroidManifest.xml diff --git a/android/build.gradle.kts b/apps/mobile_app/android/build.gradle.kts similarity index 100% rename from android/build.gradle.kts rename to apps/mobile_app/android/build.gradle.kts diff --git a/android/gradle.properties b/apps/mobile_app/android/gradle.properties similarity index 100% rename from android/gradle.properties rename to apps/mobile_app/android/gradle.properties diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/apps/mobile_app/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to apps/mobile_app/android/gradle/wrapper/gradle-wrapper.properties diff --git a/android/settings.gradle.kts b/apps/mobile_app/android/settings.gradle.kts similarity index 100% rename from android/settings.gradle.kts rename to apps/mobile_app/android/settings.gradle.kts diff --git a/assets/images/ui/ahorros.svg b/apps/mobile_app/assets/images/ui/ahorros.svg similarity index 100% rename from assets/images/ui/ahorros.svg rename to apps/mobile_app/assets/images/ui/ahorros.svg diff --git a/assets/images/ui/banco.svg b/apps/mobile_app/assets/images/ui/banco.svg similarity index 100% rename from assets/images/ui/banco.svg rename to apps/mobile_app/assets/images/ui/banco.svg diff --git a/assets/images/ui/bienvenida_paso1.svg b/apps/mobile_app/assets/images/ui/bienvenida_paso1.svg similarity index 100% rename from assets/images/ui/bienvenida_paso1.svg rename to apps/mobile_app/assets/images/ui/bienvenida_paso1.svg diff --git a/assets/images/ui/bienvenida_paso2.svg b/apps/mobile_app/assets/images/ui/bienvenida_paso2.svg similarity index 100% rename from assets/images/ui/bienvenida_paso2.svg rename to apps/mobile_app/assets/images/ui/bienvenida_paso2.svg diff --git a/assets/images/ui/bienvenida_paso3.svg b/apps/mobile_app/assets/images/ui/bienvenida_paso3.svg similarity index 100% rename from assets/images/ui/bienvenida_paso3.svg rename to apps/mobile_app/assets/images/ui/bienvenida_paso3.svg diff --git a/assets/images/ui/connection_error.svg b/apps/mobile_app/assets/images/ui/connection_error.svg similarity index 100% rename from assets/images/ui/connection_error.svg rename to apps/mobile_app/assets/images/ui/connection_error.svg diff --git a/assets/images/ui/face.svg b/apps/mobile_app/assets/images/ui/face.svg similarity index 100% rename from assets/images/ui/face.svg rename to apps/mobile_app/assets/images/ui/face.svg diff --git a/assets/images/ui/formulario.svg b/apps/mobile_app/assets/images/ui/formulario.svg similarity index 100% rename from assets/images/ui/formulario.svg rename to apps/mobile_app/assets/images/ui/formulario.svg diff --git a/assets/images/ui/logo_sf.svg b/apps/mobile_app/assets/images/ui/logo_sf.svg similarity index 100% rename from assets/images/ui/logo_sf.svg rename to apps/mobile_app/assets/images/ui/logo_sf.svg diff --git a/assets/images/ui/paypal.svg b/apps/mobile_app/assets/images/ui/paypal.svg similarity index 100% rename from assets/images/ui/paypal.svg rename to apps/mobile_app/assets/images/ui/paypal.svg diff --git a/assets/images/ui/qr.svg b/apps/mobile_app/assets/images/ui/qr.svg similarity index 100% rename from assets/images/ui/qr.svg rename to apps/mobile_app/assets/images/ui/qr.svg diff --git a/assets/images/ui/server_error.svg b/apps/mobile_app/assets/images/ui/server_error.svg similarity index 100% rename from assets/images/ui/server_error.svg rename to apps/mobile_app/assets/images/ui/server_error.svg diff --git a/assets/images/ui/tareas.svg b/apps/mobile_app/assets/images/ui/tareas.svg similarity index 100% rename from assets/images/ui/tareas.svg rename to apps/mobile_app/assets/images/ui/tareas.svg diff --git a/assets/images/ui/visa.svg b/apps/mobile_app/assets/images/ui/visa.svg similarity index 100% rename from assets/images/ui/visa.svg rename to apps/mobile_app/assets/images/ui/visa.svg diff --git a/apps/mobile_app/devtools_options.yaml b/apps/mobile_app/devtools_options.yaml new file mode 100644 index 00000000..fa0b357c --- /dev/null +++ b/apps/mobile_app/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/ios/.gitignore b/apps/mobile_app/ios/.gitignore similarity index 100% rename from ios/.gitignore rename to apps/mobile_app/ios/.gitignore diff --git a/ios/Flutter/AppFrameworkInfo.plist b/apps/mobile_app/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from ios/Flutter/AppFrameworkInfo.plist rename to apps/mobile_app/ios/Flutter/AppFrameworkInfo.plist diff --git a/ios/Flutter/Debug.xcconfig b/apps/mobile_app/ios/Flutter/Debug.xcconfig similarity index 100% rename from ios/Flutter/Debug.xcconfig rename to apps/mobile_app/ios/Flutter/Debug.xcconfig diff --git a/ios/Flutter/Release.xcconfig b/apps/mobile_app/ios/Flutter/Release.xcconfig similarity index 100% rename from ios/Flutter/Release.xcconfig rename to apps/mobile_app/ios/Flutter/Release.xcconfig diff --git a/ios/Runner.xcodeproj/project.pbxproj b/apps/mobile_app/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from ios/Runner.xcodeproj/project.pbxproj rename to apps/mobile_app/ios/Runner.xcodeproj/project.pbxproj diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to apps/mobile_app/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to apps/mobile_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile_app/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from ios/Runner.xcworkspace/contents.xcworkspacedata rename to apps/mobile_app/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/mobile_app/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/mobile_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to apps/mobile_app/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/ios/Runner/AppDelegate.swift b/apps/mobile_app/ios/Runner/AppDelegate.swift similarity index 100% rename from ios/Runner/AppDelegate.swift rename to apps/mobile_app/ios/Runner/AppDelegate.swift diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to apps/mobile_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/mobile_app/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from ios/Runner/Base.lproj/LaunchScreen.storyboard rename to apps/mobile_app/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/ios/Runner/Base.lproj/Main.storyboard b/apps/mobile_app/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from ios/Runner/Base.lproj/Main.storyboard rename to apps/mobile_app/ios/Runner/Base.lproj/Main.storyboard diff --git a/ios/Runner/Info.plist b/apps/mobile_app/ios/Runner/Info.plist similarity index 100% rename from ios/Runner/Info.plist rename to apps/mobile_app/ios/Runner/Info.plist diff --git a/ios/Runner/Runner-Bridging-Header.h b/apps/mobile_app/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from ios/Runner/Runner-Bridging-Header.h rename to apps/mobile_app/ios/Runner/Runner-Bridging-Header.h diff --git a/ios/RunnerTests/RunnerTests.swift b/apps/mobile_app/ios/RunnerTests/RunnerTests.swift similarity index 100% rename from ios/RunnerTests/RunnerTests.swift rename to apps/mobile_app/ios/RunnerTests/RunnerTests.swift diff --git a/apps/mobile_app/lib/app_router_config.dart b/apps/mobile_app/lib/app_router_config.dart new file mode 100644 index 00000000..d9f58b30 --- /dev/null +++ b/apps/mobile_app/lib/app_router_config.dart @@ -0,0 +1,52 @@ +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 navigatorKey = GlobalKey(); + +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().setRouter(appRouter); +} diff --git a/apps/mobile_app/lib/main.dart b/apps/mobile_app/lib/main.dart new file mode 100644 index 00000000..edda0d51 --- /dev/null +++ b/apps/mobile_app/lib/main.dart @@ -0,0 +1,30 @@ +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:navigation/navigation_module.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + navigationModule(); + configureAppRouter(); + themePackages(); + + runApp(const ProviderScope(child: PlatformApp())); +} + +class PlatformApp extends ConsumerWidget { + const PlatformApp({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return MaterialApp.router( + title: 'SaveFamily', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF329E95)), + ), + routerConfig: appRouter, + debugShowCheckedModeBanner: false, + ); + } +} diff --git a/linux/.gitignore b/apps/mobile_app/linux/.gitignore similarity index 100% rename from linux/.gitignore rename to apps/mobile_app/linux/.gitignore diff --git a/linux/CMakeLists.txt b/apps/mobile_app/linux/CMakeLists.txt similarity index 100% rename from linux/CMakeLists.txt rename to apps/mobile_app/linux/CMakeLists.txt diff --git a/linux/flutter/CMakeLists.txt b/apps/mobile_app/linux/flutter/CMakeLists.txt similarity index 100% rename from linux/flutter/CMakeLists.txt rename to apps/mobile_app/linux/flutter/CMakeLists.txt diff --git a/linux/flutter/generated_plugin_registrant.cc b/apps/mobile_app/linux/flutter/generated_plugin_registrant.cc similarity index 100% rename from linux/flutter/generated_plugin_registrant.cc rename to apps/mobile_app/linux/flutter/generated_plugin_registrant.cc diff --git a/linux/flutter/generated_plugin_registrant.h b/apps/mobile_app/linux/flutter/generated_plugin_registrant.h similarity index 100% rename from linux/flutter/generated_plugin_registrant.h rename to apps/mobile_app/linux/flutter/generated_plugin_registrant.h diff --git a/linux/flutter/generated_plugins.cmake b/apps/mobile_app/linux/flutter/generated_plugins.cmake similarity index 100% rename from linux/flutter/generated_plugins.cmake rename to apps/mobile_app/linux/flutter/generated_plugins.cmake diff --git a/linux/runner/CMakeLists.txt b/apps/mobile_app/linux/runner/CMakeLists.txt similarity index 100% rename from linux/runner/CMakeLists.txt rename to apps/mobile_app/linux/runner/CMakeLists.txt diff --git a/linux/runner/main.cc b/apps/mobile_app/linux/runner/main.cc similarity index 100% rename from linux/runner/main.cc rename to apps/mobile_app/linux/runner/main.cc diff --git a/linux/runner/my_application.cc b/apps/mobile_app/linux/runner/my_application.cc similarity index 100% rename from linux/runner/my_application.cc rename to apps/mobile_app/linux/runner/my_application.cc diff --git a/linux/runner/my_application.h b/apps/mobile_app/linux/runner/my_application.h similarity index 100% rename from linux/runner/my_application.h rename to apps/mobile_app/linux/runner/my_application.h diff --git a/macos/.gitignore b/apps/mobile_app/macos/.gitignore similarity index 100% rename from macos/.gitignore rename to apps/mobile_app/macos/.gitignore diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/apps/mobile_app/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from macos/Flutter/Flutter-Debug.xcconfig rename to apps/mobile_app/macos/Flutter/Flutter-Debug.xcconfig diff --git a/macos/Flutter/Flutter-Release.xcconfig b/apps/mobile_app/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from macos/Flutter/Flutter-Release.xcconfig rename to apps/mobile_app/macos/Flutter/Flutter-Release.xcconfig diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/apps/mobile_app/macos/Flutter/GeneratedPluginRegistrant.swift similarity index 100% rename from macos/Flutter/GeneratedPluginRegistrant.swift rename to apps/mobile_app/macos/Flutter/GeneratedPluginRegistrant.swift diff --git a/macos/Runner.xcodeproj/project.pbxproj b/apps/mobile_app/macos/Runner.xcodeproj/project.pbxproj similarity index 100% rename from macos/Runner.xcodeproj/project.pbxproj rename to apps/mobile_app/macos/Runner.xcodeproj/project.pbxproj diff --git a/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/mobile_app/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/mobile_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to apps/mobile_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/apps/mobile_app/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from macos/Runner.xcworkspace/contents.xcworkspacedata rename to apps/mobile_app/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/mobile_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/mobile_app/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/macos/Runner/AppDelegate.swift b/apps/mobile_app/macos/Runner/AppDelegate.swift similarity index 100% rename from macos/Runner/AppDelegate.swift rename to apps/mobile_app/macos/Runner/AppDelegate.swift diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to apps/mobile_app/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/macos/Runner/Base.lproj/MainMenu.xib b/apps/mobile_app/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from macos/Runner/Base.lproj/MainMenu.xib rename to apps/mobile_app/macos/Runner/Base.lproj/MainMenu.xib diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/apps/mobile_app/macos/Runner/Configs/AppInfo.xcconfig similarity index 100% rename from macos/Runner/Configs/AppInfo.xcconfig rename to apps/mobile_app/macos/Runner/Configs/AppInfo.xcconfig diff --git a/macos/Runner/Configs/Debug.xcconfig b/apps/mobile_app/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from macos/Runner/Configs/Debug.xcconfig rename to apps/mobile_app/macos/Runner/Configs/Debug.xcconfig diff --git a/macos/Runner/Configs/Release.xcconfig b/apps/mobile_app/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from macos/Runner/Configs/Release.xcconfig rename to apps/mobile_app/macos/Runner/Configs/Release.xcconfig diff --git a/macos/Runner/Configs/Warnings.xcconfig b/apps/mobile_app/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from macos/Runner/Configs/Warnings.xcconfig rename to apps/mobile_app/macos/Runner/Configs/Warnings.xcconfig diff --git a/macos/Runner/DebugProfile.entitlements b/apps/mobile_app/macos/Runner/DebugProfile.entitlements similarity index 100% rename from macos/Runner/DebugProfile.entitlements rename to apps/mobile_app/macos/Runner/DebugProfile.entitlements diff --git a/macos/Runner/Info.plist b/apps/mobile_app/macos/Runner/Info.plist similarity index 100% rename from macos/Runner/Info.plist rename to apps/mobile_app/macos/Runner/Info.plist diff --git a/macos/Runner/MainFlutterWindow.swift b/apps/mobile_app/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from macos/Runner/MainFlutterWindow.swift rename to apps/mobile_app/macos/Runner/MainFlutterWindow.swift diff --git a/macos/Runner/Release.entitlements b/apps/mobile_app/macos/Runner/Release.entitlements similarity index 100% rename from macos/Runner/Release.entitlements rename to apps/mobile_app/macos/Runner/Release.entitlements diff --git a/macos/RunnerTests/RunnerTests.swift b/apps/mobile_app/macos/RunnerTests/RunnerTests.swift similarity index 100% rename from macos/RunnerTests/RunnerTests.swift rename to apps/mobile_app/macos/RunnerTests/RunnerTests.swift diff --git a/apps/mobile_app/pubspec.lock b/apps/mobile_app/pubspec.lock new file mode 100644 index 00000000..f73b7219 --- /dev/null +++ b/apps/mobile_app/pubspec.lock @@ -0,0 +1,690 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + auth: + dependency: "direct main" + description: + path: "../../modules/auth" + relative: true + source: path + version: "0.0.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dashboard_shell: + dependency: "direct main" + description: + path: "../../modules/dashboard_shell" + relative: true + source: path + version: "0.0.1" + design_system: + dependency: "direct main" + description: + path: "../../packages/design_system" + relative: true + source: path + version: "0.0.1" + equatable: + dependency: transitive + description: + name: equatable + sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fl_chart: + dependency: transitive + description: + name: fl_chart + sha256: "7ca9a40f4eb85949190e54087be8b4d6ac09dc4c54238d782a34cf1f7c011de9" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_riverpod: + dependency: "direct main" + description: + name: flutter_riverpod + sha256: "9e2d6907f12cc7d23a846847615941bddee8709bf2bfd274acdf5e80bcf22fde" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: b9c2ad5872518a27507ab432d1fb97e8813b05f0fc693f9d40fad06d073e0678 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + 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" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: "84792561b731b6463d053e9761a5236da967c369da10b134b8585a5e18429956" + url: "https://pub.dev" + source: hosted + version: "9.0.5" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: c92d18e1fe994cb06d48aa786c46b142a5633067e8297cff6b5a3ac742620104 + url: "https://pub.dev" + source: hosted + version: "17.0.0" + home: + dependency: "direct main" + description: + path: "../../modules/home" + relative: true + source: path + version: "0.0.1" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + navigation: + dependency: "direct main" + description: + path: "../../packages/navigation" + 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: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + notifications: + dependency: "direct main" + description: + path: "../../modules/notifications" + relative: true + source: path + version: "0.0.1" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.dev" + source: hosted + version: "7.0.1" + pool: + dependency: transitive + description: + name: pool + sha256: "978783255c543aa3586a1b3c21f6e9d720eb315376a915872c61ef8b5c20177d" + url: "https://pub.dev" + source: hosted + version: "1.5.2" + profile: + dependency: "direct main" + description: + path: "../../modules/profile" + 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: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + riverpod: + dependency: transitive + description: + name: riverpod + sha256: c406de02bff19d920b832bddfb8283548bfa05ce41c59afba57ce643e116aa59 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + sf_shared: + dependency: "direct overridden" + description: + path: "../../packages/sf_shared" + relative: true + source: path + version: "0.0.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + state_notifier: + dependency: transitive + description: + name: state_notifier + sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb + url: "https://pub.dev" + source: hosted + version: "1.0.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: transitive + description: + name: test + sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb" + url: "https://pub.dev" + source: hosted + version: "1.26.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + url: "https://pub.dev" + source: hosted + version: "0.7.6" + test_core: + dependency: transitive + description: + name: test_core + sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a" + url: "https://pub.dev" + source: hosted + version: "0.6.11" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" + url: "https://pub.dev" + source: hosted + version: "1.1.4" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + xml: + dependency: transitive + description: + name: xml + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.29.0" diff --git a/apps/mobile_app/pubspec.yaml b/apps/mobile_app/pubspec.yaml new file mode 100644 index 00000000..5c2bce0f --- /dev/null +++ b/apps/mobile_app/pubspec.yaml @@ -0,0 +1,106 @@ +name: sf_app_platform +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.9.2 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + 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 + auth: + path: ../../modules/auth + home: + path: ../../modules/home + profile: + path: ../../modules/profile + notifications: + 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. + cupertino_icons: ^1.0.8 + flutter_svg: ^2.2.1 + + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/ui/ + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package diff --git a/apps/mobile_app/pubspec_overrides.yaml b/apps/mobile_app/pubspec_overrides.yaml new file mode 100644 index 00000000..6d49b309 --- /dev/null +++ b/apps/mobile_app/pubspec_overrides.yaml @@ -0,0 +1,18 @@ +# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared +dependency_overrides: + auth: + path: ../../modules/auth + dashboard_shell: + path: ../../modules/dashboard_shell + design_system: + path: ../../packages/design_system + home: + path: ../../modules/home + navigation: + path: ../../packages/navigation + notifications: + path: ../../modules/notifications + profile: + path: ../../modules/profile + sf_shared: + path: ../../packages/sf_shared diff --git a/test/widget_test.dart b/apps/mobile_app/test/widget_test.dart similarity index 100% rename from test/widget_test.dart rename to apps/mobile_app/test/widget_test.dart diff --git a/web/favicon.png b/apps/mobile_app/web/favicon.png similarity index 100% rename from web/favicon.png rename to apps/mobile_app/web/favicon.png diff --git a/web/icons/Icon-192.png b/apps/mobile_app/web/icons/Icon-192.png similarity index 100% rename from web/icons/Icon-192.png rename to apps/mobile_app/web/icons/Icon-192.png diff --git a/web/icons/Icon-512.png b/apps/mobile_app/web/icons/Icon-512.png similarity index 100% rename from web/icons/Icon-512.png rename to apps/mobile_app/web/icons/Icon-512.png diff --git a/web/icons/Icon-maskable-192.png b/apps/mobile_app/web/icons/Icon-maskable-192.png similarity index 100% rename from web/icons/Icon-maskable-192.png rename to apps/mobile_app/web/icons/Icon-maskable-192.png diff --git a/web/icons/Icon-maskable-512.png b/apps/mobile_app/web/icons/Icon-maskable-512.png similarity index 100% rename from web/icons/Icon-maskable-512.png rename to apps/mobile_app/web/icons/Icon-maskable-512.png diff --git a/web/index.html b/apps/mobile_app/web/index.html similarity index 100% rename from web/index.html rename to apps/mobile_app/web/index.html diff --git a/web/manifest.json b/apps/mobile_app/web/manifest.json similarity index 100% rename from web/manifest.json rename to apps/mobile_app/web/manifest.json diff --git a/windows/.gitignore b/apps/mobile_app/windows/.gitignore similarity index 100% rename from windows/.gitignore rename to apps/mobile_app/windows/.gitignore diff --git a/windows/CMakeLists.txt b/apps/mobile_app/windows/CMakeLists.txt similarity index 100% rename from windows/CMakeLists.txt rename to apps/mobile_app/windows/CMakeLists.txt diff --git a/windows/flutter/CMakeLists.txt b/apps/mobile_app/windows/flutter/CMakeLists.txt similarity index 100% rename from windows/flutter/CMakeLists.txt rename to apps/mobile_app/windows/flutter/CMakeLists.txt diff --git a/windows/flutter/generated_plugin_registrant.cc b/apps/mobile_app/windows/flutter/generated_plugin_registrant.cc similarity index 100% rename from windows/flutter/generated_plugin_registrant.cc rename to apps/mobile_app/windows/flutter/generated_plugin_registrant.cc diff --git a/windows/flutter/generated_plugin_registrant.h b/apps/mobile_app/windows/flutter/generated_plugin_registrant.h similarity index 100% rename from windows/flutter/generated_plugin_registrant.h rename to apps/mobile_app/windows/flutter/generated_plugin_registrant.h diff --git a/windows/flutter/generated_plugins.cmake b/apps/mobile_app/windows/flutter/generated_plugins.cmake similarity index 100% rename from windows/flutter/generated_plugins.cmake rename to apps/mobile_app/windows/flutter/generated_plugins.cmake diff --git a/windows/runner/CMakeLists.txt b/apps/mobile_app/windows/runner/CMakeLists.txt similarity index 100% rename from windows/runner/CMakeLists.txt rename to apps/mobile_app/windows/runner/CMakeLists.txt diff --git a/windows/runner/Runner.rc b/apps/mobile_app/windows/runner/Runner.rc similarity index 100% rename from windows/runner/Runner.rc rename to apps/mobile_app/windows/runner/Runner.rc diff --git a/windows/runner/flutter_window.cpp b/apps/mobile_app/windows/runner/flutter_window.cpp similarity index 100% rename from windows/runner/flutter_window.cpp rename to apps/mobile_app/windows/runner/flutter_window.cpp diff --git a/windows/runner/flutter_window.h b/apps/mobile_app/windows/runner/flutter_window.h similarity index 100% rename from windows/runner/flutter_window.h rename to apps/mobile_app/windows/runner/flutter_window.h diff --git a/windows/runner/main.cpp b/apps/mobile_app/windows/runner/main.cpp similarity index 100% rename from windows/runner/main.cpp rename to apps/mobile_app/windows/runner/main.cpp diff --git a/windows/runner/resource.h b/apps/mobile_app/windows/runner/resource.h similarity index 100% rename from windows/runner/resource.h rename to apps/mobile_app/windows/runner/resource.h diff --git a/windows/runner/resources/app_icon.ico b/apps/mobile_app/windows/runner/resources/app_icon.ico similarity index 100% rename from windows/runner/resources/app_icon.ico rename to apps/mobile_app/windows/runner/resources/app_icon.ico diff --git a/windows/runner/runner.exe.manifest b/apps/mobile_app/windows/runner/runner.exe.manifest similarity index 100% rename from windows/runner/runner.exe.manifest rename to apps/mobile_app/windows/runner/runner.exe.manifest diff --git a/windows/runner/utils.cpp b/apps/mobile_app/windows/runner/utils.cpp similarity index 100% rename from windows/runner/utils.cpp rename to apps/mobile_app/windows/runner/utils.cpp diff --git a/windows/runner/utils.h b/apps/mobile_app/windows/runner/utils.h similarity index 100% rename from windows/runner/utils.h rename to apps/mobile_app/windows/runner/utils.h diff --git a/windows/runner/win32_window.cpp b/apps/mobile_app/windows/runner/win32_window.cpp similarity index 100% rename from windows/runner/win32_window.cpp rename to apps/mobile_app/windows/runner/win32_window.cpp diff --git a/windows/runner/win32_window.h b/apps/mobile_app/windows/runner/win32_window.h similarity index 100% rename from windows/runner/win32_window.h rename to apps/mobile_app/windows/runner/win32_window.h diff --git a/lib/main.dart b/lib/main.dart deleted file mode 100644 index 8bf97999..00000000 --- a/lib/main.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:sf_app_platform/payments/apps/di_container.dart'; -import 'package:sf_app_platform/payments/domain/ports/theme_port.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart' hide Provider; - -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/account_created_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/add_kid_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/alert_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/core/dashboard_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/errors/connection_error_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/errors/no_plan_error_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/errors/server_error_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/kid_wallet_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/link_phone_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/loading_google_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/loading_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/restore_password/restore_password_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/settings_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/signup/signup_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/welcome_screen.dart'; - -Future main() async { - // DI bootstrap - final di = await DiContainer.bootstrap(); - - runApp(PlatformApp(di: di)); -} - -class PlatformApp extends StatelessWidget { - final DiContainer di; - const PlatformApp({super.key, required this.di}); - - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return MultiProvider( - providers: [ - // Puertos (desde DI) - Provider.value(value: di.theme) - ], - child: ProviderScope(child: MaterialApp( - title: 'SaveFamily', - theme: ThemeData( - // This is the theme of your application. - // - // TRY THIS: Try running your application with "flutter run". You'll see - // the application has a purple toolbar. Then, without quitting the app, - // try changing the seedColor in the colorScheme below to Colors.green - // and then invoke "hot reload" (save your changes or press the "hot - // reload" button in a Flutter-supported IDE, or press "r" if you used - // the command line to start the app). - // - // Notice that the counter didn't reset back to zero; the application - // state is not lost during the reload. To reset the state, use hot - // restart instead. - // - // This works for code too, not just values: Most code changes can be - // tested with just a hot reload. - colorScheme: ColorScheme.fromSeed(seedColor: Color(0xFF329E95)), - ), - home: DashboardScreen(), - )) - ); - } -} \ No newline at end of file diff --git a/lib/payments/apps/di_container.dart b/lib/payments/apps/di_container.dart deleted file mode 100644 index 8dea0bd3..00000000 --- a/lib/payments/apps/di_container.dart +++ /dev/null @@ -1,17 +0,0 @@ -import '../domain/ports/theme_port.dart'; -import '../infrastructure/adapteres/theme_adapter/theme_sf_adapter.dart'; - -class DiContainer{ - final ThemePort theme; - - DiContainer._({ - required this.theme - }); - - static Future bootstrap({Map? overrides}) async { - //assets y temas - final ThemePort theme = ThemeSfAdapter(); - - return DiContainer._(theme: theme); - } -} \ No newline at end of file diff --git a/lib/payments/domain/ports/theme_port.dart b/lib/payments/domain/ports/theme_port.dart deleted file mode 100644 index 7d4999c3..00000000 --- a/lib/payments/domain/ports/theme_port.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'dart:ui'; - -enum ThemeCode{ - background_primary, - background_secondary, - background_tertiary, - text_primary, - text_secondary, - text_tertiary, - button_primary, - button_secondary -} - -abstract class ThemePort { - late Map theme; - late List> cardColors; - - Color getColorFor(ThemeCode code){ - Color? c = theme[code]; - if (c == null) { - throw Exception("Theme key not found"); - } - return c; - } - - List getCardColorFor(int index){ - return cardColors[index % cardColors.length]; - } - -} \ No newline at end of file diff --git a/lib/payments/infrastructure/adapteres/theme_adapter/theme_sf_adapter.dart b/lib/payments/infrastructure/adapteres/theme_adapter/theme_sf_adapter.dart deleted file mode 100644 index 4d77b721..00000000 --- a/lib/payments/infrastructure/adapteres/theme_adapter/theme_sf_adapter.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'dart:collection'; -import 'dart:ui'; - -import 'package:flutter/material.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class ThemeSfAdapter extends ThemePort{ - - @override - Map theme = HashMap.from( - { - ThemeCode.background_primary: Color(0xFFFFFFFF), - ThemeCode.background_secondary: Color(0xFFF7F7F7), - ThemeCode.background_tertiary: Color(0x4D329E95), - ThemeCode.text_primary: Color(0xFF4B4B4B), - ThemeCode.text_secondary: Color(0xFFFFFFFF), - ThemeCode.text_tertiary: Color(0xFFE0E0E0), - ThemeCode.button_primary: Color(0xFF329e95), - ThemeCode.button_secondary: Color(0xFF4B4B4B) - } - ); - - @override - List> cardColors = [ - [ - Color(0xFFFA5C9F), - Color(0xFFEB2579), - Color(0xFFE60866), - ], - [ - Color(0xFF00A1C6), - Color(0xFF00819E), - ], - ]; - -} \ No newline at end of file diff --git a/lib/payments/view/screens/account_created_screen.dart b/lib/payments/view/screens/account_created_screen.dart deleted file mode 100644 index 4d63d2ef..00000000 --- a/lib/payments/view/screens/account_created_screen.dart +++ /dev/null @@ -1,45 +0,0 @@ -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 '../../domain/ports/theme_port.dart'; - -class AccountCreatedScreen extends StatelessWidget { - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final email = "usuario@example.com"; - final fullName = "Carlos Pérez Cruz"; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_primary), - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 20, - children: [ - Spacer(flex: 10), - Icon(Icons.check, color: theme.getColorFor(ThemeCode.background_primary), size: 50), - Text("Cuenta creada", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)), - Text.rich(TextSpan(text:"Has creado la cuenta para:\n", - children: [TextSpan(text: fullName, style: TextStyle(fontWeight: FontWeight.bold))])), - Text.rich(TextSpan(text:"Hemos enviado un email de verificación a:\n", - children: [TextSpan(text: email, style: TextStyle(fontWeight: FontWeight.bold))])), - Text("Crea la cuenta de tu peque e ingresa su \nprimera paga para utilizarla con su reloj"), - FilledButton(onPressed: ()=>{ - Navigator.pushReplacement(context, MaterialPageRoute(builder: (_)=>AddKidScreen())) - }, child: Text("Continuar")), - Spacer(flex: 8) - ], - ), - ) - ) - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/activity_screen.dart b/lib/payments/view/screens/activity_screen.dart deleted file mode 100644 index f47ba8e7..00000000 --- a/lib/payments/view/screens/activity_screen.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/activity_list.dart'; -import 'package:sf_app_platform/payments/view/screens/core/line_graph.dart'; - -import '../../domain/ports/theme_port.dart'; - -class ActivityScreen extends StatefulWidget{ - const ActivityScreen({super.key}); - - @override - State createState() => ActivityScreenState(); -} - -class ActivityScreenState extends State{ - final activity = [ - {"type": "goal"}, - {"type": "wage", "amount": 5}, - {"type": "lock"}, - {"type": "lock"} - ]; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final content = [ - Text("Movimientos recientes", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),), - Row( - spacing: 20, - children: [ - FilledButton(onPressed: ()=>{}, child: Text("Hoy")), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Última semana")), - TextButton(onPressed: ()=>{}, child: Text("Mes")) - ], - ), - SizedBox(height: 200, child: LineGraph()), - ActivityList(activity: activity, edit: false) - ]; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Container( - margin: EdgeInsets.fromLTRB(30, 30, 30, 0), - child: Center(child: ListView.separated( - itemBuilder: (BuildContext context, int index) {return content[index];}, - separatorBuilder: (BuildContext context, int index) { - return Divider(color: Colors.transparent, height: 30); - }, - itemCount: content.length) - ) - ) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/alert_screen.dart b/lib/payments/view/screens/alert_screen.dart deleted file mode 100644 index 2c7016e8..00000000 --- a/lib/payments/view/screens/alert_screen.dart +++ /dev/null @@ -1,55 +0,0 @@ -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/core/activity_list.dart'; - -class AlertScreen extends StatefulWidget { - const AlertScreen({super.key}); - - @override - State createState() => AlertScreenState(); -} - -class AlertScreenState extends State { - - final activity = [ - {"type": "goal"}, - {"type": "wage", "amount": 5}, - {"type": "lock"}, - {"type": "lock"} - ]; - bool edit = false; - - @override - void initState() { - edit = false; - super.initState(); - } - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Container( - margin: EdgeInsets.all(30), - child: Column( - children: [ - Row( - children: [ - Text("Alertas"), - Spacer(), - TextButton( - onPressed: () => setState(() {edit = !edit;}), - child: Text("Editar")) - ], - ), - ActivityList(activity: activity, edit: edit) - ], - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/contact_screen.dart b/lib/payments/view/screens/contact_screen.dart deleted file mode 100644 index d7fea3ee..00000000 --- a/lib/payments/view/screens/contact_screen.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class ContactScreen extends StatelessWidget{ - - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 10, - children: [ - Text("Contáctanos", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Text("Trasládanos tus dudas e intentaremos responderte lo antes posible"), - DropdownMenu( - initialSelection: "es", - label: Text("País"), - dropdownMenuEntries: [ - DropdownMenuEntry(value: "es", label: "España"), - DropdownMenuEntry(value: "fr", label: "Francia"), - DropdownMenuEntry(value: "pt", label: "Portugal"), - ] - ), - DropdownMenu( - initialSelection: "online", - label: Text("Canal de compra"), - dropdownMenuEntries: [ - DropdownMenuEntry(value: "online", label: "SF online shop"), - ] - ), - Expanded(child: TextField( - decoration: InputDecoration( - labelText: "Nombre", - hintText: "Nombre y apellidos", - border: OutlineInputBorder() - ) - )), - Expanded(child: TextField( - decoration: InputDecoration( - labelText: "Correo electrónico", - hintText: "Correo electrónico", - border: OutlineInputBorder() - ) - )), - Expanded(child: TextField( - minLines: 3, - maxLines: 3, - decoration: InputDecoration( - labelText: "Asunto del mensaje", - hintText: "Escribe tu mensaje", - border: OutlineInputBorder() - ) - )), - Expanded(child: FilledButton(onPressed: ()=>Navigator.pop(context), child: Text("Enviar"))) - ], - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/core/activity_list.dart b/lib/payments/view/screens/core/activity_list.dart deleted file mode 100644 index 7a7ef483..00000000 --- a/lib/payments/view/screens/core/activity_list.dart +++ /dev/null @@ -1,87 +0,0 @@ -import 'dart:developer'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class ActivityList extends StatefulWidget { - final List activity; - bool edit = false; - - ActivityList({super.key, required this.activity, required this.edit}); - - @override - State createState() => ActivityListState(); -} - -class ActivityListState extends State{ - - late List values; - - @override - void initState() { - values = List.generate(widget.activity.length, (_)=>false); - super.initState(); - } - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final colors = [Colors.cyan, Colors.pinkAccent, Colors.deepOrangeAccent, Colors.red]; - final icons = {"wage": Icons.wallet, "goal": Icons.emoji_events_outlined, "lock": Icons.lock_outline, "reload": Icons.attach_money_outlined}; - final titles = {"wage": "Entrega de paga", "goal": "¡Objetivo cumplido!", "lock": "Bloqueo de pago", "reload": "Recarga familiar"}; - - return Column( - spacing: 20, - children: List.generate(widget.activity.length, (int index) { - var logItem = Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - border: BoxBorder.fromLTRB(left: BorderSide( - color: colors[index % colors.length], width: 5)) - ), - child: Column( - spacing: 15, - children: [ - Row( - children: [ - Icon(icons[widget.activity[index]["type"]], - color: colors[index % colors.length]), - Text(titles[widget.activity[index]["type"]]!, - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16)), - Spacer(), - Text("14/01/2005") - ] - ), - Align( - alignment: Alignment.topLeft, - child: Text("Ana ya tiene su paga de 5€ en el reloj"), - ) - ] - ) - ); - - if (widget.edit) { - return Row(children: [ - Checkbox( - value: values[index], - onChanged: (value) => { - setState(() { - values[index] = !values[index]; - })}, - activeColor: theme.getColorFor(ThemeCode.button_primary), - semanticLabel: "Eliminar"), - Expanded(child: logItem) - ]); - } else { - return logItem; - } - }) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/core/dashboard_screen.dart b/lib/payments/view/screens/core/dashboard_screen.dart deleted file mode 100644 index 65b699f2..00000000 --- a/lib/payments/view/screens/core/dashboard_screen.dart +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/activity_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/alert_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/home_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/profile_screen.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class DashboardScreen extends StatefulWidget { - const DashboardScreen({super.key}); - - @override - State createState() => _DashboardScreenState(); -} - -class _DashboardScreenState extends State{ - - int currentPageIndex = 0; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final bodies = [ - HomeScreen(), - ActivityScreen(), - AlertScreen(), - ProfileScreen() - ]; - - return Scaffold( - bottomNavigationBar: NavigationBar( - backgroundColor: theme.getColorFor(ThemeCode.background_primary), - 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], - ); - } - - -} \ No newline at end of file diff --git a/lib/payments/view/screens/core/deposit_block.dart b/lib/payments/view/screens/core/deposit_block.dart deleted file mode 100644 index cf5ed669..00000000 --- a/lib/payments/view/screens/core/deposit_block.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class DepositBlock extends StatelessWidget{ - final double max; - - const DepositBlock({super.key, required this.max}); - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration(color: theme.getColorFor(ThemeCode.background_primary), borderRadius: BorderRadius.all(Radius.circular(20))), - margin: EdgeInsets.only(top: 10), - child: Column( - children: [ - Text("Ingresar dinero en el wallet", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Row( - spacing: 10, - children: [ - Expanded( - child: TextField( - decoration: InputDecoration(labelText: "Cantidad", hintText: "0€", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly - ] - ) - ), - FilledButton( - onPressed: ()=>{}, - style: ButtonStyle(backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_primary))), - child: Text("Ingresar") - ) - ], - ), - Align( - alignment: Alignment.topLeft, - child: Text("Máximo que puedes añadir: $max€"), - ) - ], - ), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/core/line_graph.dart b/lib/payments/view/screens/core/line_graph.dart deleted file mode 100644 index 3b3b30b3..00000000 --- a/lib/payments/view/screens/core/line_graph.dart +++ /dev/null @@ -1,169 +0,0 @@ -import 'dart:developer'; - -import 'package:flutter/material.dart'; -import 'package:fl_chart/fl_chart.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class LineGraph extends StatefulWidget { - final lines = [[0,1,0,1,0,1,0],[1,0,1,0,1,0,1]]; - - LineGraph({super.key}); - - @override - State createState() => LineGraphState(); -} - -class LineGraphState extends State { - - final weekDays = ["L", "M", "X", "J", "V", "S", "D"]; - String? timeSpan; - late var days = weekDays; - - @override - void initState() { - timeSpan = "week"; - super.initState(); - } - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Container( - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - border: BoxBorder.fromLTRB(left: BorderSide(color: Colors.cyan, width: 5)), - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column( - spacing: 10, - children: [ - Row(children: [ - Text("Gastos", style: TextStyle(fontWeight: FontWeight.bold)), - Spacer(), - Container( - padding: EdgeInsets.symmetric(horizontal: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: theme.getColorFor(ThemeCode.background_secondary), - ), - child: DropdownButton( - underline: Container(), - value: timeSpan, - onChanged: (String? value) { - setState(() { - timeSpan = value; - }); - }, - dropdownColor: theme.getColorFor(ThemeCode.background_primary), - items: [ - DropdownMenuItem(value: "day", child: Text("Hoy")), - DropdownMenuItem(value: "week", child: Text("Esta semana")), - DropdownMenuItem(value: "month", child: Text("Este mes")), - ] - ), - ) - ]), - Expanded(child: LineChart(LineChartData( - gridData: FlGridData( - show: true, - drawHorizontalLine: false, - drawVerticalLine: true, - verticalInterval: 1 - ), - titlesData: FlTitlesData( - //show: false, - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - reservedSize: 40, - getTitlesWidget: (double value, TitleMeta meta)=>SideTitleWidget( - space: 4, - meta: meta, - /*fitInside: fitInsideBottomTitle - ? SideTitleFitInsideData.fromTitleMeta(meta, distanceFromEdge: 0) - : SideTitleFitInsideData.disable(),*/ - child: Text( - weekDays[value.toInt()] - ), - ), - ), - ), - leftTitles: AxisTitles(), - topTitles: AxisTitles(), - rightTitles: AxisTitles() - ), - lineTouchData: LineTouchData( - touchTooltipData: LineTouchTooltipData( - getTooltipColor: (touchedSpot) => theme.getColorFor(ThemeCode.button_secondary), - getTooltipItems: (List touchedBarSpots){ - return touchedBarSpots.map( - (barSpot) { - return LineTooltipItem("${barSpot.y} €", TextStyle(color: theme.getColorFor(ThemeCode.text_secondary))); - } - ).toList(); - } - ) - ), - borderData: FlBorderData( - show: true, - border: Border( - bottom: BorderSide( - color: Colors.lightBlue.withValues(alpha: 0.2), - width: 4 - ), - left: const BorderSide(color: Colors.transparent), - right: const BorderSide(color: Colors.transparent), - top: const BorderSide(color: Colors.transparent), - ), - ), - lineBarsData: [ - LineChartBarData( - isCurved: true, - color: Colors.pink, - barWidth: 5, - isStrokeCapRound: true, - dotData: const FlDotData(show: false), - belowBarData: BarAreaData(show: false), - spots: const [ - FlSpot(0, 1), - FlSpot(1, 0), - FlSpot(2, 1), - FlSpot(3, 0), - FlSpot(4, 1), - FlSpot(5, 0), - FlSpot(6, 1), - ], - ), - LineChartBarData( - isCurved: true, - color: Colors.cyan, - barWidth: 5, - isStrokeCapRound: true, - dotData: const FlDotData(show: false), - belowBarData: BarAreaData(show: false), - spots: const [ - FlSpot(0, 0), - FlSpot(1, 1), - FlSpot(2, 0), - FlSpot(3, 1), - FlSpot(4, 0), - FlSpot(5, 1), - FlSpot(6, 0), - ], - ), - ], - minX: 0, - maxX: days.length-1, - maxY: 1, - minY: 0, - ))) - ], - ), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/core/wallet_management_layout.dart b/lib/payments/view/screens/core/wallet_management_layout.dart deleted file mode 100644 index d66573ae..00000000 --- a/lib/payments/view/screens/core/wallet_management_layout.dart +++ /dev/null @@ -1,70 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/entities/kid.dart'; -import '../../../domain/ports/theme_port.dart'; - -class WalletManagementLayout extends StatefulWidget { - final List children; - final Widget footer; - final Kid kid; - - const WalletManagementLayout({super.key, required this.kid, required this.children, required this.footer}); - - @override - State createState() => WalletManagementLayoutState(); -} - -class WalletManagementLayoutState extends State{ - - @override - Widget build(BuildContext context) { - final theme = context.read(); - - final content = [ - Container( - padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20), - child: Stack( - children: [ - IconButton(onPressed: ()=>Navigator.pop(context), icon: Icon(Icons.arrow_back_ios_outlined, color: theme.getColorFor(ThemeCode.text_secondary))), - Expanded(child: Center(child: Column(children: [ - Text(widget.kid.name, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30, color: theme.getColorFor(ThemeCode.text_secondary))), - Text.rich(TextSpan( - text: "Saldo disponible: ", - style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary)), - children: [ - TextSpan(text: "${widget.kid.balance}", style: TextStyle(fontWeight: FontWeight.bold, color: theme.getColorFor(ThemeCode.text_secondary))), - TextSpan(text: "€", style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary))) - ])) - ]))) - ], - ) - ), - ...widget.children - ]; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Stack(children: [ - DecoratedBox( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(30)), - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: theme.getCardColorFor(0) - ), - ), - child: SizedBox(width: double.infinity, height: 200), - ), - Column(children: [ - Expanded(child: ListView.separated( - itemBuilder: (BuildContext context, int index) {return Container(margin: EdgeInsets.symmetric(horizontal: 20), child: content[index]);}, - separatorBuilder: (BuildContext context, int index) {return Divider(height: 30, color: Colors.transparent);}, - itemCount: content.length)), - widget.footer - ]) - ]) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/deposit_screen.dart b/lib/payments/view/screens/deposit_screen.dart deleted file mode 100644 index d97f5611..00000000 --- a/lib/payments/view/screens/deposit_screen.dart +++ /dev/null @@ -1,183 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/wallet_management_layout.dart'; - -import '../../domain/entities/kid.dart'; -import '../../domain/ports/theme_port.dart'; - -class DepositScreen extends StatefulWidget{ - final Kid kid; - - const DepositScreen({super.key, required this.kid}); - - @override - State createState() => DepositScreenState(); - -} - -class DepositScreenState extends State{ - String reason = "other"; - bool program = false; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return WalletManagementLayout( - kid: widget.kid, - children: [ - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Ingresar dinero en el wallet", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - TextField( - decoration: InputDecoration(labelText: "Cantidad", hintText: "0€", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly - ] - ), - Align( - alignment: Alignment.topLeft, - child: Text("Saldo total disponible después: 30 €") - ) - ], - ), - ), - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Motivo", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Este dato aparecerá en el reloj del peque"), - CheckboxListTile( - title: Text('Paga semanal'), - controlAffinity: ListTileControlAffinity.leading, - value: reason=="weekly", - onChanged: (value) { - setState(() { - reason="weekly"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Objetivo semanal cumplido'), - controlAffinity: ListTileControlAffinity.leading, - value: reason=="goal", - onChanged: (value) { - setState(() { - reason="goal"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Gastos extraordinarios'), - controlAffinity: ListTileControlAffinity.leading, - value: reason=="extraordinary", - onChanged: (value) { - setState(() { - reason="extraordinary"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Otro'), - controlAffinity: ListTileControlAffinity.leading, - value: reason=="other", - onChanged: (value) { - setState(() { - reason="other"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - TextField( - minLines: 3, - maxLines: 3, - maxLength: 150, - decoration: InputDecoration( - labelText: "Escribir mensaje a ${widget.kid.name} del motivo del ingreso", - hintText: "Escribe tu mensaje", - border: OutlineInputBorder(), - ) - ), - Align( - alignment: Alignment.topLeft, - child: Text("Máximo 150 caracteres") - ) - ], - ), - ), - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Cuándo se envía el dinero", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Este dato aparecerá en el reloj del peque"), - CheckboxListTile( - title: Text('Ahora'), - controlAffinity: ListTileControlAffinity.leading, - value: program==false, - onChanged: (value) { - setState(() { - program=false; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Programar'), - controlAffinity: ListTileControlAffinity.leading, - value: program==true, - onChanged: (value) { - setState(() { - program=true; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - if (program) TextField() - ], - ), - ), - ], - footer: Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column(children: [ - FilledButton(onPressed: ()=>{}, child: Container( - width: double.infinity, - padding: EdgeInsets.all(20), - child: Center(child: Text("Añadir dinero")) - )), - TextButton(onPressed: ()=>Navigator.pop(context), child: Text("Cancelar")) - ]) - ) - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/errors/no_plan_error_screen.dart b/lib/payments/view/screens/errors/no_plan_error_screen.dart deleted file mode 100644 index 3fbbc4cf..00000000 --- a/lib/payments/view/screens/errors/no_plan_error_screen.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/domain/ports/theme_port.dart'; - -class NoPlanErrorScreen extends StatelessWidget{ - - const NoPlanErrorScreen({super.key}); - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - children: [ - Spacer(flex: 3), - Text("Estamos mejorando el servicio", - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25) - ), - Text("Asocia tu reloj a SaveFamily y ayuda a tus peques a aprender a usar el dinero con responsabilidad"), - Container( - margin: EdgeInsets.symmetric(vertical: 20), - child: Column( - children: [ - Row(children: [ - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)), - Text("Desarrollarán hábitos financieros sanos") - ]), - Row(children: [ - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)), - Text("Gestiona sus gastos") - ]), - ], - ), - ), - Text("Selecciona tu plan en nuestra web y empieza a enseñar a los peques a entender el valor del dinero"), - Spacer(flex: 1), - FilledButton( - onPressed: ()=>{}, - child: Container( - width: double.infinity, - padding: EdgeInsets.all(20), - child: Text("Seleccionar plan") - ) - ), - Spacer(flex: 3) - ] - ), - ) - ) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/home_screen.dart b/lib/payments/view/screens/home_screen.dart deleted file mode 100644 index fd3be2b1..00000000 --- a/lib/payments/view/screens/home_screen.dart +++ /dev/null @@ -1,210 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/deposit_block.dart'; -import 'package:sf_app_platform/payments/view/screens/core/money_text.dart'; -import 'package:sf_app_platform/payments/view/screens/link_watch/create_profile_screen.dart'; - -import '../../domain/entities/kid.dart'; -import '../../domain/ports/theme_port.dart'; -import 'deposit_screen.dart'; -import 'kid_wallet_screen.dart'; - - -class HomeScreen extends StatelessWidget{ - final String name = "Juan"; - final double total = 95.03; - final List kids = [ - Kid(name:"Carlos", balance:25.47), - Kid(name:"Ana", balance:25.47), - ]; - late final double available = double.parse(kids.fold(total, (t, e) => t - e.balance).toStringAsFixed(2)); - - HomeScreen({super.key}); - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return SingleChildScrollView( child: Container( - color: theme.getColorFor(ThemeCode.background_secondary), - margin: EdgeInsets.all(30), - child: Column( - children: [ - Align( - alignment: Alignment.topLeft, - child: Text.rich( - TextSpan( - text: "Hola, ", - style: TextStyle(fontSize: 25), - children: [ - TextSpan(text: name, style: TextStyle(fontWeight: FontWeight.bold)), - ], - ), - ) - ), - walletsList(context, kids), - Align( - alignment: Alignment.topLeft, - child: TextButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>CreateProfileScreen())), - child: Text("+ Añadir otro peque", style: TextStyle( - fontWeight: FontWeight.bold, - color: theme.getColorFor(ThemeCode.text_primary) - )) - ) - ), - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration(color: theme.getColorFor(ThemeCode.background_primary), borderRadius: BorderRadius.all(Radius.circular(20))), - child: Column( - spacing: 5, - children: [ - Row( - children: [ - Text("Wallet", style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20 - )), - Spacer(), - MoneyText( - text: "$total€ total", - size: 25, - resize: true, - color: theme.getColorFor(ThemeCode.text_primary) - ) - ] - ), - Stack( - children: [ - LinearProgressIndicator( - value: available/total, - minHeight: 70, - borderRadius: BorderRadius.all(Radius.circular(16)), - color: theme.getColorFor(ThemeCode.button_primary), - backgroundColor: theme.getColorFor(ThemeCode.background_tertiary), - ), - FractionallySizedBox( - widthFactor: available/total, - child: Container( - padding: EdgeInsets.symmetric(vertical: 10), - child: Center( - child: MoneyText( - text: "$available€", - size: 35, - resize: true, - color: theme.getColorFor(ThemeCode.text_secondary) - ), - ) - ) - ), - ], - ), - Center(child: Text("Disponible")) - ], - ), - ), - DepositBlock(max: 150-total) - ] - ), - )); - } - - Widget walletsList(BuildContext context, List kids) { - final theme = context.read(); - - return Column( - spacing: 20, - children: List.generate(kids.length, (int index) { - return - GestureDetector( - onTap: ()=>{Navigator.push(context, MaterialPageRoute(builder: (_)=>KidWalletScreen(kid: kids[index])))}, - child: ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(16.0)), - child: Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 8), - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: theme.getCardColorFor(index) - ) - ), - child: Column( - children: [ - Align( - alignment: Alignment.topLeft, - child: Text(kids[index].name, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 25, - color: theme.getColorFor(ThemeCode.text_secondary) - ) - ) - ), - Row( - spacing: 10, - children: [ - SizedBox( - height: 60, - width: 60, - child: SvgPicture.asset("assets/images/ui/face.svg"), - ), - Spacer(), - Column(children: [ - MoneyText( - text: "${kids[index].balance}€", - size: 50, - resize: true, - color: theme.getColorFor(ThemeCode.text_secondary) - ), - Text("en su hucha", style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary))) - ]) - - ] - ), - Row( - children: [ - TextButton( - onPressed: ()=>showDialog( - context: context, - builder: (BuildContext context) => Dialog( - child: Container(height: 100, width: double.infinity, child: Column( - children: [ - FilledButton(onPressed: ()=>{}, child: Text("Cámara")), - OutlinedButton(onPressed: ()=>{}, child: Text("Galería de fotos")) - ], - )), - ) - ), - child: Row( - spacing: 10, - children: [ - Icon(Icons.edit, color: theme.getColorFor(ThemeCode.text_secondary)), - Text("Editar", style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary))) - ] - ) - ), - Spacer(), - FilledButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>DepositScreen(kid: kids[index]))), - style: ButtonStyle( - backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_secondary)), - ), - child: Container( - padding: EdgeInsets.symmetric(horizontal: 0,vertical: 10), - child: Text("+ Añadir dinero") - ) - ) - ], - ) - ] - ), - ) - ) - ); - }) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/kid_wallet_screen.dart b/lib/payments/view/screens/kid_wallet_screen.dart deleted file mode 100644 index 4679d7a6..00000000 --- a/lib/payments/view/screens/kid_wallet_screen.dart +++ /dev/null @@ -1,202 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/money_text.dart'; -import 'package:sf_app_platform/payments/view/screens/deposit_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/limits_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/wage_screen.dart'; - -import '../../domain/entities/kid.dart'; -import '../../domain/ports/theme_port.dart'; - -class KidWalletScreen extends StatefulWidget{ - final Kid kid; - - const KidWalletScreen({super.key, required this.kid}); - - @override - State createState() => _KidWalletScreenState(); -} - -class _KidWalletScreenState extends State { - - @override - Widget build(BuildContext context) { - - final theme = context.read(); - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Stack( - children: [ - DecoratedBox( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(30)), - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: theme.getCardColorFor(0) - ), - ), - child: SizedBox(width: double.infinity, height: 300), - ), - Container( - margin: EdgeInsets.symmetric(vertical: 50, horizontal: 20), - child: Column( - spacing: 15, - children: [ - Row( - spacing: 7, - children: [ - IconButton( - onPressed: ()=>Navigator.pop(context), - icon: Icon(Icons.arrow_back_ios_new_outlined, color: theme.getColorFor(ThemeCode.background_primary),) - ), - SizedBox(height: 50, child: SvgPicture.asset("assets/images/ui/face.svg")), - Text(widget.kid.name, - style: TextStyle( - color: theme.getColorFor(ThemeCode.background_primary), - fontWeight: FontWeight.bold, - fontSize: 20 - ) - ), - Spacer(), - SizedBox(height: 30, child: SvgPicture.asset("assets/images/ui/face.svg")), - ], - ), - MoneyText( - text: "${widget.kid.balance.toString()}€", - size: 60, - resize: true, - color: theme.getColorFor(ThemeCode.text_secondary) - ), - Text("Saldo disponible", style: TextStyle(color: theme.getColorFor(ThemeCode.background_primary))), - LinearProgressIndicator( - value: 0.7, - color: theme.getColorFor(ThemeCode.background_primary), - backgroundColor: theme.getColorFor(ThemeCode.background_primary).withAlpha(0x4C), - minHeight: 10, - borderRadius: BorderRadius.all(Radius.circular(5)), - ), - Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.only(top: 30), - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - child: Expanded(child: Center( child: Row( - spacing: 10, - children: [ - TextButton(onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>DepositScreen(kid: widget.kid))), - child: Column( - spacing: 10, - children: [ - Icon(Icons.add_circle_outline, color: theme.getColorFor(ThemeCode.text_primary)), - Text("Añadir", style: TextStyle(color: theme.getColorFor(ThemeCode.text_primary))) - ] - ) - ), - Spacer(), - TextButton(onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>WageScreen(kid: widget.kid))), - child: Column( - spacing: 10, - children: [ - Icon(Icons.account_balance_wallet_outlined, color: theme.getColorFor(ThemeCode.text_primary)), - Text("Paga", style: TextStyle(color: theme.getColorFor(ThemeCode.text_primary))) - ] - ) - ), - Spacer(), - TextButton(onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>LimitsScreen(kid: widget.kid))), - child: Column( - spacing: 10, - children: [ - Icon(Icons.list_alt_outlined, color: theme.getColorFor(ThemeCode.text_primary)), - Text("Límites", style: TextStyle(color: theme.getColorFor(ThemeCode.text_primary))) - ] - ) - ), - Spacer(), - TextButton(onPressed: ()=>{}, - child: Column( - spacing: 10, - children: [ - Icon(Icons.emoji_events_outlined, color: theme.getColorFor(ThemeCode.text_primary)), - Text("Metas", style: TextStyle(color: theme.getColorFor(ThemeCode.text_primary))) - ] - ) - ) - ], - ) - ))), - Container( - padding: EdgeInsets.all(15), - height: 400, - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), child: Column( - children: [ - Text("Últimos movimientos"), - activityList(context), - TextButton(onPressed: ()=>{}, child: Text("Ver todos")) - ], - ) - ) - ], - ) - ) - ], - ), - ); - } - - Widget activityList(BuildContext context){ - final theme = context.read(); - - final activity = [{"date": "10/05", "payments": [1, 2, 3]}, {"date": "10/04", "payments":[1, 2]}, {"date": "10/02", "payments":[1, 2, 3, 4]}]; - - return Expanded(child: ListView( - children: List.generate(activity.length, (int index) { - return Column( - spacing: 20, - children: [ - Text(activity[index]["date"].toString()), - Column( - spacing: 15, - children: List.generate((activity[index]["payments"] as List).length, (int i) { - //var a = (activity[index]["payments"] as List)[i]; - return Row( - spacing: 7, - children: [ - Container( - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_tertiary), - borderRadius: BorderRadius.all(Radius.circular(16)) - ), - child: Icon(Icons.local_pizza_outlined, color: theme.getColorFor(ThemeCode.button_primary)), - ), - Column( - children: [ - Text("Vips", style: TextStyle(fontWeight: FontWeight.bold)), - Text("20:15"), - ], - ), - Spacer(), - MoneyText( - text: "5.1€", - size: 20, - resize: true, - color: theme.getColorFor(ThemeCode.text_primary) - ) - ], - ); - })) - ], - ); - }) - )); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/limits_screen.dart b/lib/payments/view/screens/limits_screen.dart deleted file mode 100644 index 36fd5a51..00000000 --- a/lib/payments/view/screens/limits_screen.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/wallet_management_layout.dart'; - -import '../../domain/entities/kid.dart'; -import '../../domain/ports/theme_port.dart'; - -class LimitsScreen extends StatefulWidget{ - final Kid kid; - - const LimitsScreen({super.key, required this.kid}); - - @override - State createState() => LimitsScreenState(); -} - -class LimitsScreenState extends State{ - late List dailyLimits; - late List timeLimits; - late List conditions; - late List blocks; - - @override - void initState() { - super.initState(); - dailyLimits = [{"title": "Diario L-V", "limit": "5", "edit": false}, - {"title": "Fines de semana", "limit": "8", "edit": false}, - {"title": "Semanal", "limit": "30", "edit": false}, - {"title": "Mensual", "limit": "1200", "edit": false},]; - timeLimits = [{"title": "Lunes a Viernes", "start": "08:00", "end": "20:00", "edit": false}, - {"title": "Fines de semana", "start": "10:00", "end": "21:00", "edit": false}, - {"title": "Vacaciones", "start": "09:00", "end": "22:00", "edit": false}]; - conditions = [{"title": "Alimentación", "limit": "10", "edit": false}, - {"title": "Transporte", "limit": "10", "edit": false}, - {"title": "Alimentación", "limit": "10", "edit": false},]; - blocks = []; - } - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return WalletManagementLayout( - kid: widget.kid, - children: [ - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary), - ), - child: Column( - spacing: 10, - children: [ - Text("Pon límite de gastos", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Libertad para ellos, tranquilidad para ti"), - ...List.generate(dailyLimits.length, (int index) { - return Column(children: [ - Row(children: [ - Text("${dailyLimits[index]["title"]}: ${dailyLimits[index]["limit"]} €"), - Spacer(), - TextButton(onPressed: ()=>{setState(() { - dailyLimits[index]["edit"] = !dailyLimits[index]["edit"]; - })}, child: Text("Editar")) - ]), - if (dailyLimits[index]["edit"]) TextField() - ]); - }), - - ], - ), - ), - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary), - ), - child: Column( - spacing: 10, - children: [ - Text("Horarios permitidos", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Controla cuándo pueden comprar"), - ...List.generate(timeLimits.length, (int index) { - return Column(children: [ - Row(children: [ - Text("${timeLimits[index]["title"]}: ${timeLimits[index]["start"]} - ${timeLimits[index]["end"]}"), - Spacer(), - TextButton(onPressed: ()=>{setState(() { - timeLimits[index]["edit"] = !timeLimits[index]["edit"]; - })}, child: Text("Editar")) - ]), - if (timeLimits[index]["edit"]) TextField() - ]); - }), - ], - ), - ) - ], - footer: Column(children: [ - FilledButton(onPressed: ()=>{}, child: SizedBox( - width: double.infinity, - child: Center(child: Text("Guardar límites")), - )) - ]), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/link_phone_screen.dart b/lib/payments/view/screens/link_phone_screen.dart deleted file mode 100644 index d3000949..00000000 --- a/lib/payments/view/screens/link_phone_screen.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:sf_app_platform/payments/view/screens/phone_code_screen.dart'; - -class LinkPhoneScreen extends StatelessWidget{ - - @override - Widget build(BuildContext context) { - TextEditingController phoneController = TextEditingController(); - String? phone; - - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Expanded(child: Center( - child: Column( - spacing: 10, - children: [ - Text("¡Nos alegra mucho tenerte por aquí!", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)), - Text("Para poder entrar de forma segura, te vamos a enviar un código al teléfono"), - Row( - spacing: 10, - children: [ - DropdownMenu( - initialSelection: "es", - dropdownMenuEntries: List.generate(3, (int index){ - return DropdownMenuEntry( - labelWidget: Icon(Icons.outlined_flag), - label: "es", - value: "es", - ); - }) - ), - Expanded(child: TextField( - onSubmitted: (String value){phone=value;}, - controller: phoneController, - decoration: InputDecoration(labelText: "Teléfono móvil", hintText: "Teléfono", border: OutlineInputBorder()), - keyboardType: TextInputType.number) - ) - ] - ), - SizedBox( - width: double.infinity, - child: FilledButton( - onPressed: ()=>{ - if (phone != null) - Navigator.push(context, MaterialPageRoute(builder: (_)=>PhoneCodeScreen(phone: phone!))) - }, - child: Text("Siguiente") - ) - ) - ] - ) - )) - ) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/link_watch/account_created_kid_screen.dart b/lib/payments/view/screens/link_watch/account_created_kid_screen.dart deleted file mode 100644 index 04a0512d..00000000 --- a/lib/payments/view/screens/link_watch/account_created_kid_screen.dart +++ /dev/null @@ -1,55 +0,0 @@ -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 '../../../domain/ports/theme_port.dart'; - -class AccountCreatedKidScreen extends StatelessWidget { - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final model = "SaveWatch Plus 2"; - final id = "1106652524"; - final fullName = "Carlos Pérez Cruz"; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_primary), - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 20, - children: [ - Spacer(flex: 2), - Icon(Icons.check, color: theme.getColorFor(ThemeCode.background_primary), size: 50), - Text("Cuenta creada", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)), - Text.rich(TextSpan(text:"Has creado la cuenta para:\n", - children: [TextSpan(text: fullName, style: TextStyle(fontWeight: FontWeight.bold))])), - Text("Reloj: $model"), - Text("ID del reloj: $id"), - Text("Ya puedes darle su primera paga paa que empiece a disfrutarla en su reloj", - style: TextStyle(fontWeight: FontWeight.bold)), - Spacer(flex: 6), - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)) - ), - child: Column(children: [ - Expanded(child: FilledButton(onPressed: ()=>{ - Navigator.pushReplacement(context, MaterialPageRoute(builder: (_)=>AddKidScreen())) - }, child: Text("Dale su primera paga"))), - TextButton(onPressed: ()=>{}, child: Text("Añadir otro peque")) - ]) - ) - ], - ), - ) - ) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/link_watch/create_profile_screen.dart b/lib/payments/view/screens/link_watch/create_profile_screen.dart deleted file mode 100644 index e9a7db0b..00000000 --- a/lib/payments/view/screens/link_watch/create_profile_screen.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class CreateProfileScreen extends StatefulWidget { - const CreateProfileScreen({super.key}); - - @override - State createState() => CreateProfileScreenState(); - -} - -class CreateProfileScreenState extends State{ - int currentStep = 0; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_primary), - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 10, - children: [ - Stepper( - type: StepperType.horizontal, - currentStep: currentStep, - onStepCancel: () => currentStep == 0 - ? null - : setState(() { - currentStep -= 1; - }), - controlsBuilder: (BuildContext context, ControlsDetails controls) { - return FilledButton( - style: ButtonStyle(backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_primary))), - onPressed: controls.onStepContinue, - child: const Text('Continuar'), - ); - }, - steps: [ - Step( - state: currentStep > 0 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 0, - stepStyle: currentStep >= 0 ? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.transparent, boxShadow: BoxShadow(spreadRadius: 5), indexStyle: TextStyle(color: Colors.transparent)), - title: Text(""), - content: Column( - spacing: 10, - children: [ - Text("Crea su perfil", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Text("Necesitamos estos datos para crear su cuenta y gestionar sus pagas y gastos"), - Text("Comienza con un peque; luego podrás agregar más", style: TextStyle(fontWeight: FontWeight.bold)), - TextField(decoration: InputDecoration(labelText: "Nombre", hintText: "Nombre", border: OutlineInputBorder())), - TextField(decoration: InputDecoration(labelText: "Apellidos", hintText: "Apellidos", border: OutlineInputBorder())), - Row( - spacing: 10, - children: [ - Expanded( child: TextField( - decoration: InputDecoration(label: Text("Fecha de nacimiento"), hintText: "DD", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - )), - Expanded( child: TextField( - decoration: InputDecoration(hintText: "MM", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - )), - Expanded( child: TextField( - decoration: InputDecoration(hintText: "AAAA", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [FilteringTextInputFormatter.digitsOnly], - )), - ], - ), - TextField(decoration: InputDecoration(labelText: "Dirección completa", hintText: "Nombre de la calle", border: OutlineInputBorder())), - TextButton(onPressed: ()=>{}, child: Text("Cambiar dirección", style: TextStyle(fontWeight: FontWeight.bold),)) - ], - ) - ), - Step( - state: currentStep > 1 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 1, - stepStyle: currentStep >= 1 ? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.transparent, boxShadow: BoxShadow(spreadRadius: 5), indexStyle: TextStyle(color: Colors.transparent)), - title: Text(""), - content: Column( - spacing: 10, - children: [ - Text("Vincula su correa y su reloj", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - SvgPicture.asset("assets/images/ui/formulario.svg"), - Row( - spacing: 10, - children: [ - Text("1"), - Column(children: [ - Text("Escanea la correa"), - Text("El peque podrá realizar pagos") - ]) - ], - ), - Row( - spacing: 10, - children: [ - Text("2"), - Column(children: [ - Text("Escanea el reloj"), - Text("Visualizarás los gastos que se hagan") - ]) - ], - ) - ], - ) - ), - Step( - state: currentStep > 2 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 2, - stepStyle: currentStep >= 2 ? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.transparent, boxShadow: BoxShadow(spreadRadius: 5), indexStyle: TextStyle(color: Colors.transparent)), - title: Text(""), - content: Column( - spacing: 10, - children: [ - Text("¡Dale su primera paga!", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Text("Enséñales a gestionar su dinero recargando su reloj"), - TextField( - decoration: InputDecoration(labelText: "Cantidad de dinero de la paga", hintText: "0€", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly - ] - ), - Text("Cantidad mínima: 10€"), - Text("Por seguridad sólo se puede disponer de un máximo de 150€ por wallet"), - Text("Método de ingreso"), - Row( - spacing: 20, - children: [ - OutlinedButton(onPressed: ()=>{}, child: SvgPicture.asset("assets/images/ui/visa.svg")), - OutlinedButton(onPressed: ()=>{}, child: SvgPicture.asset("assets/images/ui/paypal.svg")), - OutlinedButton(onPressed: ()=>{}, child: Row(children: [ - SvgPicture.asset("assets/images/ui/banco.svg"), - Text("Transferencia") - ])), - ], - ), - Row( - children: [ - Icon(Icons.lock_outline), - Text("EL pago en esta app es seguro y cumple la normativa europea. Sólo se usará el dinero que decidas para las huchas de tus hijos.") - ], - ) - ], - ) - ) - ] - ) - ], - ), - ), - ), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/login_screen.dart b/lib/payments/view/screens/login_screen.dart deleted file mode 100644 index 1a426d89..00000000 --- a/lib/payments/view/screens/login_screen.dart +++ /dev/null @@ -1,102 +0,0 @@ -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/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 StatefulWidget { - - @override - State createState() => LoginScreenState(); - -} - -class LoginScreenState extends State{ - - bool passwordVisible = false; - - @override - void initState(){ - super.initState(); - passwordVisible = true; - } - - @override - Widget build(BuildContext context) { - return Scaffold( - body: Expanded(child: Center( - child: Container( - margin: EdgeInsets.all(30), - child: Column( - spacing: 10, - children: [ - Icon(Icons.check, color: Color(0xFF329e95), size: 50), - Text("¡Te damos la bienvenida!", style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),), - TextField( - decoration: InputDecoration( - hintText: "Nombre de usuario", - labelText: "Nombre de usuario", - border: OutlineInputBorder(), - ), - ), - TextField( - obscureText: passwordVisible, - enableSuggestions: false, - autocorrect: false, - decoration: InputDecoration( - labelText: "Contraseña", - hintText: "********", - border: OutlineInputBorder(), - suffixIcon: IconButton( - icon: Icon(passwordVisible - ? Icons.visibility - : Icons.visibility_off), - onPressed: () { - setState(() { - passwordVisible = !passwordVisible; - }); - }, - ), - ) - ), - TextButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>RestorePasswordScreen())), - child: Text("¿Has olvidado la contraseña?") - ), - FilledButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>DashboardScreen())), - child: Text("Iniciar sesión") - ), - Stack( - children: [ - Divider(), - Text("o continúa con"), - ], - ), - Row( - spacing: 20, - children: [ - OutlinedButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>LoadingGoogleScreen())), - child: Text("Google", semanticsLabel: "Google") - ), - OutlinedButton( - onPressed: ()=>{}, - child: Icon(Icons.apple, semanticLabel: "Apple") - ) - ], - ), - Text("¿No tienes cuenta?"), - TextButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>SignupScreen())), - child: Text("Crear una ahora") - ) - ], - ), - ), - )), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/phone_code_screen.dart b/lib/payments/view/screens/phone_code_screen.dart deleted file mode 100644 index 15b7e187..00000000 --- a/lib/payments/view/screens/phone_code_screen.dart +++ /dev/null @@ -1,62 +0,0 @@ -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/login_screen.dart'; - -class PhoneCodeScreen extends StatefulWidget { - final String phone; - - const PhoneCodeScreen({super.key, required this.phone}); - - @override - State createState() => PhoneCodeScreenState(); - -} - -class PhoneCodeScreenState extends State { - final focusNodes = List.generate(6, (int i){ - return FocusNode(); - }); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Expanded(child: Center( - child: Column( - spacing: 15, - children: [ - Spacer(flex:8), - Text("Conéctate", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Text.rich(TextSpan(text: "Hemos enviado el código al ", - children: [TextSpan( - text: widget.phone, style: TextStyle(fontWeight: FontWeight.bold))] - )), - Text("Introduce el código aquí"), - Row( - spacing: 20, - children: List.generate(6, (int i){ - return Expanded(child: TextField( - focusNode: focusNodes[i], - keyboardType: TextInputType.number, - decoration: InputDecoration(hintText: "0", counterText: "", border: OutlineInputBorder()), - maxLength: 1, - onChanged: (String value)=>{value!="" ? focusNodes[i+1].requestFocus() : focusNodes[i-1].requestFocus()}, - )); - }), - ), - FilledButton(onPressed: ()=>{Navigator.pushReplacement(context, MaterialPageRoute(builder: (_)=>LoginScreen()))}, child: Text("Entrar")), - Text("¿No lo has recibido?"), - TextButton(onPressed: ()=>{}, - child: Text("Volver a intentarlo", style: TextStyle(fontWeight: FontWeight.bold)) - ), - Spacer(flex:10) - ] - ), - )), - ) - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/profile_screen.dart b/lib/payments/view/screens/profile_screen.dart deleted file mode 100644 index 7dca5868..00000000 --- a/lib/payments/view/screens/profile_screen.dart +++ /dev/null @@ -1,115 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/activity_list.dart'; -import 'package:sf_app_platform/payments/view/screens/core/deposit_block.dart'; -import 'package:sf_app_platform/payments/view/screens/settings_screen.dart'; - -import '../../domain/ports/theme_port.dart'; -import 'core/line_graph.dart'; - -class ProfileScreen extends StatelessWidget{ - const ProfileScreen({super.key}); - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final activity = [ - {"type": "goal"}, - {"type": "wage", "amount": 5}, - {"type": "lock"}, - {"type": "lock"} - ]; - - final name = "Juan"; - final total = 95.03; - final available = 44.09; - - final content = [ - Row( - children: [ - Text(name, style: TextStyle( - color: theme.getColorFor(ThemeCode.text_secondary), - fontWeight: FontWeight.bold, - fontSize: 30) - ), - Spacer(), - TextButton( - onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>SettingsScreen())), - child: Text("Ajustes de la cuenta", style: TextStyle( - color: theme.getColorFor(ThemeCode.text_secondary)) - ) - ) - ], - ), - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration(color: theme.getColorFor(ThemeCode.background_primary), borderRadius: BorderRadius.all(Radius.circular(20))), - child: Column( - spacing: 5, - children: [ - Row( - children: [ - Text("Wallet", style: TextStyle(fontWeight: FontWeight.bold),), - Spacer(), - Text("$total€") - ] - ), - Stack( - children: [ - LinearProgressIndicator( - value: available/total, - minHeight: 70, - borderRadius: BorderRadius.all(Radius.circular(16)), - ), - FractionallySizedBox( - widthFactor: available/total, - child: Container( - padding: EdgeInsets.symmetric(vertical: 20), - child: Center( - child: Text( - "$available€", - style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary), fontSize: 20) - ) - ) - ) - ), - ], - ), - Center(child: Text("Disponible")) - ], - ), - ), - SizedBox( - height: 200, - child: LineGraph() - ), - DepositBlock(max: 150-total), - Row(), - ActivityList(activity: activity, edit: false) - ]; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Stack(children: [ - DecoratedBox( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(30)), - color: Color(0xFF4B4B4B) - ), - child: SizedBox(width: double.infinity, height: 200), - ), - Column(children: [Expanded (child: Container( - margin: EdgeInsets.fromLTRB(20, 20, 20, 0), - child: ListView.separated( - itemBuilder: (BuildContext context, int index) {return content[index];}, - separatorBuilder: (BuildContext context, int index) { - return Divider(color: Colors.transparent, height: 20); - }, - itemCount: content.length - ) - ))]), - ]) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/restore_password/email_sent_screen.dart b/lib/payments/view/screens/restore_password/email_sent_screen.dart deleted file mode 100644 index 20729edd..00000000 --- a/lib/payments/view/screens/restore_password/email_sent_screen.dart +++ /dev/null @@ -1,62 +0,0 @@ -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'; - -class EmailSentScreen extends StatefulWidget{ - final String email; - - const EmailSentScreen({super.key, required this.email}); - - @override - State createState() => EmailSentScreenState(); - -} - -class EmailSentScreenState extends State { - - @override - Widget build(BuildContext context) { - final theme = context.read(); - - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 20, - children: [ - Spacer(flex: 8), - Text("Recuperar contraseña", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Spacer(flex: 1), - Row( - spacing: 10, - children: [ - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)), - Text("Correo enviado correctamente", style: TextStyle(fontWeight: FontWeight.bold)) - ] - ), - Spacer(flex: 1), - Text("Revisa tu email y haz clic en el enlace para crear una nueva contraseña"), - Text("Si no recibes el correo en unos minutos, revisa tu carpeta de spam o pulsa \"Reenviar correo\""), - Row( - spacing: 10, - children: [ - Expanded(child: OutlinedButton(onPressed: ()=>{}, child: Text("Reenviar correo"))), - Expanded(child: FilledButton(onPressed: - ()=>{Navigator.push(context, MaterialPageRoute(builder: (_)=>NewPasswordScreen()))}, - style: ButtonStyle(backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_secondary))), - child: Text("Continuar") - ) - ) - ]), - Spacer(flex: 10) - ], - ), - ), - ), - ); - } -} - diff --git a/lib/payments/view/screens/restore_password/new_password_screen.dart b/lib/payments/view/screens/restore_password/new_password_screen.dart deleted file mode 100644 index 1277e3a5..00000000 --- a/lib/payments/view/screens/restore_password/new_password_screen.dart +++ /dev/null @@ -1,146 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class NewPasswordScreen extends StatefulWidget{ - const NewPasswordScreen({super.key}); - - @override - State createState() => NewPasswordScreenState(); - -} - -class NewPasswordScreenState extends State { - - bool passwordVisible = false; - bool equalPasswords = false; - String password = ""; - var securityChecks = {"min": false, "capital": false, "number": false, "special": false}; - - @override - void initState() { - passwordVisible = false; - equalPasswords = false; - String password = ""; - securityChecks = {"min": false, "capital": false, "number": false, "special": false}; - super.initState(); - } - - @override - Widget build(BuildContext context) { - final theme = context.read(); - - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Center( - child: Column( - spacing: 10, - children: [ - Spacer(flex: 4), - Text("Recuperar contraseña", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - TextField( - obscureText: passwordVisible, - enableSuggestions: false, - autocorrect: false, - decoration: InputDecoration( - labelText: "Nueva contraseña", - hintText: "********", - border: OutlineInputBorder(), - suffixIcon: IconButton( - icon: Icon(passwordVisible - ? Icons.visibility - : Icons.visibility_off), - onPressed: () { - setState(() { - passwordVisible = !passwordVisible; - }); - }, - ), - ), - onChanged: (value)=>{ - setState(() { - password = value; - securityChecks = checkSecurity(value); - }) - }, - ), - TextField( - obscureText: passwordVisible, - enableSuggestions: false, - autocorrect: false, - decoration: InputDecoration( - labelText: "Repetir contraseña", - hintText: "********", - border: OutlineInputBorder(), - suffixIcon: IconButton( - icon: Icon(passwordVisible - ? Icons.visibility - : Icons.visibility_off), - onPressed: () { - setState(() { - passwordVisible = !passwordVisible; - }); - }, - ), - ), - onChanged: (value)=>{setState(() { - equalPasswords = password == value; - })}, - ), - Row(children: [ - securityChecks["min"]! ? - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)) : - Icon(Icons.cancel_outlined, color: theme.getColorFor(ThemeCode.button_secondary)), - Text("Al menos 8 caracteres") - ]), - Row(children: [ - securityChecks["capital"]! ? - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)) : - Icon(Icons.cancel_outlined, color: theme.getColorFor(ThemeCode.button_secondary)), - Text("Una mayúscula") - ]), - Row(children: [ - securityChecks["number"]! ? - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)) : - Icon(Icons.cancel_outlined, color: theme.getColorFor(ThemeCode.button_secondary)), - Text("Un número") - ]), - Row(children: [ - securityChecks["special"]! ? - Icon(Icons.check, color: theme.getColorFor(ThemeCode.button_primary)) : - Icon(Icons.cancel_outlined, color: theme.getColorFor(ThemeCode.button_secondary)), - Text("Un carácter especial") - ]), - Spacer(flex: 1), - FilledButton( - onPressed: ()=>{}, - child: Container( - width: double.infinity, - padding: EdgeInsets.all(20), - child: Text("Aceptar") - ) - ), - Spacer(flex: 4) - ], - ), - ), - ), - ); - } - - //TODO: Extraer de la vista - Map checkSecurity(String value) { - Map checks = {}; - - checks["min"] = value.length >= 8; - checks["capital"] = RegExp(r'[A-Z]').hasMatch(value); - checks["number"] = RegExp(r'[0-9]').hasMatch(value); - checks["special"] = RegExp(r'[^A-Za-z0-9]').hasMatch(value); - - return checks; - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/restore_password/restore_password_screen.dart b/lib/payments/view/screens/restore_password/restore_password_screen.dart deleted file mode 100644 index 26ecb231..00000000 --- a/lib/payments/view/screens/restore_password/restore_password_screen.dart +++ /dev/null @@ -1,43 +0,0 @@ -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/email_sent_screen.dart'; - -class RestorePasswordScreen extends StatelessWidget{ - const RestorePasswordScreen({super.key}); - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return Scaffold( - body: Container( - margin: EdgeInsets.all(30), - child: Center(child: - Column( - spacing: 30, - children: [ - Spacer(flex: 8), - Text("Recuperar contaseña", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), - Text("Introduce tu email para enviarte un enlace de recuperación"), - TextField(decoration: InputDecoration(labelText: "Correo electrónico", hintText: "Correo electrónico", border: OutlineInputBorder())), - Row( - spacing: 20, - children: [ - Expanded(child: OutlinedButton(onPressed: ()=>{Navigator.pop(context)}, child: Text("Volver"))), - Expanded(child: FilledButton( - onPressed: ()=>{Navigator.push(context, MaterialPageRoute(builder: (_)=>EmailSentScreen(email: "")))}, - style: ButtonStyle(backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_secondary))), - child: Text("Enviar") - )) - ], - ), - Spacer(flex: 10) - ], - ) - ), - ), - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/settings_screen.dart b/lib/payments/view/screens/settings_screen.dart deleted file mode 100644 index 4a5b8a1d..00000000 --- a/lib/payments/view/screens/settings_screen.dart +++ /dev/null @@ -1,231 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -import '../../domain/ports/theme_port.dart'; - -class SettingsScreen extends StatefulWidget{ - @override - State createState() => SettingsScreenState(); - -} - -class SettingsScreenState extends State{ - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - final name = "Juan"; - final balance = 50; - final fullName = "Juan Pérez Cruz"; - final birthDate = "08/03/1976"; - final relation = "Padre"; - final address = "Calle Gran Vía 30 6º, 28013"; - final country = "España"; - final nationality = "Español"; - final email = "juanpcruz@gmail.com"; - final phone = "123456789"; - - final content = [ - Center(child: Column(children: [ - Text("Ajustes de la cuenta", style: TextStyle(fontSize: 30, color: theme.getColorFor(ThemeCode.text_secondary))), - Text("Saldo: $balance€", style: TextStyle(color: theme.getColorFor(ThemeCode.text_secondary))), - ])), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column(children: [ - Row( - spacing: 10, - children: [ - Text(name, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar wallet")), - Icon(Icons.attach_money), - ], - ), - Text(relation) - ]), - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column(children: [ - Row( - spacing: 10, - children: [ - Text("Datos personales", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar")) - ], - ), - Text.rich(TextSpan(text:"Nombre: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: fullName, style: TextStyle(fontWeight: FontWeight.normal)) - ])), - Text.rich(TextSpan(text:"Fecha de nacimiento: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: birthDate, style: TextStyle(fontWeight: FontWeight.normal)) - ])), - Text.rich(TextSpan(text:"Familiar: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: relation, style: TextStyle(fontWeight: FontWeight.normal)) - ])) - ]), - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column(children: [ - Row( - spacing: 10, - children: [ - Text("Dirección", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar")) - ], - ), - Text.rich(TextSpan(text:"Dirección: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: address, style: TextStyle(fontWeight: FontWeight.normal)) - ])), - Text.rich(TextSpan(text:"País: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: country, style: TextStyle(fontWeight: FontWeight.normal)) - ])), - Text.rich(TextSpan(text:"Nacionalidad: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: nationality, style: TextStyle(fontWeight: FontWeight.normal)) - ])) - ]), - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column(children: [ - Row( - spacing: 10, - children: [ - Text("Usuario", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar")) - ], - ), - Text.rich(TextSpan(text:"Correo: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: email, style: TextStyle(fontWeight: FontWeight.normal)) - ])), - Text.rich(TextSpan(text:"Teléfono: ", style: TextStyle(fontWeight: FontWeight.bold), - children: [TextSpan(text: phone, style: TextStyle(fontWeight: FontWeight.normal)) - ])) - ]), - ), - - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Row( - spacing: 10, - children: [ - Text("Cambio de contraseña", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar")) - ], - ), - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary) - ), - child: Column( - children: [ - Row( - spacing: 10, - children: [ - Text("Método de pago", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Editar")) - ], - ), - Text("Puedes cambiar el método de pago en cualquier momento") - ] - ) - ), - Container( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_tertiary) - ), - child: Column( - children: [ - Row( - spacing: 10, - children: [ - Text("Plan anual", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Spacer(), - TextButton(onPressed: ()=>{}, child: Text("Cambiar Plan")) - ], - ), - Text("Sin permanencia"), - Text("Llamadas y datos ilimitados"), - Text("2 meses gratis"), - ] - ) - ), - - TextButton(onPressed: ()=>{}, child: Text("Contáctanos")), - TextButton(onPressed: ()=>{}, child: Text("Preguntas frecuentes")), - ]; - - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.background_secondary), - body: Stack(children: [ - DecoratedBox( - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(30)), - color: Color(0xFF4B4B4B) - ), - child: SizedBox(width: double.infinity, height: 200), - ), - Column(children: [Expanded (child: Container( - margin: EdgeInsets.all(20), - child: ListView.separated( - itemBuilder: (BuildContext context, int index) {return content[index];}, - separatorBuilder: (BuildContext context, int index) { - return Divider(color: Colors.transparent, height: 20); - }, - itemCount: content.length))), - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), - color: theme.getColorFor(ThemeCode.background_primary), - ), - child: Column( - children: [ - FilledButton(onPressed: ()=>{}, child: Container( - width: double.infinity, - padding: EdgeInsets.all(20), - child: Center(child: Text("Guardar cambios")) - )), - TextButton(onPressed: ()=>Navigator.pop(context), child: Text("Cancelar")) - ], - ), - ), - ]) - ]) - ); - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/signup/signup_screen.dart b/lib/payments/view/screens/signup/signup_screen.dart deleted file mode 100644 index cded314a..00000000 --- a/lib/payments/view/screens/signup/signup_screen.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/account_created_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/signup/signup_address_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/signup/signup_personal_screen.dart'; -import 'package:sf_app_platform/payments/view/screens/signup/signup_user_screen.dart'; - -import '../../../domain/ports/theme_port.dart'; - -class SignupScreen extends StatefulWidget { - const SignupScreen({super.key}); - - @override - _SignupScreenState createState() => _SignupScreenState(); -} - -class _SignupScreenState extends State { - int currentStep = 0; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return MaterialApp( - home: Scaffold( - body: Center(child: Container( - color: theme.getColorFor(ThemeCode.background_primary), - padding: const EdgeInsets.all(20), - child: SizedBox( - child: Stepper( - controlsBuilder: (BuildContext context, ControlsDetails controls) { - return Row( - children: [ - Expanded(child: OutlinedButton( - onPressed: controls.onStepCancel, - child: const Text('Atrás'), - )), - Expanded(child: FilledButton( - style: ButtonStyle( - backgroundColor: WidgetStatePropertyAll(theme.getColorFor(ThemeCode.button_secondary)) - ), - onPressed: controls.onStepContinue, - child: const Text('Siguiente'), - )), - ], - ); - }, - type: StepperType.horizontal, - currentStep: currentStep, - onStepCancel: () => currentStep == 0 - ? null - : setState(() { - currentStep -= 1; - }), - onStepContinue: () { - bool isLastStep = (currentStep == getSteps().length - 1); - if (isLastStep) { - Navigator.pushReplacement(context, MaterialPageRoute( - builder: (_) => AccountCreatedScreen(), - )); - } else { - setState(() { - currentStep += 1; - }); - } - }, - steps: getSteps(), - ) - )), - )), - ); - } - - List getSteps() { - return [ - Step( - state: currentStep > 0 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 0, - stepStyle: currentStep >= 0? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.transparent, boxShadow: BoxShadow(spreadRadius: 5), indexStyle: TextStyle(color: Colors.transparent)), - title: const Text(""), - content: SignupPersonalScreen() - ), - Step( - state: currentStep > 1 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 1, - stepStyle: currentStep >= 1? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.white, boxShadow: BoxShadow(spreadRadius: 1), indexStyle: TextStyle(color: Colors.transparent)), - title: const Text(""), - content: SignupAddressScreen() - ), - Step( - state: currentStep > 2 ? StepState.complete : StepState.indexed, - isActive: currentStep >= 2, - stepStyle: currentStep >= 2? StepStyle(connectorThickness: 0, color: Color(0xFF329e95), indexStyle: TextStyle(color: Colors.transparent)) : StepStyle(connectorThickness: 0, color: Colors.white, boxShadow: BoxShadow(spreadRadius: 1), indexStyle: TextStyle(color: Colors.transparent)), - title: const Text(""), - content: SignupUserScreen() - ), - ]; - } -} \ No newline at end of file diff --git a/lib/payments/view/screens/wage_screen.dart b/lib/payments/view/screens/wage_screen.dart deleted file mode 100644 index dd114c0f..00000000 --- a/lib/payments/view/screens/wage_screen.dart +++ /dev/null @@ -1,197 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:provider/provider.dart'; -import 'package:sf_app_platform/payments/view/screens/core/wallet_management_layout.dart'; - -import '../../domain/entities/kid.dart'; -import '../../domain/ports/theme_port.dart'; - -class WageScreen extends StatefulWidget{ - final Kid kid; - - const WageScreen({super.key, required this.kid}); - - @override - State createState() => WageScreenState(); - -} - -class WageScreenState extends State{ - String frequence = "weekly"; - var conditions = {"weeklyLimits": false, "incidences": false, "holidays": false}; - - @override - Widget build(BuildContext context) { - ThemePort theme = context.read(); - - return WalletManagementLayout( - kid: widget.kid, - children: [ - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Paga automática", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - TextField( - decoration: InputDecoration(labelText: "Cantidad", hintText: "0€", border: OutlineInputBorder()), - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly - ] - ), - Text("Saldo total disponible después: 30 €") - ], - ), - ), - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Frecuencia", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Cuándo se envía el dinero"), - CheckboxListTile( - title: Text('Semanal'), - controlAffinity: ListTileControlAffinity.leading, - value: frequence=="weekly", - onChanged: (value) { - setState(() { - frequence="weekly"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Cada dos semanas'), - controlAffinity: ListTileControlAffinity.leading, - value: frequence=="biweekly", - onChanged: (value) { - setState(() { - frequence="biweekly"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Mensual'), - controlAffinity: ListTileControlAffinity.leading, - value: frequence=="monthly", - onChanged: (value) { - setState(() { - frequence="monthly"; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - Container(width: double.infinity, child: DropdownMenu( - label: Text("Día de la semana"), - initialSelection: "Domingo", - dropdownMenuEntries: List.generate(7, (int index){ - final days = ["Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"]; - return DropdownMenuEntry(value: days[index], label: days[index]); - }) - )), - DropdownMenu( - label: Text("Hora del día"), - initialSelection: 9, - dropdownMenuEntries: List.generate(24, (int index){ - return DropdownMenuEntry(value: index, label: "$index:00"); - }) - ), - TextField( - minLines: 3, - maxLines: 3, - maxLength: 150, - decoration: InputDecoration( - labelText: "Escribir mensaje a ${widget.kid.name} del motivo del ingreso", - hintText: "Escribe tu mensaje", - border: OutlineInputBorder(), - ) - ), - Align( - alignment: Alignment.topLeft, - child: Text("Máximo 150 caracteres"), - ) - ], - ), - ), - Container( - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.all(Radius.circular(20)), - ), - padding: EdgeInsets.all(10), - child: Column( - spacing: 10, - children: [ - Text("Condiciones", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)), - Text("Este dato aparecerá en el reloj del peque"), - CheckboxListTile( - title: Text('Sólo si cumple límites semanales'), - controlAffinity: ListTileControlAffinity.leading, - value: conditions["weeklyLimits"], - onChanged: (value) { - setState(() { - conditions["weeklyLimits"] = !conditions["weeklyLimits"]!; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Sólo si no ha tenido incidencias'), - controlAffinity: ListTileControlAffinity.leading, - value: conditions["incidences"], - onChanged: (value) { - setState(() { - conditions["incidences"] = !conditions["incidences"]!; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - CheckboxListTile( - title: Text('Pausar durante vacaciones'), - controlAffinity: ListTileControlAffinity.leading, - value: conditions["holidays"], - onChanged: (value) { - setState(() { - conditions["holidays"] = !conditions["holidays"]!; - }); - }, - activeColor: theme.getColorFor(ThemeCode.button_primary), - ), - ], - ), - ), - ], - footer: Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - color: theme.getColorFor(ThemeCode.background_primary), - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)) - ), - child: Column( - spacing: 10, - children: [ - FilledButton(onPressed: ()=>{}, child: Container( - width:double.infinity, - padding: EdgeInsets.all(20), - child: Center(child: Text("Activar paga automática")) - )), - TextButton(onPressed: ()=>{}, child: Text("Cancelar")) - ], - ), - ) - ); - } - -} \ No newline at end of file diff --git a/lib/payments/view/screens/welcome_screen.dart b/lib/payments/view/screens/welcome_screen.dart deleted file mode 100644 index cc3a3dcb..00000000 --- a/lib/payments/view/screens/welcome_screen.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.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 'core/dashboard_screen.dart'; - -class WelcomeScreen extends StatelessWidget { - const WelcomeScreen({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( body: Center( - child:Column( - children:[ - Spacer(), - Expanded( - child: CarouselView( - scrollDirection: Axis.horizontal, - itemExtent: double.infinity, - itemSnapping: true, - shrinkExtent: 400, - children: generateSteps(), - ) - ), - FilledButton(onPressed: ()=>{jumpToNext(context)}, child: const Text('Continuar')), - Spacer() - ] - ), - )); - } - - void jumpToNext(BuildContext context){ - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (_) => LinkPhoneScreen(), - ), - ); - return; - } - - List generateSteps(){ - return [ - Column( - spacing: 30, - children: [ - SvgPicture.asset("assets/images/ui/bienvenida_paso1.svg"), - Text("Aprende a gestionar su dinero", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),), - Text("Tu peque crea hábitos y se divierte mientras lo hace") - ] - ), - Column( - children: [ - SvgPicture.asset("assets/images/ui/bienvenida_paso2.svg"), - Text("Tranquilidad en cada pago que hacen"), - Text("Supervisa gastos, fija límites y acompáñalos en cada paso") - ] - ), - Column( - children: [ - SvgPicture.asset("assets/images/ui/bienvenida_paso3.svg"), - Text("Pagos fáciles y seguros en sus manos"), - Text("Podrá pagar desde su reloj.\n Sin móvil ni efectivo") - ] - ), - ]; - } -} \ No newline at end of file diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 00000000..49ecf8a6 --- /dev/null +++ b/melos.yaml @@ -0,0 +1,11 @@ +name: sf-app-platform +packages: + - apps/** + - packages/** + - modules/** + - sf_shared/** + +scripts: + bootstrap: + run: melos bootstrap + description: Instala las dependencias de todos los paquetes diff --git a/melos_sf-app-platform.iml b/melos_sf-app-platform.iml new file mode 100644 index 00000000..96815595 --- /dev/null +++ b/melos_sf-app-platform.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/melos_sf_app_platform_mono_repo.iml b/melos_sf_app_platform_mono_repo.iml new file mode 100644 index 00000000..96815595 --- /dev/null +++ b/melos_sf_app_platform_mono_repo.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/modules/auth/.gitignore b/modules/auth/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/modules/auth/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/modules/auth/.metadata b/modules/auth/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/modules/auth/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/modules/auth/CHANGELOG.md b/modules/auth/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/modules/auth/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/modules/auth/LICENSE b/modules/auth/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/modules/auth/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/modules/auth/README.md b/modules/auth/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/modules/auth/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/modules/auth/analysis_options.yaml b/modules/auth/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/modules/auth/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/modules/auth/lib/auth.dart b/modules/auth/lib/auth.dart new file mode 100644 index 00000000..03108e74 --- /dev/null +++ b/modules/auth/lib/auth.dart @@ -0,0 +1,6 @@ +export 'src/device_sign_up/link_watch/create_profile_screen.dart'; +export 'src/onboarding/onboarding_builder.dart'; +export 'src/login/link_phone_builder.dart'; +export 'src/login/phone_code_builder.dart'; +export 'src/login/login_builder.dart'; +export 'src/recover_password/recover_password_builder.dart'; diff --git a/lib/payments/view/screens/add_kid_screen.dart b/modules/auth/lib/src/device_sign_up/add_kid_screen.dart similarity index 50% rename from lib/payments/view/screens/add_kid_screen.dart rename to modules/auth/lib/src/device_sign_up/add_kid_screen.dart index 9bc5a29d..a40aef4c 100644 --- a/lib/payments/view/screens/add_kid_screen.dart +++ b/modules/auth/lib/src/device_sign_up/add_kid_screen.dart @@ -1,10 +1,10 @@ +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{ +// 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 { @override Widget build(BuildContext context) { return Scaffold( @@ -15,40 +15,43 @@ class AddKidScreen extends StatelessWidget{ children: [ Spacer(flex: 6), Text("Añade a tu peque"), - Text("Controla su gasto a la vez que aprende hábitos financieros responsables"), + Text( + "Controla su gasto a la vez que aprende hábitos financieros responsables", + ), Container( margin: EdgeInsets.symmetric(vertical: 30, horizontal: 50), child: Row( children: [ - Column( - children: [ - Text("1"), - Text("2"), - Text("3") - ], - ), + Column(children: [Text("1"), Text("2"), Text("3")]), Column( children: [ Text("Crea su perfil"), Text("Vincula su correa y su reloj"), - Text("Carga su hucha") + Text("Carga su hucha"), ], - ) + ), ], ), ), Text("¡Y todo listo para que tenga su dinero!"), Text("Recuerda que necesitas tener un Plan SaveFamily"), - Text("Si aún no lo tienes, puedes conseguirlo a través de nuestra web"), + Text( + "Si aún no lo tienes, puedes conseguirlo a través de nuestra web", + ), Spacer(flex: 8), Container( width: double.infinity, - child: FilledButton(onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (_)=>CreateProfileScreen())), child: Text("¡Empezar!")) - ) + child: FilledButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => CreateProfileScreen()), + ), + child: Text("¡Empezar!"), + ), + ), ], - ) - ) + ), + ), ); } - -} \ No newline at end of file +} diff --git a/modules/auth/lib/src/device_sign_up/contact_screen.dart b/modules/auth/lib/src/device_sign_up/contact_screen.dart new file mode 100644 index 00000000..e7f7852c --- /dev/null +++ b/modules/auth/lib/src/device_sign_up/contact_screen.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; + +class ContactScreen extends StatelessWidget { + const ContactScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 10, + children: [ + Text( + "Contáctanos", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + Text( + "Trasládanos tus dudas e intentaremos responderte lo antes posible", + ), + DropdownMenu( + initialSelection: "es", + label: Text("País"), + dropdownMenuEntries: [ + DropdownMenuEntry(value: "es", label: "España"), + DropdownMenuEntry(value: "fr", label: "Francia"), + DropdownMenuEntry(value: "pt", label: "Portugal"), + ], + ), + DropdownMenu( + initialSelection: "online", + label: Text("Canal de compra"), + dropdownMenuEntries: [ + DropdownMenuEntry(value: "online", label: "SF online shop"), + ], + ), + Expanded( + child: TextField( + decoration: InputDecoration( + labelText: "Nombre", + hintText: "Nombre y apellidos", + border: OutlineInputBorder(), + ), + ), + ), + Expanded( + child: TextField( + decoration: InputDecoration( + labelText: "Correo electrónico", + hintText: "Correo electrónico", + border: OutlineInputBorder(), + ), + ), + ), + Expanded( + child: TextField( + minLines: 3, + maxLines: 3, + decoration: InputDecoration( + labelText: "Asunto del mensaje", + hintText: "Escribe tu mensaje", + border: OutlineInputBorder(), + ), + ), + ), + Expanded( + child: FilledButton( + onPressed: () => Navigator.pop(context), + child: Text("Enviar"), + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/device_sign_up/link_watch/account_created_kid_screen.dart b/modules/auth/lib/src/device_sign_up/link_watch/account_created_kid_screen.dart new file mode 100644 index 00000000..ca63a267 --- /dev/null +++ b/modules/auth/lib/src/device_sign_up/link_watch/account_created_kid_screen.dart @@ -0,0 +1,87 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:auth/src/device_sign_up/add_kid_screen.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class AccountCreatedKidScreen extends ConsumerWidget { + const AccountCreatedKidScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + final model = "SaveWatch Plus 2"; + final id = "1106652524"; + final fullName = "Carlos Pérez Cruz"; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 20, + children: [ + Spacer(flex: 2), + Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.backgroundPrimary), + size: 50, + ), + Text( + "Cuenta creada", + style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), + ), + Text.rich( + TextSpan( + text: "Has creado la cuenta para:\n", + children: [ + TextSpan( + text: fullName, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + ), + Text("Reloj: $model"), + Text("ID del reloj: $id"), + Text( + "Ya puedes darle su primera paga paa que empiece a disfrutarla en su reloj", + style: TextStyle(fontWeight: FontWeight.bold), + ), + Spacer(flex: 6), + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topRight: Radius.circular(20), + topLeft: Radius.circular(20), + ), + ), + child: Column( + children: [ + Expanded( + child: FilledButton( + onPressed: () => { + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (_) => AddKidScreen()), + ), + }, + child: Text("Dale su primera paga"), + ), + ), + TextButton( + onPressed: () => {}, + child: Text("Añadir otro peque"), + ), + ], + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/device_sign_up/link_watch/create_profile_screen.dart b/modules/auth/lib/src/device_sign_up/link_watch/create_profile_screen.dart new file mode 100644 index 00000000..487db4ff --- /dev/null +++ b/modules/auth/lib/src/device_sign_up/link_watch/create_profile_screen.dart @@ -0,0 +1,304 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CreateProfileScreen extends ConsumerWidget { + CreateProfileScreen({super.key}); + + int currentStep = 0; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 10, + children: [ + Stepper( + type: StepperType.horizontal, + currentStep: currentStep, + onStepCancel: () => currentStep == 0, + // ? null + // : + // setState(() { + // currentStep -= 1; + // }), + controlsBuilder: + (BuildContext context, ControlsDetails controls) { + return FilledButton( + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonPrimary), + ), + ), + onPressed: controls.onStepContinue, + child: const Text('Continuar'), + ); + }, + steps: [ + Step( + state: currentStep > 0 + ? StepState.complete + : StepState.indexed, + isActive: currentStep >= 0, + stepStyle: currentStep >= 0 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.transparent, + boxShadow: BoxShadow(spreadRadius: 5), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: Text(""), + content: Column( + spacing: 10, + children: [ + Text( + "Crea su perfil", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), + Text( + "Necesitamos estos datos para crear su cuenta y gestionar sus pagas y gastos", + ), + Text( + "Comienza con un peque; luego podrás agregar más", + style: TextStyle(fontWeight: FontWeight.bold), + ), + TextField( + decoration: InputDecoration( + labelText: "Nombre", + hintText: "Nombre", + border: OutlineInputBorder(), + ), + ), + TextField( + decoration: InputDecoration( + labelText: "Apellidos", + hintText: "Apellidos", + border: OutlineInputBorder(), + ), + ), + Row( + spacing: 10, + children: [ + Expanded( + child: TextField( + decoration: InputDecoration( + label: Text("Fecha de nacimiento"), + hintText: "DD", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], + ), + ), + Expanded( + child: TextField( + decoration: InputDecoration( + hintText: "MM", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], + ), + ), + Expanded( + child: TextField( + decoration: InputDecoration( + hintText: "AAAA", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], + ), + ), + ], + ), + TextField( + decoration: InputDecoration( + labelText: "Dirección completa", + hintText: "Nombre de la calle", + border: OutlineInputBorder(), + ), + ), + TextButton( + onPressed: () => {}, + child: Text( + "Cambiar dirección", + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + ], + ), + ), + Step( + state: currentStep > 1 + ? StepState.complete + : StepState.indexed, + isActive: currentStep >= 1, + stepStyle: currentStep >= 1 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.transparent, + boxShadow: BoxShadow(spreadRadius: 5), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: Text(""), + content: Column( + spacing: 10, + children: [ + Text( + "Vincula su correa y su reloj", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), + SvgPicture.asset("assets/images/ui/formulario.svg"), + Row( + spacing: 10, + children: [ + Text("1"), + Column( + children: [ + Text("Escanea la correa"), + Text("El peque podrá realizar pagos"), + ], + ), + ], + ), + Row( + spacing: 10, + children: [ + Text("2"), + Column( + children: [ + Text("Escanea el reloj"), + Text("Visualizarás los gastos que se hagan"), + ], + ), + ], + ), + ], + ), + ), + Step( + state: currentStep > 2 + ? StepState.complete + : StepState.indexed, + isActive: currentStep >= 2, + stepStyle: currentStep >= 2 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.transparent, + boxShadow: BoxShadow(spreadRadius: 5), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: Text(""), + content: Column( + spacing: 10, + children: [ + Text( + "¡Dale su primera paga!", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), + Text( + "Enséñales a gestionar su dinero recargando su reloj", + ), + TextField( + decoration: InputDecoration( + labelText: "Cantidad de dinero de la paga", + hintText: "0€", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + ], + ), + Text("Cantidad mínima: 10€"), + Text( + "Por seguridad sólo se puede disponer de un máximo de 150€ por wallet", + ), + Text("Método de ingreso"), + Row( + spacing: 20, + children: [ + OutlinedButton( + onPressed: () => {}, + child: SvgPicture.asset( + "assets/images/ui/visa.svg", + ), + ), + OutlinedButton( + onPressed: () => {}, + child: SvgPicture.asset( + "assets/images/ui/paypal.svg", + ), + ), + OutlinedButton( + onPressed: () => {}, + child: Row( + children: [ + SvgPicture.asset( + "assets/images/ui/banco.svg", + ), + Text("Transferencia"), + ], + ), + ), + ], + ), + Row( + children: [ + Icon(Icons.lock_outline), + Text( + "EL pago en esta app es seguro y cumple la normativa europea. Sólo se usará el dinero que decidas para las huchas de tus hijos.", + ), + ], + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/login/link_phone_builder.dart b/modules/auth/lib/src/login/link_phone_builder.dart new file mode 100644 index 00000000..ee261810 --- /dev/null +++ b/modules/auth/lib/src/login/link_phone_builder.dart @@ -0,0 +1,18 @@ +import 'package:auth/src/login/presentation/link_phone_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class LinkPhoneBuilder { + const LinkPhoneBuilder(); + + Page buildPage(BuildContext context, GoRouterState state) { + final NavigationContract navigationContract = GetIt.I(); + + return MaterialPage( + key: state.pageKey, + child: LinkPhoneScreen(navigationContract: navigationContract), + ); + } +} diff --git a/modules/auth/lib/src/login/login_builder.dart b/modules/auth/lib/src/login/login_builder.dart new file mode 100644 index 00000000..c72a184e --- /dev/null +++ b/modules/auth/lib/src/login/login_builder.dart @@ -0,0 +1,18 @@ +import 'package:auth/src/login/presentation/login_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class LoginBuilder { + const LoginBuilder(); + + Page buildPage(BuildContext context, GoRouterState state) { + final NavigationContract navigationContract = GetIt.I(); + + return MaterialPage( + key: state.pageKey, + child: LoginScreen(navigationContract: navigationContract), + ); + } +} diff --git a/modules/auth/lib/src/login/phone_code_builder.dart b/modules/auth/lib/src/login/phone_code_builder.dart new file mode 100644 index 00000000..47a63946 --- /dev/null +++ b/modules/auth/lib/src/login/phone_code_builder.dart @@ -0,0 +1,18 @@ +import 'package:auth/src/login/presentation/phone_code_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class PhoneCodeBuilder { + const PhoneCodeBuilder(); + + Page buildPage(BuildContext context, GoRouterState state) { + final NavigationContract navigationContract = GetIt.I(); + + return MaterialPage( + key: state.pageKey, + child: PhoneCodeScreen(navigationContract: navigationContract), + ); + } +} diff --git a/modules/auth/lib/src/login/presentation/link_phone_screen.dart b/modules/auth/lib/src/login/presentation/link_phone_screen.dart new file mode 100644 index 00000000..e8fe2563 --- /dev/null +++ b/modules/auth/lib/src/login/presentation/link_phone_screen.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; +import 'package:navigation/navigation.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class LinkPhoneScreen extends ConsumerWidget { + final NavigationContract navigationContract; + + const LinkPhoneScreen({super.key, required this.navigationContract}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + TextEditingController phoneController = TextEditingController(); + // String? phone; + + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Expanded( + child: Center( + child: Column( + spacing: 10, + children: [ + Text( + "¡Nos alegra mucho tenerte por aquí!", + style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), + ), + Text( + "Para poder entrar de forma segura, te vamos a enviar un código al teléfono", + ), + Row( + spacing: 10, + children: [ + DropdownMenu( + initialSelection: "es", + dropdownMenuEntries: List.generate(3, ( + int index, + ) { + return DropdownMenuEntry( + labelWidget: Icon(Icons.outlined_flag), + label: "es", + value: "es", + ); + }), + ), + Expanded( + child: TextField( + onSubmitted: (String value) { + // phone = value; + }, + controller: phoneController, + decoration: InputDecoration( + labelText: "Teléfono móvil", + hintText: "Teléfono", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + ), + ), + ], + ), + SizedBox( + width: double.infinity, + child: FilledButton( + onPressed: () => navigationContract.pushTo('/phone_code'), + child: Text("Siguiente"), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/payments/view/screens/loading_google_screen.dart b/modules/auth/lib/src/login/presentation/loading_google_screen.dart similarity index 59% rename from lib/payments/view/screens/loading_google_screen.dart rename to modules/auth/lib/src/login/presentation/loading_google_screen.dart index f21edf97..96db9627 100644 --- a/lib/payments/view/screens/loading_google_screen.dart +++ b/modules/auth/lib/src/login/presentation/loading_google_screen.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; +// import 'package:flutter_svg/flutter_svg.dart'; -class LoadingGoogleScreen extends StatelessWidget{ +class LoadingGoogleScreen extends StatelessWidget { const LoadingGoogleScreen({super.key}); @override @@ -13,14 +13,17 @@ class LoadingGoogleScreen extends StatelessWidget{ spacing: 50, children: [ Spacer(flex: 8), - Text("Continuar con Google", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30)), + Text( + "Continuar con Google", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), CircularProgressIndicator(), Text("Redirigiendo a Google"), - Spacer(flex: 10) + Spacer(flex: 10), ], ), - ) + ), ), ); } -} \ No newline at end of file +} diff --git a/lib/payments/view/screens/loading_screen.dart b/modules/auth/lib/src/login/presentation/loading_screen.dart similarity index 100% rename from lib/payments/view/screens/loading_screen.dart rename to modules/auth/lib/src/login/presentation/loading_screen.dart diff --git a/modules/auth/lib/src/login/presentation/login_screen.dart b/modules/auth/lib/src/login/presentation/login_screen.dart new file mode 100644 index 00000000..bc3cc2f5 --- /dev/null +++ b/modules/auth/lib/src/login/presentation/login_screen.dart @@ -0,0 +1,107 @@ +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; + + const LoginScreen({super.key, required this.navigationContract}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + bool passwordVisible = true; + return Scaffold( + body: Expanded( + child: Center( + child: Container( + margin: EdgeInsets.all(30), + child: Column( + spacing: 10, + children: [ + Icon(Icons.check, color: Color(0xFF329e95), size: 50), + Text( + "¡Te damos la bienvenida!", + style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), + ), + TextField( + decoration: InputDecoration( + hintText: "Nombre de usuario", + labelText: "Nombre de usuario", + border: OutlineInputBorder(), + ), + ), + TextField( + obscureText: passwordVisible, + enableSuggestions: false, + autocorrect: false, + decoration: InputDecoration( + labelText: "Contraseña", + hintText: "********", + border: OutlineInputBorder(), + suffixIcon: IconButton( + icon: Icon( + passwordVisible + ? Icons.visibility + : Icons.visibility_off, + ), + onPressed: () { + // setState(() { + // passwordVisible = !passwordVisible; + // }); + }, + ), + ), + ), + TextButton( + onPressed: () => + navigationContract.pushTo('/recover_password'), + child: Text("¿Has olvidado la contraseña?"), + ), + FilledButton( + onPressed: () => + navigationContract.pushTo('/dashboard_shell'), + child: Text("Iniciar sesión"), + ), + Stack(children: [Divider(), Text("o continúa con")]), + Row( + spacing: 20, + children: [ + OutlinedButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => LoadingGoogleScreen(), + ), + ), + child: Text("Google", semanticsLabel: "Google"), + ), + OutlinedButton( + onPressed: () => {}, + child: Icon(Icons.apple, semanticLabel: "Apple"), + ), + ], + ), + Text("¿No tienes cuenta?"), + TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => SignupScreen()), + ), + child: Text("Crear una ahora"), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/login/presentation/phone_code_screen.dart b/modules/auth/lib/src/login/presentation/phone_code_screen.dart new file mode 100644 index 00000000..628a4716 --- /dev/null +++ b/modules/auth/lib/src/login/presentation/phone_code_screen.dart @@ -0,0 +1,89 @@ +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'; +// import 'package:sf_app_platform/payments/view/screens/core/dashboard_screen.dart'; +// import 'package:sf_app_platform/payments/view/screens/login_screen.dart'; + +class PhoneCodeScreen extends ConsumerWidget { + // final String phone; + final NavigationContract navigationContract; + + PhoneCodeScreen({super.key, required this.navigationContract}); + // const PhoneCodeScreen({super.key, required this.phone}); + + // class PhoneCodeScreenState extends State { + final focusNodes = List.generate(6, (int i) { + return FocusNode(); + }); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Expanded( + child: Center( + child: Column( + spacing: 15, + children: [ + Spacer(flex: 8), + Text( + "Conéctate", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + Text.rich( + TextSpan( + text: "Hemos enviado el código al ", + children: [ + TextSpan( + // text: widget.phone, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + ), + Text("Introduce el código aquí"), + Row( + spacing: 20, + children: List.generate(6, (int i) { + return Expanded( + child: TextField( + focusNode: focusNodes[i], + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: "0", + counterText: "", + border: OutlineInputBorder(), + ), + maxLength: 1, + onChanged: (String value) => { + value != "" + ? focusNodes[i + 1].requestFocus() + : focusNodes[i - 1].requestFocus(), + }, + ), + ); + }), + ), + FilledButton( + onPressed: () => {navigationContract.pushTo('/login')}, + child: Text("Entrar"), + ), + Text("¿No lo has recibido?"), + TextButton( + onPressed: () => {}, + child: Text( + "Volver a intentarlo", + style: TextStyle(fontWeight: FontWeight.bold), + ), + ), + Spacer(flex: 10), + ], + ), + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/onboarding/onboarding_builder.dart b/modules/auth/lib/src/onboarding/onboarding_builder.dart new file mode 100644 index 00000000..a1299a53 --- /dev/null +++ b/modules/auth/lib/src/onboarding/onboarding_builder.dart @@ -0,0 +1,18 @@ +import 'package:auth/src/onboarding/presentation/welcome_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class OnboardingBuilder { + const OnboardingBuilder(); + + Page buildPage(BuildContext context, GoRouterState state) { + final NavigationContract navigationContract = GetIt.I(); + + return MaterialPage( + key: state.pageKey, + child: WelcomeScreen(navigationContract: navigationContract), + ); + } +} diff --git a/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart b/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart new file mode 100644 index 00000000..4544f6a2 --- /dev/null +++ b/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; +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; + + const WelcomeScreen({super.key, required this.navigationContract}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + return Scaffold( + body: Center( + child: Column( + children: [ + Spacer(), + Expanded( + child: CarouselView( + scrollDirection: Axis.horizontal, + itemExtent: double.infinity, + itemSnapping: true, + shrinkExtent: 400, + children: generateSteps(), + ), + ), + FilledButton( + onPressed: () => navigationContract.goTo('/link_phone'), + child: const Text('Continuar'), + ), + Spacer(), + ], + ), + ), + ); + } + + void jumpToNext(BuildContext context) { + // Navigator.pushReplacement( + // context, + // MaterialPageRoute(builder: (_) => LinkPhoneScreen()), + // ); + return; + } + + List generateSteps() { + return [ + Column( + spacing: 30, + children: [ + SvgPicture.asset("assets/images/ui/bienvenida_paso1.svg"), + Text( + "Aprende a gestionar su dinero", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Tu peque crea hábitos y se divierte mientras lo hace"), + ], + ), + Column( + children: [ + SvgPicture.asset("assets/images/ui/bienvenida_paso2.svg"), + Text("Tranquilidad en cada pago que hacen"), + Text("Supervisa gastos, fija límites y acompáñalos en cada paso"), + ], + ), + Column( + children: [ + SvgPicture.asset("assets/images/ui/bienvenida_paso3.svg"), + Text("Pagos fáciles y seguros en sus manos"), + Text("Podrá pagar desde su reloj.\n Sin móvil ni efectivo"), + ], + ), + ]; + } +} diff --git a/modules/auth/lib/src/recover_password/presentation/email_sent_screen.dart b/modules/auth/lib/src/recover_password/presentation/email_sent_screen.dart new file mode 100644 index 00000000..f47f4493 --- /dev/null +++ b/modules/auth/lib/src/recover_password/presentation/email_sent_screen.dart @@ -0,0 +1,92 @@ +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'; + +class EmailSentScreen extends StatefulWidget { + final String email; + + const EmailSentScreen({super.key, required this.email}); + + @override + State createState() => EmailSentScreenState(); +} + +class EmailSentScreenState extends State { + @override + Widget build(BuildContext context) { + final theme = context.read(); + + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 20, + children: [ + Spacer(flex: 8), + Text( + "Recuperar contraseña", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + Spacer(flex: 1), + Row( + spacing: 10, + children: [ + Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ), + Text( + "Correo enviado correctamente", + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + Spacer(flex: 1), + Text( + "Revisa tu email y haz clic en el enlace para crear una nueva contraseña", + ), + Text( + "Si no recibes el correo en unos minutos, revisa tu carpeta de spam o pulsa \"Reenviar correo\"", + ), + Row( + spacing: 10, + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => {}, + child: Text("Reenviar correo"), + ), + ), + Expanded( + child: FilledButton( + onPressed: () => { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => NewPasswordScreen(), + ), + ), + }, + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonSecondary), + ), + ), + child: Text("Continuar"), + ), + ), + ], + ), + Spacer(flex: 10), + ], + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart b/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart new file mode 100644 index 00000000..679a616c --- /dev/null +++ b/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart @@ -0,0 +1,191 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +// import '../../../domain/ports/theme_port.dart'; + +class NewPasswordScreen extends StatefulWidget { + const NewPasswordScreen({super.key}); + + @override + State createState() => NewPasswordScreenState(); +} + +class NewPasswordScreenState extends State { + bool passwordVisible = false; + bool equalPasswords = false; + String password = ""; + var securityChecks = { + "min": false, + "capital": false, + "number": false, + "special": false, + }; + + @override + void initState() { + passwordVisible = false; + equalPasswords = false; + String password = ""; + securityChecks = { + "min": false, + "capital": false, + "number": false, + "special": false, + }; + super.initState(); + } + + @override + Widget build(BuildContext context) { + final theme = context.read(); + + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 10, + children: [ + Spacer(flex: 4), + Text( + "Recuperar contraseña", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + TextField( + obscureText: passwordVisible, + enableSuggestions: false, + autocorrect: false, + decoration: InputDecoration( + labelText: "Nueva contraseña", + hintText: "********", + border: OutlineInputBorder(), + suffixIcon: IconButton( + icon: Icon( + passwordVisible ? Icons.visibility : Icons.visibility_off, + ), + onPressed: () { + setState(() { + passwordVisible = !passwordVisible; + }); + }, + ), + ), + onChanged: (value) => { + setState(() { + password = value; + securityChecks = checkSecurity(value); + }), + }, + ), + TextField( + obscureText: passwordVisible, + enableSuggestions: false, + autocorrect: false, + decoration: InputDecoration( + labelText: "Repetir contraseña", + hintText: "********", + border: OutlineInputBorder(), + suffixIcon: IconButton( + icon: Icon( + passwordVisible ? Icons.visibility : Icons.visibility_off, + ), + onPressed: () { + setState(() { + passwordVisible = !passwordVisible; + }); + }, + ), + ), + onChanged: (value) => { + setState(() { + equalPasswords = password == value; + }), + }, + ), + Row( + children: [ + securityChecks["min"]! + ? Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ) + : Icon( + Icons.cancel_outlined, + color: theme.getColorFor(ThemeCode.buttonSecondary), + ), + Text("Al menos 8 caracteres"), + ], + ), + Row( + children: [ + securityChecks["capital"]! + ? Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ) + : Icon( + Icons.cancel_outlined, + color: theme.getColorFor(ThemeCode.buttonSecondary), + ), + Text("Una mayúscula"), + ], + ), + Row( + children: [ + securityChecks["number"]! + ? Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ) + : Icon( + Icons.cancel_outlined, + color: theme.getColorFor(ThemeCode.buttonSecondary), + ), + Text("Un número"), + ], + ), + Row( + children: [ + securityChecks["special"]! + ? Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ) + : Icon( + Icons.cancel_outlined, + color: theme.getColorFor(ThemeCode.buttonSecondary), + ), + Text("Un carácter especial"), + ], + ), + Spacer(flex: 1), + FilledButton( + onPressed: () => {}, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Text("Aceptar"), + ), + ), + Spacer(flex: 4), + ], + ), + ), + ), + ); + } + + //TODO: Extraer de la vista + Map checkSecurity(String value) { + Map checks = {}; + + checks["min"] = value.length >= 8; + checks["capital"] = RegExp(r'[A-Z]').hasMatch(value); + checks["number"] = RegExp(r'[0-9]').hasMatch(value); + checks["special"] = RegExp(r'[^A-Za-z0-9]').hasMatch(value); + + return checks; + } +} diff --git a/modules/auth/lib/src/recover_password/presentation/restore_password_screen.dart b/modules/auth/lib/src/recover_password/presentation/restore_password_screen.dart new file mode 100644 index 00000000..06590dc8 --- /dev/null +++ b/modules/auth/lib/src/recover_password/presentation/restore_password_screen.dart @@ -0,0 +1,80 @@ +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; + + const RestorePasswordScreen({super.key, required this.navigationContract}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + // ThemePort theme = context.read(); + final theme = ref.watch(themePortProvider); + + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 30, + children: [ + Spacer(flex: 8), + Text( + "Recuperar contaseña", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + Text( + "Introduce tu email para enviarte un enlace de recuperación", + ), + TextField( + decoration: InputDecoration( + labelText: "Correo electrónico", + hintText: "Correo electrónico", + border: OutlineInputBorder(), + ), + ), + Row( + spacing: 20, + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => {Navigator.pop(context)}, + child: Text("Volver"), + ), + ), + Expanded( + child: FilledButton( + onPressed: () => { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => EmailSentScreen(email: ""), + ), + ), + }, + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonSecondary), + ), + ), + child: Text("Enviar"), + ), + ), + ], + ), + Spacer(flex: 10), + ], + ), + ), + ), + ); + } +} diff --git a/modules/auth/lib/src/recover_password/recover_password_builder.dart b/modules/auth/lib/src/recover_password/recover_password_builder.dart new file mode 100644 index 00000000..9741c4fc --- /dev/null +++ b/modules/auth/lib/src/recover_password/recover_password_builder.dart @@ -0,0 +1,18 @@ +import 'package:auth/src/recover_password/presentation/restore_password_screen.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class RecoverPasswordBuilder { + const RecoverPasswordBuilder(); + + Page buildPage(BuildContext context, GoRouterState state) { + final NavigationContract navigationContract = GetIt.I(); + + return MaterialPage( + key: state.pageKey, + child: RestorePasswordScreen(navigationContract: navigationContract), + ); + } +} diff --git a/modules/auth/lib/src/sign_up/account_created_screen.dart b/modules/auth/lib/src/sign_up/account_created_screen.dart new file mode 100644 index 00000000..dff054ac --- /dev/null +++ b/modules/auth/lib/src/sign_up/account_created_screen.dart @@ -0,0 +1,78 @@ +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 '../../../../../apps/mobile_app/lib/payments/domain/ports/theme_port.dart'; + +class AccountCreatedScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + ThemePort theme = context.read(); + + final email = "usuario@example.com"; + final fullName = "Carlos Pérez Cruz"; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + spacing: 20, + children: [ + Spacer(flex: 10), + Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.backgroundPrimary), + size: 50, + ), + Text( + "Cuenta creada", + style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold), + ), + Text.rich( + TextSpan( + text: "Has creado la cuenta para:\n", + children: [ + TextSpan( + text: fullName, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "Hemos enviado un email de verificación a:\n", + children: [ + TextSpan( + text: email, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + ), + Text( + "Crea la cuenta de tu peque e ingresa su \nprimera paga para utilizarla con su reloj", + ), + FilledButton( + onPressed: () => { + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (_) => AddKidScreen()), + ), + }, + child: Text("Continuar"), + ), + Spacer(flex: 8), + ], + ), + ), + ), + ); + } +} diff --git a/lib/payments/view/screens/signup/signup_address_screen.dart b/modules/auth/lib/src/sign_up/signup_address_screen.dart similarity index 100% rename from lib/payments/view/screens/signup/signup_address_screen.dart rename to modules/auth/lib/src/sign_up/signup_address_screen.dart diff --git a/lib/payments/view/screens/signup/signup_personal_screen.dart b/modules/auth/lib/src/sign_up/signup_personal_screen.dart similarity index 100% rename from lib/payments/view/screens/signup/signup_personal_screen.dart rename to modules/auth/lib/src/sign_up/signup_personal_screen.dart diff --git a/modules/auth/lib/src/sign_up/signup_screen.dart b/modules/auth/lib/src/sign_up/signup_screen.dart new file mode 100644 index 00000000..737331c2 --- /dev/null +++ b/modules/auth/lib/src/sign_up/signup_screen.dart @@ -0,0 +1,140 @@ +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}); + + int currentStep = 0; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return MaterialApp( + home: Scaffold( + body: Center( + child: Container( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + padding: const EdgeInsets.all(20), + child: SizedBox( + child: Stepper( + controlsBuilder: + (BuildContext context, ControlsDetails controls) { + return Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: controls.onStepCancel, + child: const Text('Atrás'), + ), + ), + Expanded( + child: FilledButton( + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonSecondary), + ), + ), + onPressed: controls.onStepContinue, + child: const Text('Siguiente'), + ), + ), + ], + ); + }, + type: StepperType.horizontal, + currentStep: currentStep, + onStepCancel: () => currentStep == 0, + // ? null + // : setState(() { + // currentStep -= 1; + // }), + onStepContinue: () { + bool isLastStep = (currentStep == getSteps().length - 1); + if (isLastStep) { + Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (_) => AccountCreatedScreen()), + ); + } else { + // setState(() { + // currentStep += 1; + // }); + } + }, + steps: getSteps(), + ), + ), + ), + ), + ), + ); + } + + List getSteps() { + return [ + Step( + state: currentStep > 0 ? StepState.complete : StepState.indexed, + isActive: currentStep >= 0, + stepStyle: currentStep >= 0 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.transparent, + boxShadow: BoxShadow(spreadRadius: 5), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: const Text(""), + content: SignupPersonalScreen(), + ), + Step( + state: currentStep > 1 ? StepState.complete : StepState.indexed, + isActive: currentStep >= 1, + stepStyle: currentStep >= 1 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.white, + boxShadow: BoxShadow(spreadRadius: 1), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: const Text(""), + content: SignupAddressScreen(), + ), + Step( + state: currentStep > 2 ? StepState.complete : StepState.indexed, + isActive: currentStep >= 2, + stepStyle: currentStep >= 2 + ? StepStyle( + connectorThickness: 0, + color: Color(0xFF329e95), + indexStyle: TextStyle(color: Colors.transparent), + ) + : StepStyle( + connectorThickness: 0, + color: Colors.white, + boxShadow: BoxShadow(spreadRadius: 1), + indexStyle: TextStyle(color: Colors.transparent), + ), + title: const Text(""), + content: SignupUserScreen(), + ), + ]; + } +} diff --git a/lib/payments/view/screens/signup/signup_user_screen.dart b/modules/auth/lib/src/sign_up/signup_user_screen.dart similarity index 100% rename from lib/payments/view/screens/signup/signup_user_screen.dart rename to modules/auth/lib/src/sign_up/signup_user_screen.dart diff --git a/modules/auth/pubspec.yaml b/modules/auth/pubspec.yaml new file mode 100644 index 00000000..e7f68094 --- /dev/null +++ b/modules/auth/pubspec.yaml @@ -0,0 +1,69 @@ +name: auth +# resolution: workspace +description: "A new Flutter package project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + #modules dependencies go here + dashboard_shell: + path: ../../modules/dashboard_shell + #packages dependencies go here + design_system: + path: ../../packages/design_system + navigation: + path: ../../packages/navigation + #dependencies go here + flutter_svg: ^2.2.1 + get_it: ^9.0.5 + go_router: ^17.0.0 + flutter_riverpod: ^3.0.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/modules/auth/pubspec_overrides.yaml b/modules/auth/pubspec_overrides.yaml new file mode 100644 index 00000000..309fbed9 --- /dev/null +++ b/modules/auth/pubspec_overrides.yaml @@ -0,0 +1,16 @@ +# melos_managed_dependency_overrides: dashboard_shell,design_system,home,notifications,profile,sf_shared,navigation +dependency_overrides: + dashboard_shell: + path: ../dashboard_shell + design_system: + path: ../../packages/design_system + home: + path: ../home + navigation: + path: ../../packages/navigation + notifications: + path: ../notifications + profile: + path: ../profile + sf_shared: + path: ../../packages/sf_shared diff --git a/modules/dashboard_shell/.gitignore b/modules/dashboard_shell/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/modules/dashboard_shell/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/modules/dashboard_shell/.metadata b/modules/dashboard_shell/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/modules/dashboard_shell/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/modules/dashboard_shell/CHANGELOG.md b/modules/dashboard_shell/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/modules/dashboard_shell/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/modules/dashboard_shell/LICENSE b/modules/dashboard_shell/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/modules/dashboard_shell/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/modules/dashboard_shell/README.md b/modules/dashboard_shell/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/modules/dashboard_shell/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/modules/dashboard_shell/analysis_options.yaml b/modules/dashboard_shell/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/modules/dashboard_shell/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/modules/dashboard_shell/lib/dashboard_builder.dart b/modules/dashboard_shell/lib/dashboard_builder.dart new file mode 100644 index 00000000..e3950561 --- /dev/null +++ b/modules/dashboard_shell/lib/dashboard_builder.dart @@ -0,0 +1,18 @@ +import 'package:dashboard_shell/dashboard_shell.dart'; +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +class DashboardBuilder { + const DashboardBuilder(); + + Widget build(BuildContext context, StatefulNavigationShell navShell) { + final NavigationContract navigationContract = GetIt.I(); + + return DashboardScreen( + navigationShell: navShell, + navigationContract: navigationContract, + ); + } +} diff --git a/modules/dashboard_shell/lib/dashboard_shell.dart b/modules/dashboard_shell/lib/dashboard_shell.dart new file mode 100644 index 00000000..a2432e2b --- /dev/null +++ b/modules/dashboard_shell/lib/dashboard_shell.dart @@ -0,0 +1,2 @@ +export 'src/presentation/dashboard_screen.dart'; +export 'dashboard_builder.dart'; diff --git a/modules/dashboard_shell/lib/src/presentation/dashboard_screen.dart b/modules/dashboard_shell/lib/src/presentation/dashboard_screen.dart new file mode 100644 index 00000000..fa387c18 --- /dev/null +++ b/modules/dashboard_shell/lib/src/presentation/dashboard_screen.dart @@ -0,0 +1,59 @@ +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], + ); + } +} diff --git a/modules/dashboard_shell/pubspec.yaml b/modules/dashboard_shell/pubspec.yaml new file mode 100644 index 00000000..08d224f9 --- /dev/null +++ b/modules/dashboard_shell/pubspec.yaml @@ -0,0 +1,73 @@ +name: dashboard_shell +resoluction: workspace +description: "A new Flutter package project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + #modules dependencies go here + home: + path: ../../modules/home + notifications: + path: ../../modules/notifications + profile: + path: ../../modules/profile + #packages dependencies go here + design_system: + path: ../../packages/design_system + + #dependencies go here + navigation: ^0.0.1 + get_it: ^9.0.5 + go_router: ^17.0.0 + flutter_riverpod: ^3.0.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/modules/dashboard_shell/pubspec_overrides.yaml b/modules/dashboard_shell/pubspec_overrides.yaml new file mode 100644 index 00000000..aaf27ccb --- /dev/null +++ b/modules/dashboard_shell/pubspec_overrides.yaml @@ -0,0 +1,16 @@ +# melos_managed_dependency_overrides: auth,design_system,home,notifications,profile,sf_shared,navigation +dependency_overrides: + auth: + path: ../auth + design_system: + path: ../../packages/design_system + home: + path: ../home + navigation: + path: ../../packages/navigation + notifications: + path: ../notifications + profile: + path: ../profile + sf_shared: + path: ../../packages/sf_shared diff --git a/modules/home/.gitignore b/modules/home/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/modules/home/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/modules/home/.metadata b/modules/home/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/modules/home/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/modules/home/CHANGELOG.md b/modules/home/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/modules/home/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/modules/home/LICENSE b/modules/home/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/modules/home/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/modules/home/README.md b/modules/home/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/modules/home/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/modules/home/analysis_options.yaml b/modules/home/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/modules/home/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/modules/home/lib/home.dart b/modules/home/lib/home.dart new file mode 100644 index 00000000..dc1e0ada --- /dev/null +++ b/modules/home/lib/home.dart @@ -0,0 +1 @@ +export 'src/presentation/home_screen.dart'; diff --git a/modules/home/lib/src/presentation/deposit_screen.dart b/modules/home/lib/src/presentation/deposit_screen.dart new file mode 100644 index 00000000..86d201c2 --- /dev/null +++ b/modules/home/lib/src/presentation/deposit_screen.dart @@ -0,0 +1,193 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class DepositScreen extends ConsumerWidget { + final Kid kid; + + DepositScreen({super.key, required this.kid}); + + String reason = "other"; + bool program = false; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return WalletManagementLayout( + kid: kid, + footer: Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + children: [ + FilledButton( + onPressed: () => {}, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Center(child: Text("Añadir dinero")), + ), + ), + TextButton( + onPressed: () => Navigator.pop(context), + child: Text("Cancelar"), + ), + ], + ), + ), + children: [ + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Ingresar dinero en el wallet", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + TextField( + decoration: InputDecoration( + labelText: "Cantidad", + hintText: "0€", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + ), + Align( + alignment: Alignment.topLeft, + child: Text("Saldo total disponible después: 30 €"), + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Motivo", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Este dato aparecerá en el reloj del peque"), + CheckboxListTile( + title: Text('Paga semanal'), + controlAffinity: ListTileControlAffinity.leading, + value: reason == "weekly", + onChanged: (value) { + // setState(() { + // reason = "weekly"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Objetivo semanal cumplido'), + controlAffinity: ListTileControlAffinity.leading, + value: reason == "goal", + onChanged: (value) { + // setState(() { + // reason = "goal"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Gastos extraordinarios'), + controlAffinity: ListTileControlAffinity.leading, + value: reason == "extraordinary", + onChanged: (value) { + // setState(() { + // reason = "extraordinary"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Otro'), + controlAffinity: ListTileControlAffinity.leading, + value: reason == "other", + onChanged: (value) { + // setState(() { + // reason = "other"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + TextField( + minLines: 3, + maxLines: 3, + maxLength: 150, + decoration: InputDecoration( + labelText: + "Escribir mensaje a ${kid.name} del motivo del ingreso", + hintText: "Escribe tu mensaje", + border: OutlineInputBorder(), + ), + ), + Align( + alignment: Alignment.topLeft, + child: Text("Máximo 150 caracteres"), + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Cuándo se envía el dinero", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Este dato aparecerá en el reloj del peque"), + CheckboxListTile( + title: Text('Ahora'), + controlAffinity: ListTileControlAffinity.leading, + value: program == false, + onChanged: (value) { + // setState(() { + // program = false; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Programar'), + controlAffinity: ListTileControlAffinity.leading, + value: program == true, + onChanged: (value) { + // setState(() { + // program = true; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + if (program) TextField(), + ], + ), + ), + ], + ); + } +} diff --git a/modules/home/lib/src/presentation/home_screen.dart b/modules/home/lib/src/presentation/home_screen.dart new file mode 100644 index 00000000..8047b036 --- /dev/null +++ b/modules/home/lib/src/presentation/home_screen.dart @@ -0,0 +1,274 @@ +import 'package:auth/auth.dart'; +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:home/src/presentation/deposit_screen.dart'; +import 'package:home/src/presentation/kid_wallet_screen.dart'; +import 'package:home/src/presentation/money_text.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class HomeScreen extends ConsumerWidget { + final String name = "Juan"; + final double total = 95.03; + final List kids = [ + Kid(name: "Carlos", balance: 25.47), + Kid(name: "Ana", balance: 25.47), + ]; + late final double available = double.parse( + kids.fold(total, (t, e) => t - e.balance).toStringAsFixed(2), + ); + + HomeScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return SafeArea( + child: SingleChildScrollView( + child: Container( + color: theme.getColorFor(ThemeCode.backgroundSecondary), + margin: EdgeInsets.all(30), + child: Column( + children: [ + Align( + alignment: Alignment.topLeft, + child: Text.rich( + TextSpan( + text: "Hola, ", + style: TextStyle(fontSize: 25), + children: [ + TextSpan( + text: name, + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + ), + ), + walletsList(context, kids, ref), + Align( + alignment: Alignment.topLeft, + child: TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => CreateProfileScreen()), + ), + child: Text( + "+ Añadir otro peque", + style: TextStyle( + fontWeight: FontWeight.bold, + color: theme.getColorFor(ThemeCode.textPrimary), + ), + ), + ), + ), + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + child: Column( + spacing: 5, + children: [ + Row( + children: [ + Text( + "Wallet", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20, + ), + ), + Spacer(), + MoneyText( + text: "$total€ total", + size: 25, + resize: true, + color: theme.getColorFor(ThemeCode.textPrimary), + ), + ], + ), + Stack( + children: [ + LinearProgressIndicator( + value: available / total, + minHeight: 70, + borderRadius: BorderRadius.all(Radius.circular(16)), + color: theme.getColorFor(ThemeCode.buttonPrimary), + backgroundColor: theme.getColorFor( + ThemeCode.backgroundTertiary, + ), + ), + FractionallySizedBox( + widthFactor: available / total, + child: Container( + padding: EdgeInsets.symmetric(vertical: 10), + child: Center( + child: MoneyText( + text: "$available€", + size: 35, + resize: true, + color: theme.getColorFor( + ThemeCode.textSecondary, + ), + ), + ), + ), + ), + ], + ), + Center(child: Text("Disponible")), + ], + ), + ), + DepositBlock(max: 150 - total), + ], + ), + ), + ), + ); + } + + Widget walletsList(BuildContext context, List kids, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return Column( + spacing: 20, + children: List.generate(kids.length, (int index) { + return GestureDetector( + onTap: () => { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => KidWalletScreen(kid: kids[index]), + ), + ), + }, + child: ClipRRect( + borderRadius: const BorderRadius.all(Radius.circular(16.0)), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 8), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: theme.getCardColorFor(index), + ), + ), + child: Column( + children: [ + Align( + alignment: Alignment.topLeft, + child: Text( + kids[index].name, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 25, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + ), + Row( + spacing: 10, + children: [ + SizedBox( + height: 60, + width: 60, + child: SvgPicture.asset("assets/images/ui/face.svg"), + ), + Spacer(), + Column( + children: [ + MoneyText( + text: "${kids[index].balance}€", + size: 50, + resize: true, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + Text( + "en su hucha", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + ], + ), + ], + ), + Row( + children: [ + TextButton( + onPressed: () => showDialog( + context: context, + builder: (BuildContext context) => Dialog( + child: Container( + height: 100, + width: double.infinity, + child: Column( + children: [ + FilledButton( + onPressed: () => {}, + child: Text("Cámara"), + ), + OutlinedButton( + onPressed: () => {}, + child: Text("Galería de fotos"), + ), + ], + ), + ), + ), + ), + child: Row( + spacing: 10, + children: [ + Icon( + Icons.edit, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + Text( + "Editar", + style: TextStyle( + color: theme.getColorFor( + ThemeCode.textSecondary, + ), + ), + ), + ], + ), + ), + Spacer(), + FilledButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => DepositScreen(kid: kids[index]), + ), + ), + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonSecondary), + ), + ), + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 0, + vertical: 10, + ), + child: Text("+ Añadir dinero"), + ), + ), + ], + ), + ], + ), + ), + ), + ); + }), + ); + } +} diff --git a/modules/home/lib/src/presentation/kid_wallet_screen.dart b/modules/home/lib/src/presentation/kid_wallet_screen.dart new file mode 100644 index 00000000..7519dc04 --- /dev/null +++ b/modules/home/lib/src/presentation/kid_wallet_screen.dart @@ -0,0 +1,308 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:home/src/presentation/deposit_screen.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:home/src/presentation/limits_screen.dart'; +import 'package:home/src/presentation/money_text.dart'; +import 'package:home/src/presentation/wage_screen.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class KidWalletScreen extends ConsumerWidget { + final Kid kid; + + const KidWalletScreen({super.key, required this.kid}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Stack( + children: [ + DecoratedBox( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(30)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: theme.getCardColorFor(0), + ), + ), + child: SizedBox(width: double.infinity, height: 300), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 50, horizontal: 20), + child: Column( + spacing: 15, + children: [ + Row( + spacing: 7, + children: [ + IconButton( + onPressed: () => Navigator.pop(context), + icon: Icon( + Icons.arrow_back_ios_new_outlined, + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + ), + SizedBox( + height: 50, + child: SvgPicture.asset("assets/images/ui/face.svg"), + ), + Text( + kid.name, + style: TextStyle( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + fontWeight: FontWeight.bold, + fontSize: 20, + ), + ), + Spacer(), + SizedBox( + height: 30, + child: SvgPicture.asset("assets/images/ui/face.svg"), + ), + ], + ), + MoneyText( + text: "${kid.balance.toString()}€", + size: 60, + resize: true, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + Text( + "Saldo disponible", + style: TextStyle( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + ), + LinearProgressIndicator( + value: 0.7, + color: theme.getColorFor(ThemeCode.backgroundPrimary), + backgroundColor: theme + .getColorFor(ThemeCode.backgroundPrimary) + .withAlpha(0x4C), + minHeight: 10, + borderRadius: BorderRadius.all(Radius.circular(5)), + ), + Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.only(top: 30), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + child: Expanded( + child: Center( + child: Row( + spacing: 10, + children: [ + TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => DepositScreen(kid: kid), + ), + ), + child: Column( + spacing: 10, + children: [ + Icon( + Icons.add_circle_outline, + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + Text( + "Añadir", + style: TextStyle( + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + ), + ], + ), + ), + Spacer(), + TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => WageScreen(kid: kid), + ), + ), + child: Column( + spacing: 10, + children: [ + Icon( + Icons.account_balance_wallet_outlined, + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + Text( + "Paga", + style: TextStyle( + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + ), + ], + ), + ), + Spacer(), + TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => LimitsScreen(kid: kid), + ), + ), + child: Column( + spacing: 10, + children: [ + Icon( + Icons.list_alt_outlined, + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + Text( + "Límites", + style: TextStyle( + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + ), + ], + ), + ), + Spacer(), + TextButton( + onPressed: () => {}, + child: Column( + spacing: 10, + children: [ + Icon( + Icons.emoji_events_outlined, + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + Text( + "Metas", + style: TextStyle( + color: theme.getColorFor( + ThemeCode.textPrimary, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + padding: EdgeInsets.all(15), + height: 400, + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + child: Column( + children: [ + Text("Últimos movimientos"), + activityList(context, theme), + TextButton(onPressed: () => {}, child: Text("Ver todos")), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } + + Widget activityList(BuildContext context, theme) { + final activity = [ + { + "date": "10/05", + "payments": [1, 2, 3], + }, + { + "date": "10/04", + "payments": [1, 2], + }, + { + "date": "10/02", + "payments": [1, 2, 3, 4], + }, + ]; + + return Expanded( + child: ListView( + children: List.generate(activity.length, (int index) { + return Column( + spacing: 20, + children: [ + Text(activity[index]["date"].toString()), + Column( + spacing: 15, + children: List.generate( + (activity[index]["payments"] as List).length, + (int i) { + //var a = (activity[index]["payments"] as List)[i]; + return Row( + spacing: 7, + children: [ + Container( + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: theme.getColorFor( + ThemeCode.backgroundTertiary, + ), + borderRadius: BorderRadius.all(Radius.circular(16)), + ), + child: Icon( + Icons.local_pizza_outlined, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ), + ), + Column( + children: [ + Text( + "Vips", + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text("20:15"), + ], + ), + Spacer(), + MoneyText( + text: "5.1€", + size: 20, + resize: true, + color: theme.getColorFor(ThemeCode.textPrimary), + ), + ], + ); + }, + ), + ), + ], + ); + }), + ), + ); + } +} diff --git a/modules/home/lib/src/presentation/limits_screen.dart b/modules/home/lib/src/presentation/limits_screen.dart new file mode 100644 index 00000000..c9479b06 --- /dev/null +++ b/modules/home/lib/src/presentation/limits_screen.dart @@ -0,0 +1,156 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class LimitsScreen extends ConsumerStatefulWidget { + final Kid kid; + + const LimitsScreen({super.key, required this.kid}); + + @override + ConsumerState createState() => LimitsScreenState(); +} + +class LimitsScreenState extends ConsumerState { + late List dailyLimits; + late List timeLimits; + late List conditions; + late List blocks; + + @override + void initState() { + super.initState(); + dailyLimits = [ + {"title": "Diario L-V", "limit": "5", "edit": false}, + {"title": "Fines de semana", "limit": "8", "edit": false}, + {"title": "Semanal", "limit": "30", "edit": false}, + {"title": "Mensual", "limit": "1200", "edit": false}, + ]; + timeLimits = [ + { + "title": "Lunes a Viernes", + "start": "08:00", + "end": "20:00", + "edit": false, + }, + { + "title": "Fines de semana", + "start": "10:00", + "end": "21:00", + "edit": false, + }, + {"title": "Vacaciones", "start": "09:00", "end": "22:00", "edit": false}, + ]; + conditions = [ + {"title": "Alimentación", "limit": "10", "edit": false}, + {"title": "Transporte", "limit": "10", "edit": false}, + {"title": "Alimentación", "limit": "10", "edit": false}, + ]; + blocks = []; + } + + @override + Widget build(BuildContext context) { + final theme = ref.watch(themePortProvider); + + return WalletManagementLayout( + kid: widget.kid, + footer: Column( + children: [ + FilledButton( + onPressed: () => {}, + child: SizedBox( + width: double.infinity, + child: Center(child: Text("Guardar límites")), + ), + ), + ], + ), + children: [ + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + spacing: 10, + children: [ + Text( + "Pon límite de gastos", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Libertad para ellos, tranquilidad para ti"), + ...List.generate(dailyLimits.length, (int index) { + return Column( + children: [ + Row( + children: [ + Text( + "${dailyLimits[index]["title"]}: ${dailyLimits[index]["limit"]} €", + ), + Spacer(), + TextButton( + onPressed: () => { + setState(() { + dailyLimits[index]["edit"] = + !dailyLimits[index]["edit"]; + }), + }, + child: Text("Editar"), + ), + ], + ), + if (dailyLimits[index]["edit"]) TextField(), + ], + ); + }), + ], + ), + ), + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + spacing: 10, + children: [ + Text( + "Horarios permitidos", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Controla cuándo pueden comprar"), + ...List.generate(timeLimits.length, (int index) { + return Column( + children: [ + Row( + children: [ + Text( + "${timeLimits[index]["title"]}: ${timeLimits[index]["start"]} - ${timeLimits[index]["end"]}", + ), + Spacer(), + TextButton( + onPressed: () => { + setState(() { + timeLimits[index]["edit"] = + !timeLimits[index]["edit"]; + }), + }, + child: Text("Editar"), + ), + ], + ), + if (timeLimits[index]["edit"]) TextField(), + ], + ); + }), + ], + ), + ), + ], + ); + } +} diff --git a/lib/payments/view/screens/core/money_text.dart b/modules/home/lib/src/presentation/money_text.dart similarity index 100% rename from lib/payments/view/screens/core/money_text.dart rename to modules/home/lib/src/presentation/money_text.dart diff --git a/modules/home/lib/src/presentation/wage_screen.dart b/modules/home/lib/src/presentation/wage_screen.dart new file mode 100644 index 00000000..c86d1e5e --- /dev/null +++ b/modules/home/lib/src/presentation/wage_screen.dart @@ -0,0 +1,228 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:provider/provider.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class WageScreen extends ConsumerWidget { + final Kid kid; + + WageScreen({super.key, required this.kid}); + + String frequence = "weekly"; + var conditions = { + "weeklyLimits": false, + "incidences": false, + "holidays": false, + }; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return WalletManagementLayout( + kid: kid, + footer: Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Column( + spacing: 10, + children: [ + FilledButton( + onPressed: () => {}, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Center(child: Text("Activar paga automática")), + ), + ), + TextButton(onPressed: () => {}, child: Text("Cancelar")), + ], + ), + ), + children: [ + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Paga automática", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + TextField( + decoration: InputDecoration( + labelText: "Cantidad", + hintText: "0€", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + ), + Text("Saldo total disponible después: 30 €"), + ], + ), + ), + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Frecuencia", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Cuándo se envía el dinero"), + CheckboxListTile( + title: Text('Semanal'), + controlAffinity: ListTileControlAffinity.leading, + value: frequence == "weekly", + onChanged: (value) { + // setState(() { + // frequence = "weekly"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Cada dos semanas'), + controlAffinity: ListTileControlAffinity.leading, + value: frequence == "biweekly", + onChanged: (value) { + // setState(() { + // frequence = "biweekly"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Mensual'), + controlAffinity: ListTileControlAffinity.leading, + value: frequence == "monthly", + onChanged: (value) { + // setState(() { + // frequence = "monthly"; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + Container( + width: double.infinity, + child: DropdownMenu( + label: Text("Día de la semana"), + initialSelection: "Domingo", + dropdownMenuEntries: List.generate(7, ( + int index, + ) { + final days = [ + "Lunes", + "Martes", + "Miércoles", + "Jueves", + "Viernes", + "Sábado", + "Domingo", + ]; + return DropdownMenuEntry( + value: days[index], + label: days[index], + ); + }), + ), + ), + DropdownMenu( + label: Text("Hora del día"), + initialSelection: 9, + dropdownMenuEntries: List.generate(24, ( + int index, + ) { + return DropdownMenuEntry(value: index, label: "$index:00"); + }), + ), + TextField( + minLines: 3, + maxLines: 3, + maxLength: 150, + decoration: InputDecoration( + labelText: + "Escribir mensaje a ${kid.name} del motivo del ingreso", + hintText: "Escribe tu mensaje", + border: OutlineInputBorder(), + ), + ), + Align( + alignment: Alignment.topLeft, + child: Text("Máximo 150 caracteres"), + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + padding: EdgeInsets.all(10), + child: Column( + spacing: 10, + children: [ + Text( + "Condiciones", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Text("Este dato aparecerá en el reloj del peque"), + CheckboxListTile( + title: Text('Sólo si cumple límites semanales'), + controlAffinity: ListTileControlAffinity.leading, + value: conditions["weeklyLimits"], + onChanged: (value) { + // setState(() { + // conditions["weeklyLimits"] = !conditions["weeklyLimits"]!; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Sólo si no ha tenido incidencias'), + controlAffinity: ListTileControlAffinity.leading, + value: conditions["incidences"], + onChanged: (value) { + // setState(() { + // conditions["incidences"] = !conditions["incidences"]!; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + CheckboxListTile( + title: Text('Pausar durante vacaciones'), + controlAffinity: ListTileControlAffinity.leading, + value: conditions["holidays"], + onChanged: (value) { + // setState(() { + // conditions["holidays"] = !conditions["holidays"]!; + // }); + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + ), + ], + ), + ), + ], + ); + } +} diff --git a/modules/home/pubspec.yaml b/modules/home/pubspec.yaml new file mode 100644 index 00000000..8191feae --- /dev/null +++ b/modules/home/pubspec.yaml @@ -0,0 +1,70 @@ +name: home +# resolution: workspace +description: "A new Flutter package project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + #modules dependencies go here + auth: + path: ../../modules/auth + notifications: + path: ../../modules/notifications + + #packages dependencies go here + design_system: + path: ../../packages/design_system + sf_shared: + path: ../../packages/sf_shared + #dependencies go here + flutter_svg: ^2.2.1 + flutter_riverpod: ^3.0.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/modules/home/pubspec_overrides.yaml b/modules/home/pubspec_overrides.yaml new file mode 100644 index 00000000..11e140da --- /dev/null +++ b/modules/home/pubspec_overrides.yaml @@ -0,0 +1,16 @@ +# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,notifications,profile,sf_shared,navigation +dependency_overrides: + auth: + path: ../auth + dashboard_shell: + path: ../dashboard_shell + design_system: + path: ../../packages/design_system + navigation: + path: ../../packages/navigation + notifications: + path: ../notifications + profile: + path: ../profile + sf_shared: + path: ../../packages/sf_shared diff --git a/modules/notifications/.gitignore b/modules/notifications/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/modules/notifications/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/modules/notifications/.metadata b/modules/notifications/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/modules/notifications/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/modules/notifications/CHANGELOG.md b/modules/notifications/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/modules/notifications/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/modules/notifications/LICENSE b/modules/notifications/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/modules/notifications/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/modules/notifications/README.md b/modules/notifications/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/modules/notifications/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/modules/notifications/analysis_options.yaml b/modules/notifications/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/modules/notifications/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/modules/notifications/lib/notifications.dart b/modules/notifications/lib/notifications.dart new file mode 100644 index 00000000..b895dbfd --- /dev/null +++ b/modules/notifications/lib/notifications.dart @@ -0,0 +1,3 @@ +export 'src/presentation/alert_screen.dart'; +export 'src/presentation/activity_screen.dart'; +export 'src/core/activity_list.dart'; diff --git a/modules/notifications/lib/src/core/activity_list.dart b/modules/notifications/lib/src/core/activity_list.dart new file mode 100644 index 00000000..686a86b5 --- /dev/null +++ b/modules/notifications/lib/src/core/activity_list.dart @@ -0,0 +1,106 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class ActivityList extends ConsumerStatefulWidget { + final List activity; + bool edit = false; + + ActivityList({super.key, required this.activity, required this.edit}); + + @override + ConsumerState createState() => ActivityListState(); +} + +class ActivityListState extends ConsumerState { + late List values; + + @override + void initState() { + values = List.generate(widget.activity.length, (_) => false); + super.initState(); + } + + @override + Widget build(BuildContext context) { + final theme = ref.watch(themePortProvider); + + final colors = [ + Colors.cyan, + Colors.pinkAccent, + Colors.deepOrangeAccent, + Colors.red, + ]; + final icons = { + "wage": Icons.wallet, + "goal": Icons.emoji_events_outlined, + "lock": Icons.lock_outline, + "reload": Icons.attach_money_outlined, + }; + final titles = { + "wage": "Entrega de paga", + "goal": "¡Objetivo cumplido!", + "lock": "Bloqueo de pago", + "reload": "Recarga familiar", + }; + + return Column( + spacing: 20, + children: List.generate(widget.activity.length, (int index) { + var logItem = Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + border: BoxBorder.fromLTRB( + left: BorderSide(color: colors[index % colors.length], width: 5), + ), + ), + child: Column( + spacing: 15, + children: [ + Row( + children: [ + Icon( + icons[widget.activity[index]["type"]], + color: colors[index % colors.length], + ), + Text( + titles[widget.activity[index]["type"]]!, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), + ), + Spacer(), + Text("14/01/2005"), + ], + ), + Align( + alignment: Alignment.topLeft, + child: Text("Ana ya tiene su paga de 5€ en el reloj"), + ), + ], + ), + ); + + if (widget.edit) { + return Row( + children: [ + Checkbox( + value: values[index], + onChanged: (value) => { + setState(() { + values[index] = !values[index]; + }), + }, + activeColor: theme.getColorFor(ThemeCode.buttonPrimary), + semanticLabel: "Eliminar", + ), + Expanded(child: logItem), + ], + ); + } else { + return logItem; + } + }), + ); + } +} diff --git a/modules/notifications/lib/src/presentation/activity_screen.dart b/modules/notifications/lib/src/presentation/activity_screen.dart new file mode 100644 index 00000000..c0fe189d --- /dev/null +++ b/modules/notifications/lib/src/presentation/activity_screen.dart @@ -0,0 +1,57 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:notifications/src/core/activity_list.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:sf_shared/sf_shared.dart'; + +class ActivityScreen extends ConsumerWidget { + ActivityScreen({super.key}); + + final activity = [ + {"type": "goal"}, + {"type": "wage", "amount": 5}, + {"type": "lock"}, + {"type": "lock"}, + ]; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + final content = [ + Text( + "Movimientos recientes", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), + ), + Row( + spacing: 20, + children: [ + FilledButton(onPressed: () => {}, child: Text("Hoy")), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Última semana")), + TextButton(onPressed: () => {}, child: Text("Mes")), + ], + ), + SizedBox(height: 200, child: LineGraph()), + ActivityList(activity: activity, edit: false), + ]; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Container( + margin: EdgeInsets.fromLTRB(30, 30, 30, 0), + child: Center( + child: ListView.separated( + itemBuilder: (BuildContext context, int index) { + return content[index]; + }, + separatorBuilder: (BuildContext context, int index) { + return Divider(color: Colors.transparent, height: 30); + }, + itemCount: content.length, + ), + ), + ), + ); + } +} diff --git a/modules/notifications/lib/src/presentation/alert_screen.dart b/modules/notifications/lib/src/presentation/alert_screen.dart new file mode 100644 index 00000000..4f46d168 --- /dev/null +++ b/modules/notifications/lib/src/presentation/alert_screen.dart @@ -0,0 +1,56 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:notifications/src/core/activity_list.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class AlertScreen extends ConsumerStatefulWidget { + const AlertScreen({super.key}); + + @override + ConsumerState createState() => AlertScreenState(); +} + +class AlertScreenState extends ConsumerState { + final activity = [ + {"type": "goal"}, + {"type": "wage", "amount": 5}, + {"type": "lock"}, + {"type": "lock"}, + ]; + bool edit = false; + + @override + void initState() { + edit = false; + super.initState(); + } + + @override + Widget build(BuildContext context) { + final theme = ref.watch(themePortProvider); + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Container( + margin: EdgeInsets.all(30), + child: Column( + children: [ + Row( + children: [ + Text("Alertas"), + Spacer(), + TextButton( + onPressed: () => setState(() { + edit = !edit; + }), + child: Text("Editar"), + ), + ], + ), + ActivityList(activity: activity, edit: edit), + ], + ), + ), + ); + } +} diff --git a/modules/notifications/pubspec.yaml b/modules/notifications/pubspec.yaml new file mode 100644 index 00000000..bedad565 --- /dev/null +++ b/modules/notifications/pubspec.yaml @@ -0,0 +1,65 @@ +name: notifications +# resolution: workspace +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +description: "A new Flutter package project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + #modules dependencies go here + design_system: + path: ../../packages/design_system + #packages dependencies go here + sf_shared: + path: ../../packages/sf_shared + #dependencies go here + flutter_riverpod: ^3.0.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/modules/notifications/pubspec_overrides.yaml b/modules/notifications/pubspec_overrides.yaml new file mode 100644 index 00000000..35658845 --- /dev/null +++ b/modules/notifications/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: design_system,sf_shared +dependency_overrides: + design_system: + path: ../../packages/design_system + sf_shared: + path: ../../packages/sf_shared diff --git a/modules/profile/.gitignore b/modules/profile/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/modules/profile/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/modules/profile/.metadata b/modules/profile/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/modules/profile/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/modules/profile/CHANGELOG.md b/modules/profile/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/modules/profile/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/modules/profile/LICENSE b/modules/profile/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/modules/profile/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/modules/profile/README.md b/modules/profile/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/modules/profile/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/modules/profile/analysis_options.yaml b/modules/profile/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/modules/profile/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/modules/profile/lib/profile.dart b/modules/profile/lib/profile.dart new file mode 100644 index 00000000..ac614ad6 --- /dev/null +++ b/modules/profile/lib/profile.dart @@ -0,0 +1 @@ +export 'src/presentation/profile_screen.dart'; diff --git a/modules/profile/lib/src/presentation/profile_screen.dart b/modules/profile/lib/src/presentation/profile_screen.dart new file mode 100644 index 00000000..71af4c7d --- /dev/null +++ b/modules/profile/lib/src/presentation/profile_screen.dart @@ -0,0 +1,135 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:notifications/notifications.dart'; +import 'package:profile/src/settings_screen.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class ProfileScreen extends ConsumerWidget { + const ProfileScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + final activity = [ + {"type": "goal"}, + {"type": "wage", "amount": 5}, + {"type": "lock"}, + {"type": "lock"}, + ]; + + final name = "Juan"; + final total = 95.03; + final available = 44.09; + + final content = [ + Row( + children: [ + Text( + name, + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), + Spacer(), + TextButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => SettingsScreen()), + ), + child: Text( + "Ajustes de la cuenta", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + ), + ], + ), + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + child: Column( + spacing: 5, + children: [ + Row( + children: [ + Text("Wallet", style: TextStyle(fontWeight: FontWeight.bold)), + Spacer(), + Text("$total€"), + ], + ), + Stack( + children: [ + LinearProgressIndicator( + value: available / total, + minHeight: 70, + borderRadius: BorderRadius.all(Radius.circular(16)), + ), + FractionallySizedBox( + widthFactor: available / total, + child: Container( + padding: EdgeInsets.symmetric(vertical: 20), + child: Center( + child: Text( + "$available€", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + fontSize: 20, + ), + ), + ), + ), + ), + ], + ), + Center(child: Text("Disponible")), + ], + ), + ), + SizedBox(height: 200, child: LineGraph()), + DepositBlock(max: 150 - total), + Row(), + ActivityList(activity: activity, edit: false), + ]; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Stack( + children: [ + DecoratedBox( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(30)), + color: Color(0xFF4B4B4B), + ), + child: SizedBox(width: double.infinity, height: 200), + ), + Column( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.fromLTRB(20, 20, 20, 0), + child: ListView.separated( + itemBuilder: (BuildContext context, int index) { + return content[index]; + }, + separatorBuilder: (BuildContext context, int index) { + return Divider(color: Colors.transparent, height: 20); + }, + itemCount: content.length, + ), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/modules/profile/lib/src/settings_screen.dart b/modules/profile/lib/src/settings_screen.dart new file mode 100644 index 00000000..42f9477b --- /dev/null +++ b/modules/profile/lib/src/settings_screen.dart @@ -0,0 +1,360 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class SettingsScreen extends ConsumerWidget { + const SettingsScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + final name = "Juan"; + final balance = 50; + final fullName = "Juan Pérez Cruz"; + final birthDate = "08/03/1976"; + final relation = "Padre"; + final address = "Calle Gran Vía 30 6º, 28013"; + final country = "España"; + final nationality = "Español"; + final email = "juanpcruz@gmail.com"; + final phone = "123456789"; + + final content = [ + Center( + child: Column( + children: [ + Text( + "Ajustes de la cuenta", + style: TextStyle( + fontSize: 30, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + Text( + "Saldo: $balance€", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + name, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar wallet")), + Icon(Icons.attach_money), + ], + ), + Text(relation), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + "Datos personales", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar")), + ], + ), + Text.rich( + TextSpan( + text: "Nombre: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: fullName, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "Fecha de nacimiento: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: birthDate, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "Familiar: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: relation, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + "Dirección", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar")), + ], + ), + Text.rich( + TextSpan( + text: "Dirección: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: address, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "País: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: country, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "Nacionalidad: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: nationality, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + "Usuario", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar")), + ], + ), + Text.rich( + TextSpan( + text: "Correo: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: email, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + Text.rich( + TextSpan( + text: "Teléfono: ", + style: TextStyle(fontWeight: FontWeight.bold), + children: [ + TextSpan( + text: phone, + style: TextStyle(fontWeight: FontWeight.normal), + ), + ], + ), + ), + ], + ), + ), + + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Row( + spacing: 10, + children: [ + Text( + "Cambio de contraseña", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar")), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + "Método de pago", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Editar")), + ], + ), + Text("Puedes cambiar el método de pago en cualquier momento"), + ], + ), + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundTertiary), + ), + child: Column( + children: [ + Row( + spacing: 10, + children: [ + Text( + "Plan anual", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Spacer(), + TextButton(onPressed: () => {}, child: Text("Cambiar Plan")), + ], + ), + Text("Sin permanencia"), + Text("Llamadas y datos ilimitados"), + Text("2 meses gratis"), + ], + ), + ), + + TextButton(onPressed: () => {}, child: Text("Contáctanos")), + TextButton(onPressed: () => {}, child: Text("Preguntas frecuentes")), + ]; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Stack( + children: [ + DecoratedBox( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(30)), + color: Color(0xFF4B4B4B), + ), + child: SizedBox(width: double.infinity, height: 200), + ), + Column( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(20), + child: ListView.separated( + itemBuilder: (BuildContext context, int index) { + return content[index]; + }, + separatorBuilder: (BuildContext context, int index) { + return Divider(color: Colors.transparent, height: 20); + }, + itemCount: content.length, + ), + ), + ), + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + children: [ + FilledButton( + onPressed: () => {}, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Center(child: Text("Guardar cambios")), + ), + ), + TextButton( + onPressed: () => Navigator.pop(context), + child: Text("Cancelar"), + ), + ], + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/modules/profile/pubspec.yaml b/modules/profile/pubspec.yaml new file mode 100644 index 00000000..7b1ef832 --- /dev/null +++ b/modules/profile/pubspec.yaml @@ -0,0 +1,67 @@ +name: profile +# resolution: workspace +description: "A new Flutter package project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + #modules dependencies go here + notifications: + path: ../../modules/notifications + #packages dependencies go here + design_system: + path: ../../packages/design_system + sf_shared: + path: ../../packages/sf_shared + + #dependencies go here + flutter_riverpod: ^3.0.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/modules/profile/pubspec_overrides.yaml b/modules/profile/pubspec_overrides.yaml new file mode 100644 index 00000000..de25ad5a --- /dev/null +++ b/modules/profile/pubspec_overrides.yaml @@ -0,0 +1,8 @@ +# melos_managed_dependency_overrides: design_system,notifications,sf_shared +dependency_overrides: + design_system: + path: ../../packages/design_system + notifications: + path: ../notifications + sf_shared: + path: ../../packages/sf_shared diff --git a/packages/design_system/.gitignore b/packages/design_system/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/packages/design_system/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/packages/design_system/.metadata b/packages/design_system/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/packages/design_system/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/packages/design_system/CHANGELOG.md b/packages/design_system/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/packages/design_system/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/design_system/LICENSE b/packages/design_system/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/packages/design_system/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/design_system/README.md b/packages/design_system/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/packages/design_system/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/design_system/analysis_options.yaml b/packages/design_system/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/packages/design_system/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/design_system/lib/design_system.dart b/packages/design_system/lib/design_system.dart new file mode 100644 index 00000000..11d0bc22 --- /dev/null +++ b/packages/design_system/lib/design_system.dart @@ -0,0 +1,2 @@ +export 'src/theme/theme_port.dart'; +export 'src/theme/theme_sf_adapter.dart'; diff --git a/packages/design_system/lib/src/theme/theme_port.dart b/packages/design_system/lib/src/theme/theme_port.dart new file mode 100644 index 00000000..19b06231 --- /dev/null +++ b/packages/design_system/lib/src/theme/theme_port.dart @@ -0,0 +1,40 @@ +import 'dart:ui'; +import 'package:design_system/design_system.dart'; +import 'package:get_it/get_it.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +final GetIt getIt = GetIt.instance; + +void themePackages() { + getIt.registerSingleton(ThemeSfAdapter()); +} + +final themePortProvider = Provider((ref) => getIt()); + +enum ThemeCode { + backgroundPrimary, + backgroundSecondary, + backgroundTertiary, + textPrimary, + textSecondary, + textTertiary, + buttonPrimary, + buttonSecondary, +} + +abstract class ThemePort { + late Map theme; + late List> cardColors; + + Color getColorFor(ThemeCode code) { + Color? c = theme[code]; + if (c == null) { + throw Exception("Theme key not found"); + } + return c; + } + + List getCardColorFor(int index) { + return cardColors[index % cardColors.length]; + } +} diff --git a/packages/design_system/lib/src/theme/theme_sf_adapter.dart b/packages/design_system/lib/src/theme/theme_sf_adapter.dart new file mode 100644 index 00000000..4fb68de4 --- /dev/null +++ b/packages/design_system/lib/src/theme/theme_sf_adapter.dart @@ -0,0 +1,25 @@ +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 theme = HashMap.from({ + ThemeCode.backgroundPrimary: Color(0xFFFFFFFF), + ThemeCode.backgroundSecondary: Color(0xFFF7F7F7), + ThemeCode.backgroundTertiary: Color(0x4D329E95), + ThemeCode.textPrimary: Color(0xFF4B4B4B), + ThemeCode.textSecondary: Color(0xFFFFFFFF), + ThemeCode.textTertiary: Color(0xFFE0E0E0), + ThemeCode.buttonPrimary: Color(0xFF329e95), + ThemeCode.buttonSecondary: Color(0xFF4B4B4B), + }); + + @override + List> cardColors = [ + [Color(0xFFFA5C9F), Color(0xFFEB2579), Color(0xFFE60866)], + [Color(0xFF00A1C6), Color(0xFF00819E)], + ]; +} diff --git a/packages/design_system/pubspec.yaml b/packages/design_system/pubspec.yaml new file mode 100644 index 00000000..ea02fd3a --- /dev/null +++ b/packages/design_system/pubspec.yaml @@ -0,0 +1,57 @@ +name: design_system +# resolution: workspace +description: "A new Flutter package project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + flutter_riverpod: ^3.0.3 + get_it: ^9.0.5 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/packages/navigation/.gitignore b/packages/navigation/.gitignore new file mode 100644 index 00000000..eb6c05cd --- /dev/null +++ b/packages/navigation/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +build/ diff --git a/packages/navigation/.metadata b/packages/navigation/.metadata new file mode 100644 index 00000000..231eccaf --- /dev/null +++ b/packages/navigation/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "b25305a8832cfc6ba632a7f87ad455e319dccce8" + channel: "stable" + +project_type: package diff --git a/packages/navigation/CHANGELOG.md b/packages/navigation/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/packages/navigation/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/navigation/LICENSE b/packages/navigation/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/packages/navigation/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/navigation/README.md b/packages/navigation/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/packages/navigation/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/navigation/analysis_options.yaml b/packages/navigation/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/packages/navigation/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/navigation/lib/navigation.dart b/packages/navigation/lib/navigation.dart new file mode 100644 index 00000000..1c7c7d6a --- /dev/null +++ b/packages/navigation/lib/navigation.dart @@ -0,0 +1,34 @@ +import 'package:go_router/go_router.dart'; + +abstract class NavigationContract { + void setRouter(GoRouter goRouter); + void goTo(String path); + void pushTo(String path); + void goBack(); +} + +class Navigation implements NavigationContract { + late final GoRouter router; + + @override + void setRouter(GoRouter goRouter) { + router = goRouter; + } + + @override + void goTo(String path) { + router.go(path); + } + + @override + void pushTo(String path) { + router.push(path); + } + + @override + void goBack() { + if (router.canPop()) { + router.pop(); + } + } +} \ No newline at end of file diff --git a/packages/navigation/lib/navigation_module.dart b/packages/navigation/lib/navigation_module.dart new file mode 100644 index 00000000..393c64bf --- /dev/null +++ b/packages/navigation/lib/navigation_module.dart @@ -0,0 +1,8 @@ +import 'package:get_it/get_it.dart'; +import 'package:navigation/navigation.dart'; + +final GetIt getIt = GetIt.instance; + +void navigationModule() { + getIt.registerLazySingleton(() => Navigation()); +} \ No newline at end of file diff --git a/packages/navigation/pubspec.yaml b/packages/navigation/pubspec.yaml new file mode 100644 index 00000000..405f20fa --- /dev/null +++ b/packages/navigation/pubspec.yaml @@ -0,0 +1,57 @@ +name: navigation +# resolution: workspace +description: "A new Flutter package project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.8.1 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + get_it: ^9.0.5 + go_router: ^17.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/packages/sf_shared/.gitignore b/packages/sf_shared/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/packages/sf_shared/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/packages/sf_shared/.metadata b/packages/sf_shared/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/packages/sf_shared/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/packages/sf_shared/CHANGELOG.md b/packages/sf_shared/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/packages/sf_shared/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/sf_shared/LICENSE b/packages/sf_shared/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/packages/sf_shared/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/sf_shared/README.md b/packages/sf_shared/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/packages/sf_shared/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/sf_shared/analysis_options.yaml b/packages/sf_shared/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/packages/sf_shared/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/sf_shared/lib/sf_shared.dart b/packages/sf_shared/lib/sf_shared.dart new file mode 100644 index 00000000..f045fb7e --- /dev/null +++ b/packages/sf_shared/lib/sf_shared.dart @@ -0,0 +1,7 @@ +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'; diff --git a/lib/payments/view/screens/errors/connection_error_screen.dart b/packages/sf_shared/lib/src/connection_error_screen.dart similarity index 100% rename from lib/payments/view/screens/errors/connection_error_screen.dart rename to packages/sf_shared/lib/src/connection_error_screen.dart diff --git a/packages/sf_shared/lib/src/deposit_block.dart b/packages/sf_shared/lib/src/deposit_block.dart new file mode 100644 index 00000000..b4f564a6 --- /dev/null +++ b/packages/sf_shared/lib/src/deposit_block.dart @@ -0,0 +1,61 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class DepositBlock extends ConsumerWidget { + final double max; + + const DepositBlock({super.key, required this.max}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + color: theme.getColorFor(ThemeCode.backgroundPrimary), + borderRadius: BorderRadius.all(Radius.circular(20)), + ), + margin: EdgeInsets.only(top: 10), + child: Column( + children: [ + Text( + "Ingresar dinero en el wallet", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), + ), + Row( + spacing: 10, + children: [ + Expanded( + child: TextField( + decoration: InputDecoration( + labelText: "Cantidad", + hintText: "0€", + border: OutlineInputBorder(), + ), + keyboardType: TextInputType.number, + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + ), + ), + FilledButton( + onPressed: () => {}, + style: ButtonStyle( + backgroundColor: WidgetStatePropertyAll( + theme.getColorFor(ThemeCode.buttonPrimary), + ), + ), + child: Text("Ingresar"), + ), + ], + ), + Align( + alignment: Alignment.topLeft, + child: Text("Máximo que puedes añadir: $max€"), + ), + ], + ), + ); + } +} diff --git a/lib/payments/domain/entities/kid.dart b/packages/sf_shared/lib/src/kid.dart similarity index 100% rename from lib/payments/domain/entities/kid.dart rename to packages/sf_shared/lib/src/kid.dart diff --git a/packages/sf_shared/lib/src/line_graph.dart b/packages/sf_shared/lib/src/line_graph.dart new file mode 100644 index 00000000..4e42da11 --- /dev/null +++ b/packages/sf_shared/lib/src/line_graph.dart @@ -0,0 +1,178 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class LineGraph extends ConsumerStatefulWidget { + final lines = [ + [0, 1, 0, 1, 0, 1, 0], + [1, 0, 1, 0, 1, 0, 1], + ]; + + LineGraph({super.key}); + + @override + ConsumerState createState() => LineGraphState(); +} + +class LineGraphState extends ConsumerState { + final weekDays = ["L", "M", "X", "J", "V", "S", "D"]; + String? timeSpan; + late var days = weekDays; + + @override + void initState() { + timeSpan = "week"; + super.initState(); + } + + @override + Widget build(BuildContext context) { + final theme = ref.watch(themePortProvider); + + return Container( + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + border: BoxBorder.fromLTRB( + left: BorderSide(color: Colors.cyan, width: 5), + ), + borderRadius: BorderRadius.all(Radius.circular(20)), + color: theme.getColorFor(ThemeCode.backgroundPrimary), + ), + child: Column( + spacing: 10, + children: [ + Row( + children: [ + Text("Gastos", style: TextStyle(fontWeight: FontWeight.bold)), + Spacer(), + Container( + padding: EdgeInsets.symmetric(horizontal: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: theme.getColorFor(ThemeCode.backgroundSecondary), + ), + child: DropdownButton( + underline: Container(), + value: timeSpan, + onChanged: (String? value) { + setState(() { + timeSpan = value; + }); + }, + dropdownColor: theme.getColorFor(ThemeCode.backgroundPrimary), + items: [ + DropdownMenuItem(value: "day", child: Text("Hoy")), + DropdownMenuItem(value: "week", child: Text("Esta semana")), + DropdownMenuItem(value: "month", child: Text("Este mes")), + ], + ), + ), + ], + ), + Expanded( + child: LineChart( + LineChartData( + gridData: FlGridData( + show: true, + drawHorizontalLine: false, + drawVerticalLine: true, + verticalInterval: 1, + ), + titlesData: FlTitlesData( + //show: false, + bottomTitles: AxisTitles( + sideTitles: SideTitles( + showTitles: true, + reservedSize: 40, + getTitlesWidget: (double value, TitleMeta meta) => + SideTitleWidget( + space: 4, + meta: meta, + /*fitInside: fitInsideBottomTitle + ? SideTitleFitInsideData.fromTitleMeta(meta, distanceFromEdge: 0) + : SideTitleFitInsideData.disable(),*/ + child: Text(weekDays[value.toInt()]), + ), + ), + ), + leftTitles: AxisTitles(), + topTitles: AxisTitles(), + rightTitles: AxisTitles(), + ), + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + getTooltipColor: (touchedSpot) => + theme.getColorFor(ThemeCode.buttonSecondary), + getTooltipItems: (List touchedBarSpots) { + return touchedBarSpots.map((barSpot) { + return LineTooltipItem( + "${barSpot.y} €", + TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ); + }).toList(); + }, + ), + ), + borderData: FlBorderData( + show: true, + border: Border( + bottom: BorderSide( + color: Colors.lightBlue.withValues(alpha: 0.2), + width: 4, + ), + left: const BorderSide(color: Colors.transparent), + right: const BorderSide(color: Colors.transparent), + top: const BorderSide(color: Colors.transparent), + ), + ), + lineBarsData: [ + LineChartBarData( + isCurved: true, + color: Colors.pink, + barWidth: 5, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: const [ + FlSpot(0, 1), + FlSpot(1, 0), + FlSpot(2, 1), + FlSpot(3, 0), + FlSpot(4, 1), + FlSpot(5, 0), + FlSpot(6, 1), + ], + ), + LineChartBarData( + isCurved: true, + color: Colors.cyan, + barWidth: 5, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: const [ + FlSpot(0, 0), + FlSpot(1, 1), + FlSpot(2, 0), + FlSpot(3, 1), + FlSpot(4, 0), + FlSpot(5, 1), + FlSpot(6, 0), + ], + ), + ], + minX: 0, + maxX: days.length - 1, + maxY: 1, + minY: 0, + ), + ), + ), + ], + ), + ); + } +} diff --git a/packages/sf_shared/lib/src/no_plan_error_screen.dart b/packages/sf_shared/lib/src/no_plan_error_screen.dart new file mode 100644 index 00000000..a4a43f2a --- /dev/null +++ b/packages/sf_shared/lib/src/no_plan_error_screen.dart @@ -0,0 +1,70 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class NoPlanErrorScreen extends ConsumerWidget { + const NoPlanErrorScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + return Scaffold( + body: Container( + margin: EdgeInsets.all(30), + child: Center( + child: Column( + children: [ + Spacer(flex: 3), + Text( + "Estamos mejorando el servicio", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25), + ), + Text( + "Asocia tu reloj a SaveFamily y ayuda a tus peques a aprender a usar el dinero con responsabilidad", + ), + Container( + margin: EdgeInsets.symmetric(vertical: 20), + child: Column( + children: [ + Row( + children: [ + Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ), + Text("Desarrollarán hábitos financieros sanos"), + ], + ), + Row( + children: [ + Icon( + Icons.check, + color: theme.getColorFor(ThemeCode.buttonPrimary), + ), + Text("Gestiona sus gastos"), + ], + ), + ], + ), + ), + Text( + "Selecciona tu plan en nuestra web y empieza a enseñar a los peques a entender el valor del dinero", + ), + Spacer(flex: 1), + FilledButton( + onPressed: () => {}, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(20), + child: Text("Seleccionar plan"), + ), + ), + Spacer(flex: 3), + ], + ), + ), + ), + ); + } +} diff --git a/lib/payments/view/screens/errors/server_error_screen.dart b/packages/sf_shared/lib/src/server_error_screen.dart similarity index 100% rename from lib/payments/view/screens/errors/server_error_screen.dart rename to packages/sf_shared/lib/src/server_error_screen.dart diff --git a/packages/sf_shared/lib/src/wallet_management_layout.dart b/packages/sf_shared/lib/src/wallet_management_layout.dart new file mode 100644 index 00000000..a2d0deab --- /dev/null +++ b/packages/sf_shared/lib/src/wallet_management_layout.dart @@ -0,0 +1,117 @@ +import 'package:design_system/design_system.dart'; +import 'package:flutter/material.dart'; +import 'package:sf_shared/sf_shared.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +class WalletManagementLayout extends ConsumerWidget { + final List children; + final Widget footer; + final Kid kid; + + const WalletManagementLayout({ + super.key, + required this.kid, + required this.children, + required this.footer, + }); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final theme = ref.watch(themePortProvider); + + final content = [ + Container( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20), + child: Stack( + children: [ + IconButton( + onPressed: () => Navigator.pop(context), + icon: Icon( + Icons.arrow_back_ios_outlined, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + Expanded( + child: Center( + child: Column( + children: [ + Text( + kid.name, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 30, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + Text.rich( + TextSpan( + text: "Saldo disponible: ", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + children: [ + TextSpan( + text: "${kid.balance}", + style: TextStyle( + fontWeight: FontWeight.bold, + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + TextSpan( + text: "€", + style: TextStyle( + color: theme.getColorFor(ThemeCode.textSecondary), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ...children, + ]; + + return Scaffold( + backgroundColor: theme.getColorFor(ThemeCode.backgroundSecondary), + body: Stack( + children: [ + DecoratedBox( + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(30)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: theme.getCardColorFor(0), + ), + ), + child: SizedBox(width: double.infinity, height: 200), + ), + Column( + children: [ + Expanded( + child: ListView.separated( + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: content[index], + ); + }, + separatorBuilder: (BuildContext context, int index) { + return Divider(height: 30, color: Colors.transparent); + }, + itemCount: content.length, + ), + ), + footer, + ], + ), + ], + ), + ); + } +} diff --git a/packages/sf_shared/pubspec.yaml b/packages/sf_shared/pubspec.yaml new file mode 100644 index 00000000..d1925106 --- /dev/null +++ b/packages/sf_shared/pubspec.yaml @@ -0,0 +1,63 @@ +name: sf_shared +description: "A new Flutter package project." +publish_to: 'none' # Remove this line if you wish to publish to pub.dev +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + #packages dependencies go here + design_system: + path: ../design_system + + #dependencies go here + fl_chart: ^1.1.1 + flutter_svg: ^2.2.1 + flutter_riverpod: ^3.0.3 +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/packages/sf_shared/pubspec_overrides.yaml b/packages/sf_shared/pubspec_overrides.yaml new file mode 100644 index 00000000..600b5d8d --- /dev/null +++ b/packages/sf_shared/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: design_system +dependency_overrides: + design_system: + path: ../design_system diff --git a/packages/utils/.gitignore b/packages/utils/.gitignore new file mode 100644 index 00000000..dd5eb989 --- /dev/null +++ b/packages/utils/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins-dependencies +/build/ +/coverage/ diff --git a/packages/utils/.metadata b/packages/utils/.metadata new file mode 100644 index 00000000..d7469f07 --- /dev/null +++ b/packages/utils/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2" + channel: "stable" + +project_type: package diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md new file mode 100644 index 00000000..41cc7d81 --- /dev/null +++ b/packages/utils/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/utils/LICENSE b/packages/utils/LICENSE new file mode 100644 index 00000000..ba75c69f --- /dev/null +++ b/packages/utils/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/utils/README.md b/packages/utils/README.md new file mode 100644 index 00000000..4a260d8d --- /dev/null +++ b/packages/utils/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/utils/analysis_options.yaml b/packages/utils/analysis_options.yaml new file mode 100644 index 00000000..a5744c1c --- /dev/null +++ b/packages/utils/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/utils/lib/src/size_utils.dart b/packages/utils/lib/src/size_utils.dart new file mode 100755 index 00000000..a337b23d --- /dev/null +++ b/packages/utils/lib/src/size_utils.dart @@ -0,0 +1,91 @@ +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; +} + +/// Utils for dynamic sizes +class SizeUtils { + static double height = 0.0; + static double width = 0.0; + static double physicalHeight = 0.0; + static double physicalWidth = 0.0; + + // Real value of aspect ratio height obtained through the display itself and not from calculating using the height and width + static double aspectRatioWidth = 9; + static double devicePixelRatio = 0.0; + static double physicalAspectRatioHeight = 0; + static double visibleAspectRatioHeight = 0; + + // 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; + + const SizeUtils(); + + /// init method which instantiates the class using MediaQuery. If a size is provided, it will use that size instead of the MediaQuery + static void init({required BuildContext context, Size? size}) { + if (size != null) { + padding = EdgeInsets.zero; + devicePixelRatio = MediaQuery.of(context).devicePixelRatio; + height = size.height; + width = size.width; + visibleAspectRatioHeight = (height / width) * aspectRatioWidth; + physicalWidth = width; + physicalHeight = height; + physicalAspectRatioHeight = + (physicalHeight / physicalWidth) * aspectRatioWidth; + } else { + height = MediaQuery.sizeOf(context).height; + width = MediaQuery.sizeOf(context).width; + padding = MediaQuery.of(context).padding; + devicePixelRatio = MediaQuery.of(context).devicePixelRatio; + visibleAspectRatioHeight = (height / width) * aspectRatioWidth; + + final FlutterView view = + WidgetsBinding.instance.platformDispatcher.views.first; + final Size realSize = view.display.size; + + // Dimensions in physical pixels (px) + physicalWidth = realSize.width / devicePixelRatio; + physicalHeight = realSize.height / devicePixelRatio; + physicalAspectRatioHeight = + (physicalHeight / physicalWidth) * aspectRatioWidth; + } + } + + /// Calculate percentatge of screen height, for example: '5' would be a '5%' of the total screen size + static double heightByPercent(double percent) => height * (percent / 100); + + static double physicalHeightByPercent(double percent) => + physicalHeight * (percent / 100); + + static double widthByPercent(double percent) => width * (percent / 100); + + static bool get isSmallerScreen => visibleAspectRatioHeight <= 16; + + static bool get isMediumScreen => physicalAspectRatioHeight <= 18.0; + + static bool get isXLScreen => physicalAspectRatioHeight >= 20.0; + + static Size get screenSize => Size(width, height); + + static T getByScreen({ + required T small, + T? medium, + required T big, + T? xl, + }) { + if (isSmallerScreen) return small; + if (isMediumScreen) return medium ?? small; + if (isXLScreen && xl != null) return xl; + return big; + } + + static double getDefaultTopBarHeight() { + return getByScreen(small: 40.0, big: 55.0); + } +} diff --git a/packages/utils/lib/utils.dart b/packages/utils/lib/utils.dart new file mode 100644 index 00000000..f3c74936 --- /dev/null +++ b/packages/utils/lib/utils.dart @@ -0,0 +1 @@ +export 'src/size_utils.dart'; diff --git a/packages/utils/pubspec.yaml b/packages/utils/pubspec.yaml new file mode 100644 index 00000000..5d7855ad --- /dev/null +++ b/packages/utils/pubspec.yaml @@ -0,0 +1,54 @@ +name: utils +description: "A new Flutter package project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.9.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/to/font-from-package diff --git a/pubspec.lock b/pubspec.lock index 4350a545..e6bd178d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,22 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: + ansi_styles: dependency: transitive description: - name: _fe_analyzer_shared - sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + name: ansi_styles + sha256: "9c656cc12b3c27b17dd982b2cc5c0cfdfbdabd7bc8f3ae5e8542d9867b47ce8a" url: "https://pub.dev" source: hosted - version: "85.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" - url: "https://pub.dev" - source: hosted - version: "7.7.1" + version: "0.3.2+1" args: dependency: transitive description: @@ -33,14 +25,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.13.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.dev" - source: hosted - version: "2.1.2" characters: dependency: transitive description: @@ -49,22 +33,38 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" - cli_config: + charcode: dependency: transitive description: - name: cli_config - sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + name: charcode + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a url: "https://pub.dev" source: hosted - version: "0.2.0" - clock: + version: "1.4.0" + checked_yaml: dependency: transitive description: - name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "2.0.4" + cli_launcher: + dependency: transitive + description: + name: cli_launcher + sha256: "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac" + url: "https://pub.dev" + source: hosted + version: "0.3.2+1" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" collection: dependency: transitive description: @@ -73,54 +73,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" - convert: + conventional_commit: dependency: transitive description: - name: convert - sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + name: conventional_commit + sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3 url: "https://pub.dev" source: hosted - version: "3.1.2" - coverage: + version: "0.6.1+1" + ffi: dependency: transitive description: - name: coverage - sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" url: "https://pub.dev" source: hosted - version: "1.15.0" - crypto: - dependency: transitive - description: - name: crypto - sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf - url: "https://pub.dev" - source: hosted - version: "3.0.7" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://pub.dev" - source: hosted - version: "1.0.8" - equatable: - dependency: transitive - description: - name: equatable - sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" - url: "https://pub.dev" - source: hosted - version: "2.0.7" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" - url: "https://pub.dev" - source: hosted - version: "1.3.3" + version: "2.1.4" file: dependency: transitive description: @@ -129,56 +97,64 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - sha256: "7ca9a40f4eb85949190e54087be8b4d6ac09dc4c54238d782a34cf1f7c011de9" - url: "https://pub.dev" - source: hosted - version: "1.1.1" flutter: - dependency: "direct main" + dependency: transitive description: flutter source: sdk version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" - url: "https://pub.dev" - source: hosted - version: "5.0.0" - flutter_riverpod: + flutter_secure_storage: dependency: "direct main" description: - name: flutter_riverpod - sha256: "9e2d6907f12cc7d23a846847615941bddee8709bf2bfd274acdf5e80bcf22fde" + name: flutter_secure_storage + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" url: "https://pub.dev" source: hosted - version: "3.0.3" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: b9c2ad5872518a27507ab432d1fb97e8813b05f0fc693f9d40fad06d073e0678 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - frontend_server_client: + version: "9.2.4" + flutter_secure_storage_linux: dependency: transitive description: - name: frontend_server_client - sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + name: flutter_secure_storage_linux + sha256: be76c1d24a97d0b98f8b54bce6b481a380a6590df992d0098f868ad54dc8f688 url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "1.2.3" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" glob: dependency: transitive description: @@ -187,6 +163,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" http: dependency: transitive description: @@ -195,14 +179,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 - url: "https://pub.dev" - source: hosted - version: "3.2.2" http_parser: dependency: transitive description: @@ -223,58 +199,18 @@ packages: dependency: transitive description: name: js - sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.7.2" - leak_tracker: + version: "0.6.7" + json_annotation: dependency: transitive description: - name: leak_tracker - sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "11.0.2" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" - url: "https://pub.dev" - source: hosted - version: "3.0.10" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - lints: - dependency: transitive - description: - name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 - url: "https://pub.dev" - source: hosted - version: "5.1.1" - logging: - dependency: transitive - description: - name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://pub.dev" - source: hosted - version: "0.12.17" + version: "4.9.0" material_color_utilities: dependency: transitive description: @@ -283,6 +219,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.11.1" + melos: + dependency: "direct dev" + description: + name: melos + sha256: "4280dc46bd5b741887cce1e67e5c1a6aaf3c22310035cf5bd33dceeeda62ed22" + url: "https://pub.dev" + source: hosted + version: "6.3.3" meta: dependency: transitive description: @@ -291,38 +235,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" - mime: + mustache_template: dependency: transitive description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + name: mustache_template + sha256: daa42be75f2ccfb287c24a75e7ac594f2ea0b32bf9ebe7c15154aa45b2dfb2de url: "https://pub.dev" source: hosted version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc - url: "https://pub.dev" - source: hosted - version: "2.2.0" path: dependency: transitive description: @@ -331,22 +251,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" - path_parsing: + path_provider: dependency: transitive description: - name: path_parsing - sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "1.1.0" - petitparser: + version: "2.1.5" + path_provider_android: dependency: transitive description: - name: petitparser - sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + name: path_provider_android + sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16 url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "2.2.20" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" pool: dependency: transitive description: @@ -355,14 +323,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.2" - provider: - dependency: "direct main" + process: + dependency: transitive description: - name: provider - sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" + name: process + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 url: "https://pub.dev" source: hosted - version: "6.1.5+1" + version: "5.0.5" + prompts: + dependency: transitive + description: + name: prompts + sha256: "3773b845e85a849f01e793c4fc18a45d52d7783b4cb6c0569fad19f9d0a774a1" + url: "https://pub.dev" + source: hosted + version: "2.0.0" pub_semver: dependency: transitive description: @@ -371,67 +347,27 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" - riverpod: + pub_updater: dependency: transitive description: - name: riverpod - sha256: c406de02bff19d920b832bddfb8283548bfa05ce41c59afba57ce643e116aa59 + name: pub_updater + sha256: "739a0161d73a6974c0675b864fb0cf5147305f7b077b7f03a58fa7a9ab3e7e7d" url: "https://pub.dev" source: hosted - version: "3.0.3" - shelf: + version: "0.5.0" + pubspec_parse: dependency: transitive description: - name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "1.4.2" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 - url: "https://pub.dev" - source: hosted - version: "1.1.3" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" - url: "https://pub.dev" - source: hosted - version: "3.0.0" + version: "1.5.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b - url: "https://pub.dev" - source: hosted - version: "2.1.2" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" - url: "https://pub.dev" - source: hosted - version: "0.10.13" source_span: dependency: transitive description: @@ -448,22 +384,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.12.1" - state_notifier: - dependency: transitive - description: - name: state_notifier - sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb - url: "https://pub.dev" - source: hosted - version: "1.0.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.dev" - source: hosted - version: "2.1.4" string_scanner: dependency: transitive description: @@ -480,30 +400,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.2" - test: - dependency: transitive - description: - name: test - sha256: "65e29d831719be0591f7b3b1a32a3cda258ec98c58c7b25f7b84241bc31215bb" - url: "https://pub.dev" - source: hosted - version: "1.26.2" - test_api: - dependency: transitive - description: - name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" - url: "https://pub.dev" - source: hosted - version: "0.7.6" - test_core: - dependency: transitive - description: - name: test_core - sha256: "80bf5a02b60af04b09e14f6fe68b921aad119493e26e490deaca5993fef1b05a" - url: "https://pub.dev" - source: hosted - version: "0.6.11" typed_data: dependency: transitive description: @@ -512,30 +408,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 - url: "https://pub.dev" - source: hosted - version: "1.1.19" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" - url: "https://pub.dev" - source: hosted - version: "1.1.13" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc - url: "https://pub.dev" - source: hosted - version: "1.1.19" vector_math: dependency: transitive description: @@ -544,22 +416,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.0" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" - url: "https://pub.dev" - source: hosted - version: "15.0.2" - watcher: - dependency: transitive - description: - name: watcher - sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" - url: "https://pub.dev" - source: hosted - version: "1.1.4" web: dependency: transitive description: @@ -568,38 +424,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - web_socket: + win32: dependency: transitive description: - name: web_socket - sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + name: win32 + sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e url: "https://pub.dev" source: hosted - version: "1.0.1" - web_socket_channel: + version: "5.15.0" + xdg_directories: dependency: transitive description: - name: web_socket_channel - sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" url: "https://pub.dev" source: hosted - version: "3.0.3" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - xml: - dependency: transitive - description: - name: xml - sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" - url: "https://pub.dev" - source: hosted - version: "6.6.1" + version: "1.1.0" yaml: dependency: transitive description: @@ -608,6 +448,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.3" + yaml_edit: + dependency: transitive + description: + name: yaml_edit + sha256: fb38626579fb345ad00e674e2af3a5c9b0cc4b9bfb8fd7f7ff322c7c9e62aef5 + url: "https://pub.dev" + source: hosted + version: "2.2.2" sdks: - dart: ">=3.9.2 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.9.0 <4.0.0" + flutter: ">=3.35.0" diff --git a/pubspec.yaml b/pubspec.yaml index 576b594f..cccb07d7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,92 +1,20 @@ -name: sf_app_platform -description: "A new Flutter project." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +name: sf_app_platform_mono_repo +description: Monorepo for sf app platform, packages and modules included. +publish_to: "none" environment: - sdk: ^3.9.2 - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - provider: ^6.1.5+1 - flutter_riverpod: ^3.0.3 - fl_chart: ^1.1.1 - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.8 - flutter_svg: ^2.2.1 + sdk: ">=3.0.0 <4.0.0" +# workspace: +# - packages/navigation +# - modules/auth +# - modules/home +# - modules/profile +# - modules/notifications +# - modules/dashboard_shell dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^5.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - assets: - - assets/images/ui/ - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package + melos: ^6.3.3 +dependencies: + flutter_secure_storage: ^9.2.4 +dependency_overrides: + flutter_secure_storage: 9.2.4 \ No newline at end of file