added hub module
This commit is contained in:
@@ -3,349 +3,349 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "ansi_styles",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/ansi_styles-0.3.2+1",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/file-7.0.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.0"
|
||||
},
|
||||
{
|
||||
"name": "flutter",
|
||||
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter",
|
||||
"rootUri": "file:///C:/Program%20Files/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Program%20Files/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Program%20Files/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/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",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/yaml_edit-2.2.2",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
@@ -358,7 +358,7 @@
|
||||
],
|
||||
"generator": "pub",
|
||||
"generatorVersion": "3.9.2",
|
||||
"flutterRoot": "file:///Users/juliandalcalaf/Development/flutter",
|
||||
"flutterVersion": "3.35.7",
|
||||
"pubCache": "file:///Users/juliandalcalaf/.pub-cache"
|
||||
"flutterRoot": "file:///C:/Program%20Files/Flutter",
|
||||
"flutterVersion": "3.35.6",
|
||||
"pubCache": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache"
|
||||
}
|
||||
|
||||
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@@ -7,6 +7,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/design_system/melos_design_system.iml" filepath="$PROJECT_DIR$/packages/design_system/melos_design_system.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/fonts/melos_fonts.iml" filepath="$PROJECT_DIR$/packages/fonts/melos_fonts.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/modules/home/melos_home.iml" filepath="$PROJECT_DIR$/modules/home/melos_home.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/modules/hub/melos_hub.iml" filepath="$PROJECT_DIR$/modules/hub/melos_hub.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/navigation/melos_navigation.iml" filepath="$PROJECT_DIR$/packages/navigation/melos_navigation.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/modules/notifications/melos_notifications.iml" filepath="$PROJECT_DIR$/modules/notifications/melos_notifications.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/modules/profile/melos_profile.iml" filepath="$PROJECT_DIR$/modules/profile/melos_profile.iml" />
|
||||
@@ -14,6 +15,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/sf_infrastructure/melos_sf_infrastructure.iml" filepath="$PROJECT_DIR$/packages/sf_infrastructure/melos_sf_infrastructure.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/sf_localizations/melos_sf_localizations.iml" filepath="$PROJECT_DIR$/packages/sf_localizations/melos_sf_localizations.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/sf_shared/melos_sf_shared.iml" filepath="$PROJECT_DIR$/packages/sf_shared/melos_sf_shared.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/modules/splash/melos_splash.iml" filepath="$PROJECT_DIR$/modules/splash/melos_splash.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/packages/utils/melos_utils.iml" filepath="$PROJECT_DIR$/packages/utils/melos_utils.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/melos_sf-app-platform.iml" filepath="$PROJECT_DIR$/melos_sf-app-platform.iml" />
|
||||
</modules>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Flutter Run -> 'sf_app_platform'" type="FlutterRunConfigurationType" factoryName="Flutter">
|
||||
<option name="filePath" value="$PROJECT_DIR$/apps/mobile_app/lib/main.dart" />
|
||||
<option name="filePath" value="$PROJECT_DIR$/apps//mobile_app/lib/main.dart" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- Generated by Melos -->
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Flutter Test -> 'design_system'" type="FlutterTestConfigType" factoryName="Flutter Test">
|
||||
<option name="testDir" value="$PROJECT_DIR$/packages/design_system/test" />
|
||||
<option name="testDir" value="$PROJECT_DIR$/packages\\design_system\test" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- Generated by Melos -->
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Flutter Test -> 'home'" type="FlutterTestConfigType" factoryName="Flutter Test">
|
||||
<option name="testDir" value="$PROJECT_DIR$/modules/home/test" />
|
||||
<option name="testDir" value="$PROJECT_DIR$/modules\\home\test" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
BIN
apps/mobile_app/assets/images/ui/iso_sf.png
Normal file
BIN
apps/mobile_app/assets/images/ui/iso_sf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
19
apps/mobile_app/assets/images/ui/location.svg
Normal file
19
apps/mobile_app/assets/images/ui/location.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<svg width="43" height="55" viewBox="0 0 43 55" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1_973)">
|
||||
<path d="M22.339 0C23.8812 0.269461 25.4552 0.434132 26.9498 0.838323C31.1949 1.96108 34.6769 4.20659 37.4434 7.41018C39.4944 9.79042 40.9094 12.5 41.5931 15.494C42.7856 20.7335 41.9906 25.7186 38.9379 30.2545C33.6752 38.0988 28.3012 45.8982 22.9749 53.7126C22.8954 53.8323 22.816 53.9521 22.7365 54.0718C21.8143 55.3293 20.2721 55.3293 19.3817 54.0569C18.38 52.6347 17.4261 51.1976 16.4562 49.7605C12.068 43.3084 7.64795 36.8713 3.29152 30.4042C0.429637 26.1527 -0.572024 21.512 0.334241 16.5569C1.81288 8.36826 8.20443 2.15569 16.8378 0.404192C17.8077 0.209581 18.8093 0.134731 19.7951 0C20.6377 0 21.4963 0 22.339 0Z" fill="#F9B03C"/>
|
||||
<path d="M28.8576 25.8982L31.5923 28.473C32.3396 29.1766 32.3396 30.3293 31.5923 31.0479C30.8451 31.7515 29.6208 31.7515 28.8576 31.0479L26.123 28.473C25.3757 27.7694 25.3757 26.6167 26.123 25.8982C26.8702 25.1796 28.0945 25.1796 28.8576 25.8982Z" fill="white"/>
|
||||
<path d="M12.926 20.7485C12.926 21.7515 12.0675 22.5599 11.0022 22.5599H7.13867C6.07341 22.5599 5.21484 21.7515 5.21484 20.7485C5.21484 19.7455 6.07341 18.9371 7.13867 18.9371H11.0022C12.0675 18.9371 12.926 19.7455 12.926 20.7485Z" fill="white"/>
|
||||
<path d="M12.4651 15.5987L9.73037 13.0388C8.9831 12.3352 8.9831 11.1825 9.73037 10.464C10.4776 9.76038 11.7019 9.76038 12.4651 10.464L15.1998 13.0388C15.947 13.7424 15.947 14.8951 15.1998 15.6137C14.4366 16.3173 13.2123 16.3173 12.4651 15.5987Z" fill="white"/>
|
||||
<path d="M12.4651 31.0329C11.7178 31.7365 10.4935 31.7365 9.73037 31.0329C8.9831 30.3293 8.9831 29.1766 9.73037 28.458L12.4651 25.8832C13.2123 25.1796 14.4366 25.1796 15.1998 25.8832C15.947 26.5868 15.947 27.7394 15.1998 28.458L12.4651 31.0329Z" fill="white"/>
|
||||
<path d="M20.6533 13.473C19.5881 13.473 18.7295 12.6646 18.7295 11.6616V8.0239C18.7295 7.02091 19.5881 6.21252 20.6533 6.21252C21.7186 6.21252 22.5771 7.02091 22.5771 8.0239V11.6616C22.593 12.6646 21.7186 13.473 20.6533 13.473Z" fill="white"/>
|
||||
<path d="M20.6533 35.2993C19.5881 35.2993 18.7295 34.4909 18.7295 33.4879V29.8502C18.7295 28.8472 19.5881 28.0388 20.6533 28.0388C21.7186 28.0388 22.5771 28.8472 22.5771 29.8502V33.4879C22.593 34.4909 21.7186 35.2993 20.6533 35.2993Z" fill="white"/>
|
||||
<path d="M28.8576 15.5988C28.1104 16.3024 26.8861 16.3024 26.123 15.5988C25.3757 14.8952 25.3757 13.7425 26.123 13.0239L28.8576 10.4491C29.6049 9.74549 30.8292 9.74549 31.5923 10.4491C32.3396 11.1527 32.3396 12.3054 31.5923 13.0239L28.8576 15.5988Z" fill="white"/>
|
||||
<path d="M34.1839 22.5748H30.3203C29.255 22.5748 28.3965 21.7664 28.3965 20.7634C28.3965 19.7604 29.255 18.952 30.3203 18.952H34.1839C35.2491 18.952 36.1077 19.7604 36.1077 20.7634C36.1077 21.7514 35.2491 22.5748 34.1839 22.5748Z" fill="white"/>
|
||||
<path d="M20.1288 15.7634C20.256 15.6587 20.3991 15.5539 20.574 15.5389C21.0033 15.509 21.21 16.003 21.2895 16.4072C21.4485 17.2155 21.5916 18.0389 21.7506 18.8473C21.7824 19.0269 21.8301 19.2215 21.9891 19.3263C22.1322 19.4161 22.3389 19.4012 22.5138 19.3712C23.5472 19.2664 24.6284 19.476 25.5187 19.985C25.8049 20.1497 26.0752 20.3593 26.1229 20.6736C26.1706 21.1227 25.6777 21.4371 25.2166 21.5868C24.4058 21.8563 23.5154 21.9161 22.6727 21.7664C22.9589 22.2904 23.1815 22.8593 23.3564 23.4281C23.5631 24.1467 23.5154 25.1197 22.784 25.3892C22.2276 25.5838 21.6234 25.2245 21.2577 24.7904C20.892 24.3563 20.6376 23.8323 20.1765 23.473C19.5406 24.1916 18.5389 24.5359 17.5849 24.7904C16.9013 24.97 16.0268 25.0299 15.6452 24.4611C15.4544 24.1616 15.8519 23.2335 16.3766 22.8443C16.9649 22.4102 17.2829 21.991 17.887 21.6916C16.5674 21.2275 15.8996 21.0479 15.0569 19.985C14.8185 19.6856 14.6595 19.2066 14.9933 19.0119C15.1046 18.9521 15.2318 18.9521 15.3431 18.9521C16.4879 18.9221 17.7439 19.3114 18.5071 18.488C19.2067 17.7096 19.2067 16.5419 20.1288 15.7634Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1_973">
|
||||
<rect width="42.1333" height="55" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -3,6 +3,7 @@ import 'package:dashboard_shell/dashboard_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hub/hub.dart';
|
||||
import 'package:home/home.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:notifications/notifications.dart';
|
||||
@@ -24,6 +25,11 @@ void configureAppRouter() {
|
||||
name: 'splash',
|
||||
pageBuilder: SplashBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.hub,
|
||||
name: 'hub',
|
||||
pageBuilder: HubBuilder().buildPage,
|
||||
),
|
||||
GoRoute(
|
||||
path: AppRoutes.login,
|
||||
name: 'login',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,8 @@ dependencies:
|
||||
path: ../../modules/auth
|
||||
home:
|
||||
path: ../../modules/home
|
||||
hub:
|
||||
path: ../../modules/hub
|
||||
profile:
|
||||
path: ../../modules/profile
|
||||
notifications:
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# melos_managed_dependency_overrides: auth,dashboard_shell,design_system,home,navigation,notifications,profile,sf_shared,utils,sf_localizations,fonts,sf_infrastructure
|
||||
dependency_overrides:
|
||||
auth:
|
||||
path: ../../modules/auth
|
||||
dashboard_shell:
|
||||
path: ../../modules/dashboard_shell
|
||||
design_system:
|
||||
path: ../../packages/design_system
|
||||
fonts:
|
||||
path: ../../packages/fonts
|
||||
home:
|
||||
path: ../../modules/home
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
notifications:
|
||||
path: ../../modules/notifications
|
||||
profile:
|
||||
path: ../../modules/profile
|
||||
sf_infrastructure:
|
||||
path: ../../packages/sf_infrastructure
|
||||
sf_localizations:
|
||||
path: ../../packages/sf_localizations
|
||||
sf_shared:
|
||||
path: ../../packages/sf_shared
|
||||
utils:
|
||||
path: ../../packages/utils
|
||||
@@ -4,9 +4,18 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/splash/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/splash/.pub" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/splash/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/hub/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/hub/.pub" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/modules/hub/build" />
|
||||
</content>
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
</module>
|
||||
@@ -32,7 +32,7 @@ class OnboardingScreen extends ConsumerWidget {
|
||||
|
||||
void goToNext() {
|
||||
if (isLast) {
|
||||
navigationContract.goTo(AppRoutes.linkPhone);
|
||||
navigationContract.goTo(AppRoutes.hub);
|
||||
} else {
|
||||
pageController.nextPage(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
@@ -111,7 +111,7 @@ class OnboardingScreen extends ConsumerWidget {
|
||||
? const SizedBox.shrink()
|
||||
: TextButton(
|
||||
onPressed: () =>
|
||||
navigationContract.goTo(AppRoutes.linkPhone),
|
||||
navigationContract.goTo(AppRoutes.hub),
|
||||
child: Text(
|
||||
context.translate(I18n.skip),
|
||||
style: AppFonts.stolzlStyle(
|
||||
|
||||
@@ -13,8 +13,8 @@ dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
#modules dependencies go here
|
||||
dashboard_shell:
|
||||
path: ../../modules/dashboard_shell
|
||||
home:
|
||||
path: ../../modules/home
|
||||
#packages dependencies go here
|
||||
design_system:
|
||||
path: ../../packages/design_system
|
||||
@@ -40,6 +40,8 @@ dependencies:
|
||||
json_annotation: ^4.9.0
|
||||
json_serializable: ^6.11.2
|
||||
uuid: ^4.5.2
|
||||
flutter_map: ^8.2.2
|
||||
latlong2: ^0.9.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# melos_managed_dependency_overrides: home
|
||||
# melos_managed_dependency_overrides: home
|
||||
# melos_managed_dependency_overrides: dashboard_shell,design_system,home,notifications,profile,sf_shared,navigation,utils,sf_localizations,fonts,sf_infrastructure
|
||||
dependency_overrides:
|
||||
dashboard_shell:
|
||||
@@ -7,7 +9,9 @@ dependency_overrides:
|
||||
fonts:
|
||||
path: ../../packages/fonts
|
||||
home:
|
||||
path: ../home
|
||||
path: ..\\home
|
||||
hub:
|
||||
path: ../hub
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
notifications:
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# melos_managed_dependency_overrides: auth,design_system,home,notifications,profile,sf_shared,navigation,utils,sf_localizations,fonts,sf_infrastructure
|
||||
dependency_overrides:
|
||||
auth:
|
||||
path: ../auth
|
||||
design_system:
|
||||
path: ../../packages/design_system
|
||||
fonts:
|
||||
path: ../../packages/fonts
|
||||
home:
|
||||
path: ../home
|
||||
navigation:
|
||||
path: ../../packages/navigation
|
||||
notifications:
|
||||
path: ../notifications
|
||||
profile:
|
||||
path: ../profile
|
||||
sf_infrastructure:
|
||||
path: ../../packages/sf_infrastructure
|
||||
sf_localizations:
|
||||
path: ../../packages/sf_localizations
|
||||
sf_shared:
|
||||
path: ../../packages/sf_shared
|
||||
utils:
|
||||
path: ../../packages/utils
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
|
||||
abstract class HomeRemoteDatasource {
|
||||
Future<List<DeviceEntity>> getDevices({required String userId});
|
||||
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId});
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart';
|
||||
import 'package:hub/src/core/data/models/get_devices_response_model.dart';
|
||||
import 'package:hub/src/core/data/models/latest_positions_response_model.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
|
||||
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
||||
|
||||
class HomeRemoteDatasourceImpl implements HomeRemoteDatasource {
|
||||
HomeRemoteDatasourceImpl(this._repository);
|
||||
|
||||
final QuestiaRepository _repository;
|
||||
|
||||
@override
|
||||
Future<List<DeviceEntity>> getDevices({required String userId}) async {
|
||||
try {
|
||||
final response = await _repository.get<Map<String, dynamic>>(
|
||||
'/$userId/devices',
|
||||
);
|
||||
final data = response.data!['items'];
|
||||
if (data == null || data.isEmpty) {
|
||||
throw Exception('Empty response from /:userId/devices');
|
||||
}
|
||||
|
||||
final model = GetDevicesResponseModel.fromJson(data);
|
||||
/*final model = GetDevicesResponseModel(items: [
|
||||
GetDevicesItemResponseModel(
|
||||
id: '1',
|
||||
identificator: '1111',
|
||||
carrierName: 'Carlos'),
|
||||
GetDevicesItemResponseModel(
|
||||
id: '2',
|
||||
identificator: '1112',
|
||||
carrierName: 'Ana'),
|
||||
]);*/
|
||||
return model.toEntity();
|
||||
} on DioException catch (error) {
|
||||
throw _mapDioError(
|
||||
error,
|
||||
defaultMessage: error.message ?? 'Error getting devices',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId}) async {
|
||||
try {
|
||||
final response = await _repository.get<Map<String, dynamic>>(
|
||||
'/positions/api/identificator/$deviceId/positions',
|
||||
);
|
||||
final data = response.data?['items'] ?? [];
|
||||
if (data == null || data.isEmpty) {
|
||||
throw Exception('Empty response from /identificator/:deviceId/positions');
|
||||
}
|
||||
|
||||
final model = LatestPositionsResponseModel.fromJson(data);
|
||||
/*final model = LatestPositionsResponseModel(items: [
|
||||
LatestPositionsItemResponseModel(
|
||||
latitude: 43.327116830678186,
|
||||
longitude: -3.083269100434551,
|
||||
address: 'Aparcamiento',
|
||||
positionDate: DateTime.now(),
|
||||
frequentPlace: false,
|
||||
frequentPlaceName: ''),
|
||||
LatestPositionsItemResponseModel(
|
||||
latitude: 43.32729043118528,
|
||||
longitude: -3.08320596406992,
|
||||
address: 'Izekoren etxea',
|
||||
positionDate: DateTime.now(),
|
||||
frequentPlace: true,
|
||||
frequentPlaceName: 'La cafetería'),
|
||||
]);*/
|
||||
return model.toEntity();
|
||||
} on DioException catch (error) {
|
||||
throw _mapDioError(
|
||||
error,
|
||||
defaultMessage: error.message ?? 'Error getting latest position',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Exception _mapDioError(DioException error, {required String defaultMessage}) {
|
||||
final apiMsg = _extractApiMessage(error.response?.data);
|
||||
final msg = apiMsg ?? error.message ?? defaultMessage;
|
||||
return Exception(msg);
|
||||
}
|
||||
|
||||
String? _extractApiMessage(Object? data) {
|
||||
if (data == null) return null;
|
||||
|
||||
if (data is Map) {
|
||||
final errorObj = data['error'];
|
||||
if (errorObj is Map && errorObj['message'] is String) {
|
||||
return (errorObj['message'] as String).trim();
|
||||
}
|
||||
if (data['message'] is String) {
|
||||
return (data['message'] as String).trim();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (data is String) {
|
||||
final raw = data.trim();
|
||||
if (raw.isEmpty) return null;
|
||||
|
||||
try {
|
||||
final decoded = jsonDecode(raw);
|
||||
return _extractApiMessage(decoded);
|
||||
} catch (_) {
|
||||
return raw;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
|
||||
part 'get_devices_response_model.freezed.dart';
|
||||
part 'get_devices_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GetDevicesResponseModel with _$GetDevicesResponseModel {
|
||||
const factory GetDevicesResponseModel({
|
||||
required List<GetDevicesItemResponseModel> items,
|
||||
}) = _GetDevicesResponseModel;
|
||||
|
||||
factory GetDevicesResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetDevicesResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GetDevicesItemResponseModel
|
||||
with _$GetDevicesItemResponseModel {
|
||||
const factory GetDevicesItemResponseModel({
|
||||
required String id,
|
||||
required String identificator,
|
||||
required String carrierName,
|
||||
}) = _GetDevicesItemResponseModel;
|
||||
|
||||
factory GetDevicesItemResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetDevicesItemResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
extension GetDevicesResponseModelMapper on GetDevicesResponseModel {
|
||||
List<DeviceEntity> toEntity() {
|
||||
return items.map((GetDevicesItemResponseModel item) => DeviceEntity(
|
||||
id: item.id,
|
||||
identificator: item.identificator,
|
||||
carrierName: item.carrierName,
|
||||
)).toList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,552 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'get_devices_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GetDevicesResponseModel {
|
||||
|
||||
List<GetDevicesItemResponseModel> get items;
|
||||
/// Create a copy of GetDevicesResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GetDevicesResponseModelCopyWith<GetDevicesResponseModel> get copyWith => _$GetDevicesResponseModelCopyWithImpl<GetDevicesResponseModel>(this as GetDevicesResponseModel, _$identity);
|
||||
|
||||
/// Serializes this GetDevicesResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesResponseModel&&const DeepCollectionEquality().equals(other.items, items));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(items));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesResponseModel(items: $items)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GetDevicesResponseModelCopyWith<$Res> {
|
||||
factory $GetDevicesResponseModelCopyWith(GetDevicesResponseModel value, $Res Function(GetDevicesResponseModel) _then) = _$GetDevicesResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<GetDevicesItemResponseModel> items
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GetDevicesResponseModelCopyWithImpl<$Res>
|
||||
implements $GetDevicesResponseModelCopyWith<$Res> {
|
||||
_$GetDevicesResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GetDevicesResponseModel _self;
|
||||
final $Res Function(GetDevicesResponseModel) _then;
|
||||
|
||||
/// Create a copy of GetDevicesResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? items = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
items: null == items ? _self.items : items // ignore: cast_nullable_to_non_nullable
|
||||
as List<GetDevicesItemResponseModel>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GetDevicesResponseModel].
|
||||
extension GetDevicesResponseModelPatterns on GetDevicesResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GetDevicesResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GetDevicesResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GetDevicesResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<GetDevicesItemResponseModel> items)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel() when $default != null:
|
||||
return $default(_that.items);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<GetDevicesItemResponseModel> items) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel():
|
||||
return $default(_that.items);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<GetDevicesItemResponseModel> items)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesResponseModel() when $default != null:
|
||||
return $default(_that.items);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _GetDevicesResponseModel implements GetDevicesResponseModel {
|
||||
const _GetDevicesResponseModel({required final List<GetDevicesItemResponseModel> items}): _items = items;
|
||||
factory _GetDevicesResponseModel.fromJson(Map<String, dynamic> json) => _$GetDevicesResponseModelFromJson(json);
|
||||
|
||||
final List<GetDevicesItemResponseModel> _items;
|
||||
@override List<GetDevicesItemResponseModel> get items {
|
||||
if (_items is EqualUnmodifiableListView) return _items;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of GetDevicesResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GetDevicesResponseModelCopyWith<_GetDevicesResponseModel> get copyWith => __$GetDevicesResponseModelCopyWithImpl<_GetDevicesResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GetDevicesResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesResponseModel&&const DeepCollectionEquality().equals(other._items, _items));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_items));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesResponseModel(items: $items)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GetDevicesResponseModelCopyWith<$Res> implements $GetDevicesResponseModelCopyWith<$Res> {
|
||||
factory _$GetDevicesResponseModelCopyWith(_GetDevicesResponseModel value, $Res Function(_GetDevicesResponseModel) _then) = __$GetDevicesResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<GetDevicesItemResponseModel> items
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GetDevicesResponseModelCopyWithImpl<$Res>
|
||||
implements _$GetDevicesResponseModelCopyWith<$Res> {
|
||||
__$GetDevicesResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GetDevicesResponseModel _self;
|
||||
final $Res Function(_GetDevicesResponseModel) _then;
|
||||
|
||||
/// Create a copy of GetDevicesResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? items = null,}) {
|
||||
return _then(_GetDevicesResponseModel(
|
||||
items: null == items ? _self._items : items // ignore: cast_nullable_to_non_nullable
|
||||
as List<GetDevicesItemResponseModel>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GetDevicesItemResponseModel {
|
||||
|
||||
String get id; String get identificator; String get carrierName;
|
||||
/// Create a copy of GetDevicesItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GetDevicesItemResponseModelCopyWith<GetDevicesItemResponseModel> get copyWith => _$GetDevicesItemResponseModelCopyWithImpl<GetDevicesItemResponseModel>(this as GetDevicesItemResponseModel, _$identity);
|
||||
|
||||
/// Serializes this GetDevicesItemResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,identificator,carrierName);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesItemResponseModel(id: $id, identificator: $identificator, carrierName: $carrierName)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GetDevicesItemResponseModelCopyWith<$Res> {
|
||||
factory $GetDevicesItemResponseModelCopyWith(GetDevicesItemResponseModel value, $Res Function(GetDevicesItemResponseModel) _then) = _$GetDevicesItemResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String id, String identificator, String carrierName
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GetDevicesItemResponseModelCopyWithImpl<$Res>
|
||||
implements $GetDevicesItemResponseModelCopyWith<$Res> {
|
||||
_$GetDevicesItemResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GetDevicesItemResponseModel _self;
|
||||
final $Res Function(GetDevicesItemResponseModel) _then;
|
||||
|
||||
/// Create a copy of GetDevicesItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? identificator = null,Object? carrierName = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable
|
||||
as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GetDevicesItemResponseModel].
|
||||
extension GetDevicesItemResponseModelPatterns on GetDevicesItemResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GetDevicesItemResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GetDevicesItemResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GetDevicesItemResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, String carrierName)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.carrierName);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, String carrierName) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel():
|
||||
return $default(_that.id,_that.identificator,_that.carrierName);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, String carrierName)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.carrierName);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _GetDevicesItemResponseModel implements GetDevicesItemResponseModel {
|
||||
const _GetDevicesItemResponseModel({required this.id, required this.identificator, required this.carrierName});
|
||||
factory _GetDevicesItemResponseModel.fromJson(Map<String, dynamic> json) => _$GetDevicesItemResponseModelFromJson(json);
|
||||
|
||||
@override final String id;
|
||||
@override final String identificator;
|
||||
@override final String carrierName;
|
||||
|
||||
/// Create a copy of GetDevicesItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GetDevicesItemResponseModelCopyWith<_GetDevicesItemResponseModel> get copyWith => __$GetDevicesItemResponseModelCopyWithImpl<_GetDevicesItemResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GetDevicesItemResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,identificator,carrierName);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesItemResponseModel(id: $id, identificator: $identificator, carrierName: $carrierName)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GetDevicesItemResponseModelCopyWith<$Res> implements $GetDevicesItemResponseModelCopyWith<$Res> {
|
||||
factory _$GetDevicesItemResponseModelCopyWith(_GetDevicesItemResponseModel value, $Res Function(_GetDevicesItemResponseModel) _then) = __$GetDevicesItemResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id, String identificator, String carrierName
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GetDevicesItemResponseModelCopyWithImpl<$Res>
|
||||
implements _$GetDevicesItemResponseModelCopyWith<$Res> {
|
||||
__$GetDevicesItemResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GetDevicesItemResponseModel _self;
|
||||
final $Res Function(_GetDevicesItemResponseModel) _then;
|
||||
|
||||
/// Create a copy of GetDevicesItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? identificator = null,Object? carrierName = null,}) {
|
||||
return _then(_GetDevicesItemResponseModel(
|
||||
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable
|
||||
as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,37 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'get_devices_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GetDevicesResponseModel _$GetDevicesResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GetDevicesResponseModel(
|
||||
items: (json['items'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => GetDevicesItemResponseModel.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetDevicesResponseModelToJson(
|
||||
_GetDevicesResponseModel instance,
|
||||
) => <String, dynamic>{'items': instance.items};
|
||||
|
||||
_GetDevicesItemResponseModel _$GetDevicesItemResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GetDevicesItemResponseModel(
|
||||
id: json['id'] as String,
|
||||
identificator: json['identificator'] as String,
|
||||
carrierName: json['carrierName'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetDevicesItemResponseModelToJson(
|
||||
_GetDevicesItemResponseModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'identificator': instance.identificator,
|
||||
'carrierName': instance.carrierName,
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
|
||||
part 'latest_positions_response_model.freezed.dart';
|
||||
part 'latest_positions_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LatestPositionsResponseModel with _$LatestPositionsResponseModel {
|
||||
const factory LatestPositionsResponseModel({
|
||||
required List<LatestPositionsItemResponseModel> items,
|
||||
}) = _LatestPositionsResponseModel;
|
||||
|
||||
factory LatestPositionsResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$LatestPositionsResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class LatestPositionsItemResponseModel
|
||||
with _$LatestPositionsItemResponseModel {
|
||||
const factory LatestPositionsItemResponseModel({
|
||||
required double latitude,
|
||||
required double longitude,
|
||||
required String? address,
|
||||
required DateTime positionDate,
|
||||
required bool frequentPlace,
|
||||
required String frequentPlaceName,
|
||||
}) = _LatestPositionsItemResponseModel;
|
||||
|
||||
factory LatestPositionsItemResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$LatestPositionsItemResponseModelFromJson(json);
|
||||
}
|
||||
|
||||
extension LatestPositionsResponseModelMapper on LatestPositionsResponseModel {
|
||||
List<PositionEntity> toEntity() {
|
||||
return items.map((LatestPositionsItemResponseModel item) => PositionEntity(
|
||||
latitude: item.latitude,
|
||||
longitude: item.longitude,
|
||||
address: item.address,
|
||||
positionDate: item.positionDate,
|
||||
frequentPlace: item.frequentPlace,
|
||||
frequentPlaceName: item.frequentPlaceName,
|
||||
)).toList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,561 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'latest_positions_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LatestPositionsResponseModel {
|
||||
|
||||
List<LatestPositionsItemResponseModel> get items;
|
||||
/// Create a copy of LatestPositionsResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LatestPositionsResponseModelCopyWith<LatestPositionsResponseModel> get copyWith => _$LatestPositionsResponseModelCopyWithImpl<LatestPositionsResponseModel>(this as LatestPositionsResponseModel, _$identity);
|
||||
|
||||
/// Serializes this LatestPositionsResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsResponseModel&&const DeepCollectionEquality().equals(other.items, items));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(items));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LatestPositionsResponseModel(items: $items)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LatestPositionsResponseModelCopyWith<$Res> {
|
||||
factory $LatestPositionsResponseModelCopyWith(LatestPositionsResponseModel value, $Res Function(LatestPositionsResponseModel) _then) = _$LatestPositionsResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<LatestPositionsItemResponseModel> items
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LatestPositionsResponseModelCopyWithImpl<$Res>
|
||||
implements $LatestPositionsResponseModelCopyWith<$Res> {
|
||||
_$LatestPositionsResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LatestPositionsResponseModel _self;
|
||||
final $Res Function(LatestPositionsResponseModel) _then;
|
||||
|
||||
/// Create a copy of LatestPositionsResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? items = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
items: null == items ? _self.items : items // ignore: cast_nullable_to_non_nullable
|
||||
as List<LatestPositionsItemResponseModel>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LatestPositionsResponseModel].
|
||||
extension LatestPositionsResponseModelPatterns on LatestPositionsResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LatestPositionsResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LatestPositionsResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LatestPositionsResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<LatestPositionsItemResponseModel> items)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel() when $default != null:
|
||||
return $default(_that.items);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<LatestPositionsItemResponseModel> items) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel():
|
||||
return $default(_that.items);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<LatestPositionsItemResponseModel> items)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsResponseModel() when $default != null:
|
||||
return $default(_that.items);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _LatestPositionsResponseModel implements LatestPositionsResponseModel {
|
||||
const _LatestPositionsResponseModel({required final List<LatestPositionsItemResponseModel> items}): _items = items;
|
||||
factory _LatestPositionsResponseModel.fromJson(Map<String, dynamic> json) => _$LatestPositionsResponseModelFromJson(json);
|
||||
|
||||
final List<LatestPositionsItemResponseModel> _items;
|
||||
@override List<LatestPositionsItemResponseModel> get items {
|
||||
if (_items is EqualUnmodifiableListView) return _items;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_items);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of LatestPositionsResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LatestPositionsResponseModelCopyWith<_LatestPositionsResponseModel> get copyWith => __$LatestPositionsResponseModelCopyWithImpl<_LatestPositionsResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$LatestPositionsResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsResponseModel&&const DeepCollectionEquality().equals(other._items, _items));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_items));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LatestPositionsResponseModel(items: $items)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LatestPositionsResponseModelCopyWith<$Res> implements $LatestPositionsResponseModelCopyWith<$Res> {
|
||||
factory _$LatestPositionsResponseModelCopyWith(_LatestPositionsResponseModel value, $Res Function(_LatestPositionsResponseModel) _then) = __$LatestPositionsResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<LatestPositionsItemResponseModel> items
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LatestPositionsResponseModelCopyWithImpl<$Res>
|
||||
implements _$LatestPositionsResponseModelCopyWith<$Res> {
|
||||
__$LatestPositionsResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LatestPositionsResponseModel _self;
|
||||
final $Res Function(_LatestPositionsResponseModel) _then;
|
||||
|
||||
/// Create a copy of LatestPositionsResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? items = null,}) {
|
||||
return _then(_LatestPositionsResponseModel(
|
||||
items: null == items ? _self._items : items // ignore: cast_nullable_to_non_nullable
|
||||
as List<LatestPositionsItemResponseModel>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LatestPositionsItemResponseModel {
|
||||
|
||||
double get latitude; double get longitude; String? get address; DateTime get positionDate; bool get frequentPlace; String get frequentPlaceName;
|
||||
/// Create a copy of LatestPositionsItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LatestPositionsItemResponseModelCopyWith<LatestPositionsItemResponseModel> get copyWith => _$LatestPositionsItemResponseModelCopyWithImpl<LatestPositionsItemResponseModel>(this as LatestPositionsItemResponseModel, _$identity);
|
||||
|
||||
/// Serializes this LatestPositionsItemResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LatestPositionsItemResponseModel&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.address, address) || other.address == address)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,latitude,longitude,address,positionDate,frequentPlace,frequentPlaceName);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LatestPositionsItemResponseModel(latitude: $latitude, longitude: $longitude, address: $address, positionDate: $positionDate, frequentPlace: $frequentPlace, frequentPlaceName: $frequentPlaceName)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LatestPositionsItemResponseModelCopyWith<$Res> {
|
||||
factory $LatestPositionsItemResponseModelCopyWith(LatestPositionsItemResponseModel value, $Res Function(LatestPositionsItemResponseModel) _then) = _$LatestPositionsItemResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LatestPositionsItemResponseModelCopyWithImpl<$Res>
|
||||
implements $LatestPositionsItemResponseModelCopyWith<$Res> {
|
||||
_$LatestPositionsItemResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LatestPositionsItemResponseModel _self;
|
||||
final $Res Function(LatestPositionsItemResponseModel) _then;
|
||||
|
||||
/// Create a copy of LatestPositionsItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? latitude = null,Object? longitude = null,Object? address = freezed,Object? positionDate = null,Object? frequentPlace = null,Object? frequentPlaceName = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
|
||||
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
|
||||
as double,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
|
||||
as bool,frequentPlaceName: null == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LatestPositionsItemResponseModel].
|
||||
extension LatestPositionsItemResponseModelPatterns on LatestPositionsItemResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LatestPositionsItemResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LatestPositionsItemResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LatestPositionsItemResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel() when $default != null:
|
||||
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel():
|
||||
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LatestPositionsItemResponseModel() when $default != null:
|
||||
return $default(_that.latitude,_that.longitude,_that.address,_that.positionDate,_that.frequentPlace,_that.frequentPlaceName);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _LatestPositionsItemResponseModel implements LatestPositionsItemResponseModel {
|
||||
const _LatestPositionsItemResponseModel({required this.latitude, required this.longitude, required this.address, required this.positionDate, required this.frequentPlace, required this.frequentPlaceName});
|
||||
factory _LatestPositionsItemResponseModel.fromJson(Map<String, dynamic> json) => _$LatestPositionsItemResponseModelFromJson(json);
|
||||
|
||||
@override final double latitude;
|
||||
@override final double longitude;
|
||||
@override final String? address;
|
||||
@override final DateTime positionDate;
|
||||
@override final bool frequentPlace;
|
||||
@override final String frequentPlaceName;
|
||||
|
||||
/// Create a copy of LatestPositionsItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LatestPositionsItemResponseModelCopyWith<_LatestPositionsItemResponseModel> get copyWith => __$LatestPositionsItemResponseModelCopyWithImpl<_LatestPositionsItemResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$LatestPositionsItemResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LatestPositionsItemResponseModel&&(identical(other.latitude, latitude) || other.latitude == latitude)&&(identical(other.longitude, longitude) || other.longitude == longitude)&&(identical(other.address, address) || other.address == address)&&(identical(other.positionDate, positionDate) || other.positionDate == positionDate)&&(identical(other.frequentPlace, frequentPlace) || other.frequentPlace == frequentPlace)&&(identical(other.frequentPlaceName, frequentPlaceName) || other.frequentPlaceName == frequentPlaceName));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,latitude,longitude,address,positionDate,frequentPlace,frequentPlaceName);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LatestPositionsItemResponseModel(latitude: $latitude, longitude: $longitude, address: $address, positionDate: $positionDate, frequentPlace: $frequentPlace, frequentPlaceName: $frequentPlaceName)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LatestPositionsItemResponseModelCopyWith<$Res> implements $LatestPositionsItemResponseModelCopyWith<$Res> {
|
||||
factory _$LatestPositionsItemResponseModelCopyWith(_LatestPositionsItemResponseModel value, $Res Function(_LatestPositionsItemResponseModel) _then) = __$LatestPositionsItemResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
double latitude, double longitude, String? address, DateTime positionDate, bool frequentPlace, String frequentPlaceName
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LatestPositionsItemResponseModelCopyWithImpl<$Res>
|
||||
implements _$LatestPositionsItemResponseModelCopyWith<$Res> {
|
||||
__$LatestPositionsItemResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LatestPositionsItemResponseModel _self;
|
||||
final $Res Function(_LatestPositionsItemResponseModel) _then;
|
||||
|
||||
/// Create a copy of LatestPositionsItemResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? latitude = null,Object? longitude = null,Object? address = freezed,Object? positionDate = null,Object? frequentPlace = null,Object? frequentPlaceName = null,}) {
|
||||
return _then(_LatestPositionsItemResponseModel(
|
||||
latitude: null == latitude ? _self.latitude : latitude // ignore: cast_nullable_to_non_nullable
|
||||
as double,longitude: null == longitude ? _self.longitude : longitude // ignore: cast_nullable_to_non_nullable
|
||||
as double,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,positionDate: null == positionDate ? _self.positionDate : positionDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,frequentPlace: null == frequentPlace ? _self.frequentPlace : frequentPlace // ignore: cast_nullable_to_non_nullable
|
||||
as bool,frequentPlaceName: null == frequentPlaceName ? _self.frequentPlaceName : frequentPlaceName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,45 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'latest_positions_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_LatestPositionsResponseModel _$LatestPositionsResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _LatestPositionsResponseModel(
|
||||
items: (json['items'] as List<dynamic>)
|
||||
.map(
|
||||
(e) => LatestPositionsItemResponseModel.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LatestPositionsResponseModelToJson(
|
||||
_LatestPositionsResponseModel instance,
|
||||
) => <String, dynamic>{'items': instance.items};
|
||||
|
||||
_LatestPositionsItemResponseModel _$LatestPositionsItemResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _LatestPositionsItemResponseModel(
|
||||
latitude: (json['latitude'] as num).toDouble(),
|
||||
longitude: (json['longitude'] as num).toDouble(),
|
||||
address: json['address'] as String?,
|
||||
positionDate: DateTime.parse(json['positionDate'] as String),
|
||||
frequentPlace: json['frequentPlace'] as bool,
|
||||
frequentPlaceName: json['frequentPlaceName'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LatestPositionsItemResponseModelToJson(
|
||||
_LatestPositionsItemResponseModel instance,
|
||||
) => <String, dynamic>{
|
||||
'latitude': instance.latitude,
|
||||
'longitude': instance.longitude,
|
||||
'address': instance.address,
|
||||
'positionDate': instance.positionDate.toIso8601String(),
|
||||
'frequentPlace': instance.frequentPlace,
|
||||
'frequentPlaceName': instance.frequentPlaceName,
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart';
|
||||
import 'package:hub/src/core/domain/repositories/hub_repository.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
|
||||
class HomeRepositoryImpl implements HomeRepository {
|
||||
const HomeRepositoryImpl(this._remote);
|
||||
|
||||
final HomeRemoteDatasource _remote;
|
||||
|
||||
@override
|
||||
Future<List<DeviceEntity>> getDevices({required String userId}) async {
|
||||
return _remote.getDevices(userId: userId);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId}) async {
|
||||
return _remote.getLatestPositions(deviceId: deviceId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
|
||||
abstract class HomeRepository {
|
||||
Future<List<DeviceEntity>> getDevices({required String userId});
|
||||
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId});
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart';
|
||||
import 'package:hub/src/core/data/datasource/hub_remote_datasource_impl.dart';
|
||||
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
||||
|
||||
final homeRemoteDatasourceProvider = Provider<HomeRemoteDatasource>((ref) {
|
||||
final questiaRepository = getIt<QuestiaRepository>();
|
||||
return HomeRemoteDatasourceImpl(questiaRepository);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hub/src/core/data/repositories/hub_repository_impl.dart';
|
||||
import 'package:hub/src/core/domain/repositories/hub_repository.dart';
|
||||
import 'package:hub/src/core/providers/hub_remote_datasource_provier.dart';
|
||||
|
||||
final homeRepositoryProvider = Provider<HomeRepository>((ref) {
|
||||
final remote = ref.read(homeRemoteDatasourceProvider);
|
||||
return HomeRepositoryImpl(remote);
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
class DeviceEntity {
|
||||
final String id;
|
||||
final String identificator;
|
||||
final String carrierName;
|
||||
|
||||
const DeviceEntity({
|
||||
required this.id,
|
||||
required this.identificator,
|
||||
required this.carrierName,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'get_devices_request_entity.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GetDevicesRequestEntity with _$GetDevicesRequestEntity {
|
||||
const factory GetDevicesRequestEntity({
|
||||
required String userId,
|
||||
}) = _GetDevicesRequestEntity;
|
||||
}
|
||||
@@ -0,0 +1,271 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'get_devices_request_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$GetDevicesRequestEntity {
|
||||
|
||||
String get userId;
|
||||
/// Create a copy of GetDevicesRequestEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GetDevicesRequestEntityCopyWith<GetDevicesRequestEntity> get copyWith => _$GetDevicesRequestEntityCopyWithImpl<GetDevicesRequestEntity>(this as GetDevicesRequestEntity, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesRequestEntity&&(identical(other.userId, userId) || other.userId == userId));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesRequestEntity(userId: $userId)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GetDevicesRequestEntityCopyWith<$Res> {
|
||||
factory $GetDevicesRequestEntityCopyWith(GetDevicesRequestEntity value, $Res Function(GetDevicesRequestEntity) _then) = _$GetDevicesRequestEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String userId
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GetDevicesRequestEntityCopyWithImpl<$Res>
|
||||
implements $GetDevicesRequestEntityCopyWith<$Res> {
|
||||
_$GetDevicesRequestEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GetDevicesRequestEntity _self;
|
||||
final $Res Function(GetDevicesRequestEntity) _then;
|
||||
|
||||
/// Create a copy of GetDevicesRequestEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? userId = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GetDevicesRequestEntity].
|
||||
extension GetDevicesRequestEntityPatterns on GetDevicesRequestEntity {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GetDevicesRequestEntity value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GetDevicesRequestEntity value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GetDevicesRequestEntity value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String userId)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity() when $default != null:
|
||||
return $default(_that.userId);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String userId) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity():
|
||||
return $default(_that.userId);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String userId)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesRequestEntity() when $default != null:
|
||||
return $default(_that.userId);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _GetDevicesRequestEntity implements GetDevicesRequestEntity {
|
||||
const _GetDevicesRequestEntity({required this.userId});
|
||||
|
||||
|
||||
@override final String userId;
|
||||
|
||||
/// Create a copy of GetDevicesRequestEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GetDevicesRequestEntityCopyWith<_GetDevicesRequestEntity> get copyWith => __$GetDevicesRequestEntityCopyWithImpl<_GetDevicesRequestEntity>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesRequestEntity&&(identical(other.userId, userId) || other.userId == userId));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesRequestEntity(userId: $userId)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GetDevicesRequestEntityCopyWith<$Res> implements $GetDevicesRequestEntityCopyWith<$Res> {
|
||||
factory _$GetDevicesRequestEntityCopyWith(_GetDevicesRequestEntity value, $Res Function(_GetDevicesRequestEntity) _then) = __$GetDevicesRequestEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String userId
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GetDevicesRequestEntityCopyWithImpl<$Res>
|
||||
implements _$GetDevicesRequestEntityCopyWith<$Res> {
|
||||
__$GetDevicesRequestEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GetDevicesRequestEntity _self;
|
||||
final $Res Function(_GetDevicesRequestEntity) _then;
|
||||
|
||||
/// Create a copy of GetDevicesRequestEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? userId = null,}) {
|
||||
return _then(_GetDevicesRequestEntity(
|
||||
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,17 @@
|
||||
class PositionEntity {
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final String? address;
|
||||
final bool frequentPlace;
|
||||
final String frequentPlaceName;
|
||||
final DateTime positionDate;
|
||||
|
||||
const PositionEntity({
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.address,
|
||||
required this.positionDate,
|
||||
required this.frequentPlace,
|
||||
required this.frequentPlaceName,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
|
||||
abstract class GetDevicesUseCase {
|
||||
Future<List<DeviceEntity>> getDevices({required String userId});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:hub/src/core/domain/repositories/hub_repository.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_devices_use_case.dart';
|
||||
|
||||
class GetDevicesUseCaseImpl implements GetDevicesUseCase {
|
||||
GetDevicesUseCaseImpl(this._repository);
|
||||
|
||||
final HomeRepository _repository;
|
||||
@override
|
||||
Future<List<DeviceEntity>> getDevices({required String userId}) async {
|
||||
return _repository.getDevices(userId: userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
|
||||
abstract class GetLatestPositionsUseCase {
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:hub/src/core/domain/repositories/hub_repository.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
|
||||
|
||||
class GetLatestPositionsUseCaseImpl implements GetLatestPositionsUseCase {
|
||||
GetLatestPositionsUseCaseImpl(this._repository);
|
||||
|
||||
final HomeRepository _repository;
|
||||
@override
|
||||
Future<List<PositionEntity>> getLatestPositions({required String deviceId}) async {
|
||||
await Future<void>.delayed(const Duration(milliseconds: 2000));
|
||||
return _repository.getLatestPositions(deviceId: deviceId);
|
||||
}
|
||||
}
|
||||
18
modules/hub/lib/src/features/hub/hub_builder.dart
Normal file
18
modules/hub/lib/src/features/hub/hub_builder.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:hub/src/features/hub/presentation/hub_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 HubBuilder {
|
||||
const HubBuilder();
|
||||
|
||||
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||
final NavigationContract navigationContract = GetIt.I<NavigationContract>();
|
||||
|
||||
return MaterialPage<void>(
|
||||
key: state.pageKey,
|
||||
child: HubScreen(navigationContract: navigationContract),
|
||||
);
|
||||
}
|
||||
}
|
||||
184
modules/hub/lib/src/features/hub/presentation/hub_screen.dart
Normal file
184
modules/hub/lib/src/features/hub/presentation/hub_screen.dart
Normal file
@@ -0,0 +1,184 @@
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:hub/src/features/hub/presentation/state/hub_view_model.dart';
|
||||
import 'package:design_system/design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
class HubScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
const HubScreen({super.key, required this.navigationContract});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
final viewState = ref.watch(hubViewModelProvider);
|
||||
final viewModel = ref.read(hubViewModelProvider.notifier);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 4)),
|
||||
Stack(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: SizeUtils.getByScreen(small: 36, big: 36),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Image.asset('assets/images/ui/iso_sf.png',
|
||||
height: SizeUtils.getByScreen(small: 18, big: 18)),
|
||||
)
|
||||
),
|
||||
Center(
|
||||
child: SvgPicture.asset('assets/images/ui/logo_sf.svg',
|
||||
height: SizeUtils.getByScreen(small: 36, big: 36))
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 14)),
|
||||
Expanded(child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppSectionButton(
|
||||
onPressed: (){},
|
||||
icon: Icons.support_agent_outlined,
|
||||
text: I18n.customerService),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
|
||||
AppSectionButton(
|
||||
onPressed: (){navigationContract.pushTo(AppRoutes.dashboardHome);},
|
||||
icon: Icons.payments_outlined,
|
||||
text: I18n.sfPay),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
|
||||
AppSectionButton(
|
||||
onPressed: (){},
|
||||
icon: Icons.menu_open_outlined,
|
||||
text: I18n.functions),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
|
||||
AppSectionButton(
|
||||
onPressed: (){},
|
||||
icon: Icons.manage_accounts_outlined,
|
||||
text: I18n.accountSettings),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 7)),
|
||||
AppSectionButton(
|
||||
onPressed: (){},
|
||||
icon: Icons.settings_outlined,
|
||||
text: I18n.deviceSettings),
|
||||
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 16, big: 22)),
|
||||
Text(context.translate(I18n.watchesOnMap),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 20, big: 19),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF588EA5),
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 4, big: 8)),
|
||||
SizedBox(
|
||||
height: SizeUtils.getByScreen(small: 200, big: 300),
|
||||
child: FlutterMap(
|
||||
mapController: viewModel.mapController,
|
||||
options: MapOptions(
|
||||
initialCenter: LatLng(45.32833189648895, -3.0830872665435085), // Center the map over London, UK
|
||||
initialZoom: 15,
|
||||
keepAlive: true,
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
userAgentPackageName: 'com.savefamily.sf_platform',
|
||||
),
|
||||
MarkerLayer(markers: viewState.positions.map((position)=>
|
||||
Marker(
|
||||
point: LatLng(position.latitude, position.longitude),
|
||||
width: 200,
|
||||
height: 145,
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: SvgPicture.asset('assets/images/ui/location.svg',
|
||||
height: 80)),
|
||||
rotate: true,
|
||||
)
|
||||
).toList())
|
||||
],
|
||||
)
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 14, big: 13)),
|
||||
],
|
||||
),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppSectionButton extends ConsumerWidget {
|
||||
|
||||
final GestureTapCallback onPressed;
|
||||
final IconData icon;
|
||||
final String text;
|
||||
|
||||
const AppSectionButton({
|
||||
required this.onPressed,
|
||||
required this.icon,
|
||||
required this.text,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
padding: SizeUtils.getByScreen(
|
||||
small: EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
big: EdgeInsets.symmetric(horizontal: 21, vertical: 8)
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(SizeUtils.getByScreen(small: 12, big: 18))),
|
||||
color: theme.getColorFor(ThemeCode.backgroundSecondary),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
),
|
||||
padding: EdgeInsets.all(SizeUtils.getByScreen(small: 4, big: 12)),
|
||||
child: Icon(icon,
|
||||
size: SizeUtils.getByScreen(small: 40, big: 44),
|
||||
color: Color(0xFF588EA5),
|
||||
weight: 30,
|
||||
),
|
||||
),
|
||||
SizedBox(width: SizeUtils.getByScreen(small: 16, big: 15)),
|
||||
Expanded(
|
||||
child: Text(context.translate(text),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 18, big: 19),
|
||||
fontWeight: FontWeight.w500
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:hub/src/core/providers/hub_repository_provider.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_devices_use_case.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_devices_use_case_impl.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
final getDevicesUseCaseProvider =
|
||||
Provider.autoDispose<GetDevicesUseCase>((ref) {
|
||||
final authRepository = ref.read(homeRepositoryProvider);
|
||||
return GetDevicesUseCaseImpl(authRepository);
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hub/src/core/providers/hub_repository_provider.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case_impl.dart';
|
||||
|
||||
final getLatestPositionsUseCaseProvider =
|
||||
Provider.autoDispose<GetLatestPositionsUseCase>((ref) {
|
||||
final authRepository = ref.read(homeRepositoryProvider);
|
||||
return GetLatestPositionsUseCaseImpl(authRepository);
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_devices_use_case.dart';
|
||||
import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart';
|
||||
import 'package:hub/src/features/hub/presentation/providers/get_devices_use_case_provider.dart';
|
||||
import 'package:hub/src/features/hub/presentation/providers/get_latest_positions_use_case_provider.dart';
|
||||
import 'package:hub/src/features/hub/presentation/state/hub_view_state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
final hubViewModelProvider =
|
||||
NotifierProvider.autoDispose<HubViewModel, HubViewState>(
|
||||
HubViewModel.new,
|
||||
);
|
||||
|
||||
class HubViewModel extends Notifier<HubViewState> {
|
||||
late final GetDevicesUseCase _getDevicesUseCase;
|
||||
late final GetLatestPositionsUseCase _getLatestPositionsUseCase;
|
||||
|
||||
late final MapController mapController;
|
||||
|
||||
@override
|
||||
HubViewState build() {
|
||||
_getDevicesUseCase = ref.read(getDevicesUseCaseProvider);
|
||||
_getLatestPositionsUseCase = ref.read(getLatestPositionsUseCaseProvider);
|
||||
|
||||
mapController = MapControllerImpl();
|
||||
|
||||
_getDevicesUseCase.getDevices(
|
||||
userId: ''
|
||||
).then((List<DeviceEntity> res){
|
||||
state = state.copyWith(devices: res);
|
||||
return Future.wait(res.map((device) =>
|
||||
_getLatestPositionsUseCase.getLatestPositions(
|
||||
deviceId: device.identificator
|
||||
)
|
||||
));
|
||||
}).then(
|
||||
(List<List<PositionEntity>> res) {
|
||||
setPositions(res);
|
||||
}
|
||||
);
|
||||
|
||||
ref.onDispose(disposeControllers);
|
||||
|
||||
return HubViewState();
|
||||
}
|
||||
|
||||
void setPositions(List<List<PositionEntity>> positions) {
|
||||
final devicePositions = positions.map((List<PositionEntity> devicePositions)=>devicePositions[0]).toList();
|
||||
state = state.copyWith(
|
||||
positions: devicePositions,
|
||||
);
|
||||
mapController.move(LatLng(
|
||||
devicePositions.fold(0.0, (double x, PositionEntity position)=>x+position.latitude)/positions.length,
|
||||
devicePositions.fold(0.0, (double x, PositionEntity position)=>x+position.longitude)/positions.length,
|
||||
), 15);
|
||||
}
|
||||
|
||||
GetDevicesRequestEntity _toDevicesRequest() {
|
||||
final userId = '';
|
||||
if (userId == null) throw Exception('userId is required');
|
||||
|
||||
return GetDevicesRequestEntity(userId: userId);
|
||||
}
|
||||
|
||||
/*void _startLoadingForSignUp() {
|
||||
state = state.copyWith(
|
||||
isLoading: true,
|
||||
errorMessage: '',
|
||||
twoFASecret: null,
|
||||
showSecretCode: false,
|
||||
showAccountCreated: false,
|
||||
);
|
||||
}*/
|
||||
|
||||
void disposeControllers(){
|
||||
mapController.dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:hub/src/features/hub/domain/entities/device_entity.dart';
|
||||
import 'package:hub/src/features/hub/domain/entities/position_entity.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
part 'hub_view_state.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class HubViewState with _$HubViewState {
|
||||
const factory HubViewState({
|
||||
@Default([]) List<DeviceEntity> devices,
|
||||
@Default([]) List<PositionEntity> positions
|
||||
}) = _HubViewState;
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'hub_view_state.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$HubViewState {
|
||||
|
||||
List<DeviceEntity> get devices; List<PositionEntity> get positions;
|
||||
/// Create a copy of HubViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$HubViewStateCopyWith<HubViewState> get copyWith => _$HubViewStateCopyWithImpl<HubViewState>(this as HubViewState, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is HubViewState&&const DeepCollectionEquality().equals(other.devices, devices)&&const DeepCollectionEquality().equals(other.positions, positions));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(devices),const DeepCollectionEquality().hash(positions));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HubViewState(devices: $devices, positions: $positions)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $HubViewStateCopyWith<$Res> {
|
||||
factory $HubViewStateCopyWith(HubViewState value, $Res Function(HubViewState) _then) = _$HubViewStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<DeviceEntity> devices, List<PositionEntity> positions
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$HubViewStateCopyWithImpl<$Res>
|
||||
implements $HubViewStateCopyWith<$Res> {
|
||||
_$HubViewStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final HubViewState _self;
|
||||
final $Res Function(HubViewState) _then;
|
||||
|
||||
/// Create a copy of HubViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? devices = null,Object? positions = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable
|
||||
as List<DeviceEntity>,positions: null == positions ? _self.positions : positions // ignore: cast_nullable_to_non_nullable
|
||||
as List<PositionEntity>,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [HubViewState].
|
||||
extension HubViewStatePatterns on HubViewState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _HubViewState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _HubViewState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _HubViewState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, List<PositionEntity> positions)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState() when $default != null:
|
||||
return $default(_that.devices,_that.positions);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<DeviceEntity> devices, List<PositionEntity> positions) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState():
|
||||
return $default(_that.devices,_that.positions);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<DeviceEntity> devices, List<PositionEntity> positions)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _HubViewState() when $default != null:
|
||||
return $default(_that.devices,_that.positions);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _HubViewState implements HubViewState {
|
||||
const _HubViewState({final List<DeviceEntity> devices = const [], final List<PositionEntity> positions = const []}): _devices = devices,_positions = positions;
|
||||
|
||||
|
||||
final List<DeviceEntity> _devices;
|
||||
@override@JsonKey() List<DeviceEntity> get devices {
|
||||
if (_devices is EqualUnmodifiableListView) return _devices;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_devices);
|
||||
}
|
||||
|
||||
final List<PositionEntity> _positions;
|
||||
@override@JsonKey() List<PositionEntity> get positions {
|
||||
if (_positions is EqualUnmodifiableListView) return _positions;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_positions);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of HubViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$HubViewStateCopyWith<_HubViewState> get copyWith => __$HubViewStateCopyWithImpl<_HubViewState>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _HubViewState&&const DeepCollectionEquality().equals(other._devices, _devices)&&const DeepCollectionEquality().equals(other._positions, _positions));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_devices),const DeepCollectionEquality().hash(_positions));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'HubViewState(devices: $devices, positions: $positions)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$HubViewStateCopyWith<$Res> implements $HubViewStateCopyWith<$Res> {
|
||||
factory _$HubViewStateCopyWith(_HubViewState value, $Res Function(_HubViewState) _then) = __$HubViewStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<DeviceEntity> devices, List<PositionEntity> positions
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$HubViewStateCopyWithImpl<$Res>
|
||||
implements _$HubViewStateCopyWith<$Res> {
|
||||
__$HubViewStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _HubViewState _self;
|
||||
final $Res Function(_HubViewState) _then;
|
||||
|
||||
/// Create a copy of HubViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? devices = null,Object? positions = null,}) {
|
||||
return _then(_HubViewState(
|
||||
devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable
|
||||
as List<DeviceEntity>,positions: null == positions ? _self._positions : positions // ignore: cast_nullable_to_non_nullable
|
||||
as List<PositionEntity>,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -3,43 +3,43 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "characters",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/characters-1.4.0",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/characters-1.4.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "collection",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/collection-1.19.1",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.19.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.4"
|
||||
},
|
||||
{
|
||||
"name": "flutter",
|
||||
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/packages/flutter",
|
||||
"rootUri": "file:///C:/Program%20Files/Flutter/packages/flutter",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.8"
|
||||
},
|
||||
{
|
||||
"name": "material_color_utilities",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/material_color_utilities-0.11.1",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.17"
|
||||
},
|
||||
{
|
||||
"name": "meta",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/meta-1.16.0",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/meta-1.16.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "sky_engine",
|
||||
"rootUri": "file:///Users/juliandalcalaf/Development/flutter/bin/cache/pkg/sky_engine",
|
||||
"rootUri": "file:///C:/Program%20Files/Flutter/bin/cache/pkg/sky_engine",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.8"
|
||||
},
|
||||
{
|
||||
"name": "vector_math",
|
||||
"rootUri": "file:///Users/juliandalcalaf/.pub-cache/hosted/pub.dev/vector_math-2.2.0",
|
||||
"rootUri": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.2.0",
|
||||
"packageUri": "lib/",
|
||||
"languageVersion": "3.1"
|
||||
},
|
||||
@@ -52,7 +52,7 @@
|
||||
],
|
||||
"generator": "pub",
|
||||
"generatorVersion": "3.9.2",
|
||||
"flutterRoot": "file:///Users/juliandalcalaf/Development/flutter",
|
||||
"flutterVersion": "3.35.7",
|
||||
"pubCache": "file:///Users/juliandalcalaf/.pub-cache"
|
||||
"flutterRoot": "file:///C:/Program%20Files/Flutter",
|
||||
"flutterVersion": "3.35.6",
|
||||
"pubCache": "file:///C:/Users/Aitor%20Arana/AppData/Local/Pub/Cache"
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.35.7
|
||||
3.35.6
|
||||
@@ -1,5 +1,6 @@
|
||||
class AppRoutes {
|
||||
static const splash = '/splash';
|
||||
static const hub = '/hub';
|
||||
static const login = '/login';
|
||||
static const signup = '/signup';
|
||||
static const onboarding = '/onboarding';
|
||||
|
||||
@@ -130,5 +130,11 @@
|
||||
"secretCodeKeyCopied": "Key copied",
|
||||
"secretCodeStep3Title": "Copy the generated code",
|
||||
"secretCodeStep3Body": "After scanning the QR code or entering the key in the authenticator app, copy the generated 6-digit code and enter it on the next screen.",
|
||||
"secretCodeConfigure": "Set up"
|
||||
"secretCodeConfigure": "Set up",
|
||||
"customerService": "Customer service / Support",
|
||||
"sfPay": "SaveFamily Pay",
|
||||
"functions": "Functions",
|
||||
"accountSettings": "Account Settings",
|
||||
"deviceSettings": "Device Settings",
|
||||
"watchesOnMap": "Smartwatch on the map"
|
||||
}
|
||||
@@ -130,5 +130,11 @@
|
||||
"secretCodeKeyCopied": "Llave copiada",
|
||||
"secretCodeStep3Title": "Copia el código generado",
|
||||
"secretCodeStep3Body": "Después de escanear el código QR o introducir la llave en la aplicación de autenticación, copia el código generado de 6 dígitos e introdúcelo en la siguiente pantalla.",
|
||||
"secretCodeConfigure": "Configurar"
|
||||
"secretCodeConfigure": "Configurar",
|
||||
"customerService": "Servicio de Atención al Cliente",
|
||||
"sfPay": "SaveFamily Pay",
|
||||
"functions": "Funciones",
|
||||
"accountSettings": "Ajustes de la cuenta",
|
||||
"deviceSettings": "Ajustes del dispositivo",
|
||||
"watchesOnMap": "Relojes en el mapa"
|
||||
}
|
||||
@@ -161,4 +161,10 @@ class I18n {
|
||||
static const String secretCodeStep3Title = 'secretCodeStep3Title';
|
||||
static const String secretCodeStep3Body = 'secretCodeStep3Body';
|
||||
static const String secretCodeConfigure = 'secretCodeConfigure';
|
||||
static const String customerService = 'customerService';
|
||||
static const String sfPay = 'sfPay';
|
||||
static const String functions = 'functions';
|
||||
static const String accountSettings = 'accountSettings';
|
||||
static const String deviceSettings = 'deviceSettings';
|
||||
static const String watchesOnMap = 'watchesOnMap';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user