diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index b459952..66ef37f 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_facebook_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth-5.0.7\\\\","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-7.0.1\\\\","native_build":true,"dependencies":[]},{"name":"google_sign_in_ios","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_ios-5.5.1\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_foundation-2.1.2\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_facebook_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth-5.0.7\\\\","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-7.0.1\\\\","native_build":true,"dependencies":[]},{"name":"google_sign_in_android","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_android-6.1.5\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.15\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"facebook_auth_desktop","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\facebook_auth_desktop-0.0.8\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_secure_storage_macos","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_macos-2.0.1\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_foundation-2.1.2\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_linux-1.1.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.3\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_windows-1.1.3\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.3\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","dependencies":[]},{"name":"firebase_analytics_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics_web-0.5.1+8\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_auth_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth_web-5.2.4\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core_web-2.1.0\\\\","dependencies":[]},{"name":"firebase_messaging_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging_web-3.2.11\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_remote_config_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config_web-1.1.18\\\\","dependencies":["firebase_core_web"]},{"name":"flutter_facebook_auth_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth_web-4.1.1\\\\","dependencies":[]},{"name":"flutter_secure_storage_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_web-1.1.1\\\\","dependencies":[]},{"name":"google_sign_in_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_web-0.10.2+1\\\\","dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","dependencies":["package_info_plus"]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]},{"name":"sign_in_with_apple_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple_web-1.0.1\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"facebook_auth_desktop","dependencies":["flutter_secure_storage"]},{"name":"firebase_analytics","dependencies":["firebase_analytics_web","firebase_core"]},{"name":"firebase_analytics_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_remote_config","dependencies":["firebase_core","firebase_remote_config_web"]},{"name":"firebase_remote_config_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_facebook_auth","dependencies":["flutter_facebook_auth_web","facebook_auth_desktop"]},{"name":"flutter_facebook_auth_web","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"posthog_session","dependencies":[]},{"name":"sentry_flutter","dependencies":["package_info_plus"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sign_in_with_apple","dependencies":["sign_in_with_apple_web"]},{"name":"sign_in_with_apple_web","dependencies":[]}],"date_created":"2023-01-28 12:44:03.284349","version":"3.3.10"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_facebook_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth-5.0.7\\\\","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-7.0.1\\\\","native_build":true,"dependencies":[]},{"name":"google_sign_in_ios","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_ios-5.5.1\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_foundation-2.1.2\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_facebook_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth-5.0.7\\\\","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-7.0.1\\\\","native_build":true,"dependencies":[]},{"name":"google_sign_in_android","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_android-6.1.5\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_android-2.0.15\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":true,"dependencies":[]},{"name":"facebook_auth_desktop","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\facebook_auth_desktop-0.0.8\\\\","native_build":true,"dependencies":[]},{"name":"firebase_analytics","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics-10.1.0\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_auth","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth-4.2.5\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core-2.4.1\\\\","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging-14.2.1\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_remote_config","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config-3.0.9\\\\","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_secure_storage_macos","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_macos-2.0.1\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":true,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_foundation-2.1.2\\\\","native_build":true,"dependencies":[]},{"name":"sign_in_with_apple","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple-4.3.0\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_linux-1.1.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_linux-2.1.3\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_windows-1.1.3\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","native_build":true,"dependencies":["package_info_plus"]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_windows-2.1.3\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\device_info_plus-8.0.0\\\\","dependencies":[]},{"name":"firebase_analytics_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_analytics_web-0.5.1+8\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_auth_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_auth_web-5.2.4\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_core_web-2.1.0\\\\","dependencies":[]},{"name":"firebase_messaging_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_messaging_web-3.2.11\\\\","dependencies":["firebase_core_web"]},{"name":"firebase_remote_config_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\firebase_remote_config_web-1.1.18\\\\","dependencies":["firebase_core_web"]},{"name":"flutter_facebook_auth_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_facebook_auth_web-4.1.1\\\\","dependencies":[]},{"name":"flutter_secure_storage_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage_web-1.1.1\\\\","dependencies":[]},{"name":"google_sign_in_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\google_sign_in_web-0.10.2+1\\\\","dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\package_info_plus-3.0.2\\\\","dependencies":[]},{"name":"posthog_session","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\git\\\\posthog_session-0db36d398cc23a7bfab09e0ddb6773525a92107b\\\\","dependencies":[]},{"name":"sentry_flutter","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sentry_flutter-6.19.0\\\\","dependencies":["package_info_plus"]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\shared_preferences_web-2.0.4\\\\","dependencies":[]},{"name":"sign_in_with_apple_web","path":"C:\\\\Users\\\\bossa\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sign_in_with_apple_web-1.0.1\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"facebook_auth_desktop","dependencies":["flutter_secure_storage"]},{"name":"firebase_analytics","dependencies":["firebase_analytics_web","firebase_core"]},{"name":"firebase_analytics_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_remote_config","dependencies":["firebase_core","firebase_remote_config_web"]},{"name":"firebase_remote_config_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_facebook_auth","dependencies":["flutter_facebook_auth_web","facebook_auth_desktop"]},{"name":"flutter_facebook_auth_web","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":[]},{"name":"google_sign_in","dependencies":["google_sign_in_android","google_sign_in_ios","google_sign_in_web"]},{"name":"google_sign_in_android","dependencies":[]},{"name":"google_sign_in_ios","dependencies":[]},{"name":"google_sign_in_web","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"posthog_session","dependencies":[]},{"name":"sentry_flutter","dependencies":["package_info_plus"]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sign_in_with_apple","dependencies":["sign_in_with_apple_web"]},{"name":"sign_in_with_apple_web","dependencies":[]}],"date_created":"2023-02-10 19:48:28.199892","version":"3.3.10"} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 96486fd..5f3846d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ migrate_working_dir/ .dart_tool/ .packages build/ +.flutter-plugins-dependencies* \ No newline at end of file diff --git a/lib/model/cache.dart b/lib/model/cache.dart index 80888ae..dafa997 100644 --- a/lib/model/cache.dart +++ b/lib/model/cache.dart @@ -119,6 +119,7 @@ class Cache with Logging { static String baseUrlLive = 'https://api.workouttest.org/api/'; static String baseUrlTest = 'https://apitest.workouttest.org/api/'; + static String baseUrlLocal = 'http://localhost:8443/api/'; late String baseUrl; static const String mediaUrl = 'https://admin.workouttest.org/media/'; static const String username = 'bosi'; @@ -199,6 +200,9 @@ class Cache with Logging { if (testEnv == "1") { baseUrl = baseUrlTest; liveServer = false; + } else if ( testEnv == "2") { + baseUrl = baseUrlLocal; + liveServer = false; } for (var element in ActivityDone.values) { @@ -210,6 +214,10 @@ class Cache with Logging { baseUrl = baseUrlTest; } + void setLocalBaseUrl() { + baseUrl = baseUrlLocal; + } + String getAuthToken() { return authToken; } @@ -362,10 +370,14 @@ class Cache with Logging { } void setServerAddress(SharedPreferences prefs) { - if (this.testEnvironment == "1") { + if (testEnvironment == "1") { baseUrl = baseUrlTest; print("TestEnv $baseUrl"); return; + } else if ( testEnvironment == "2") { + baseUrl = baseUrlLocal; + print("TestEnv $baseUrl"); + return; } final bool? live = prefs.getBool(Cache.serverKey); if (live == null) { diff --git a/lib/model/customer_activity.dart b/lib/model/customer_activity.dart index 5960f80..fb5899a 100644 --- a/lib/model/customer_activity.dart +++ b/lib/model/customer_activity.dart @@ -1,3 +1,4 @@ +// ignore: depend_on_referenced_packages import 'package:intl/intl.dart'; class CustomerActivity { @@ -12,19 +13,19 @@ class CustomerActivity { customerId = json['custoemrId']; type = json['type']; skipped = json['skipped']; - this.dateAdd = DateTime.parse(json['dateAdd']); + dateAdd = DateTime.parse(json['dateAdd']); } Map toJson() => { - 'activityId': this.activityId, - 'customerId': this.customerId, - 'type': this.type, - 'skipped': this.skipped, - "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd!), + 'activityId': activityId, + 'customerId': customerId, + 'type': type, + 'skipped': skipped, + "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(dateAdd!), }; @override String toString() { - return this.toJson().toString(); + return toJson().toString(); } } diff --git a/lib/model/customer_exercise_device.dart b/lib/model/customer_exercise_device.dart index 0477b47..9564441 100644 --- a/lib/model/customer_exercise_device.dart +++ b/lib/model/customer_exercise_device.dart @@ -1,3 +1,4 @@ +// ignore: depend_on_referenced_packages import 'package:intl/intl.dart'; class CustomerExerciseDevice { @@ -14,11 +15,11 @@ class CustomerExerciseDevice { } CustomerExerciseDevice.fromJson(Map json) { - this.customerExerciseDeviceId = json['customerExerciseDeviceId']; - this.exerciseDeviceId = json['exerciseDeviceId']; - this.customerId = json['customerId']; - this.favourite = json['favourite'] == 1 ? true : false; - this.dateAdd = DateTime.parse(json['dateAdd']); + customerExerciseDeviceId = json['customerExerciseDeviceId']; + exerciseDeviceId = json['exerciseDeviceId']; + customerId = json['customerId']; + favourite = json['favourite'] == 1 ? true : false; + dateAdd = DateTime.parse(json['dateAdd']); } Map toJson() { @@ -27,7 +28,7 @@ class CustomerExerciseDevice { "exerciseDeviceId": exerciseDeviceId, "customerId": customerId, "favourite": favourite == true ? 1 : 0, - "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd), + "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(dateAdd), }; } else { return { @@ -35,7 +36,7 @@ class CustomerExerciseDevice { "exerciseDeviceId": exerciseDeviceId, "customerId": customerId, "favourite": favourite == true ? 1 : 0, - "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd), + "dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(dateAdd), }; } } diff --git a/lib/model/customer_property.dart b/lib/model/customer_property.dart index 2d3d4fa..ac5026d 100644 --- a/lib/model/customer_property.dart +++ b/lib/model/customer_property.dart @@ -1,6 +1,8 @@ +// ignore: depend_on_referenced_packages import 'package:intl/intl.dart'; +import '../util/logging.dart'; -class CustomerProperty { +class CustomerProperty with Logging { int? customerPropertyId; late int propertyId; late int customerId; @@ -18,20 +20,20 @@ class CustomerProperty { required this.propertyValue}); CustomerProperty.fromJson(Map json) { - this.customerPropertyId = json['customerPropertyId']; - this.propertyId = json['propertyId']; - this.customerId = json['customerId']; - this.dateAdd = DateTime.parse(json['dateAdd']); + customerPropertyId = json['customerPropertyId']; + propertyId = json['propertyId']; + customerId = json['customerId']; + dateAdd = DateTime.parse(json['dateAdd']); - if (this.dateAdd != null) { - dateYmd = DateFormat('yyyy-MM-dd').format(this.dateAdd!); - dateYm = DateFormat('yyyy-MM').format(this.dateAdd!); - dateY = DateFormat('yyyy').format(this.dateAdd!); + if (dateAdd != null) { + dateYmd = DateFormat('yyyy-MM-dd').format(dateAdd!); + dateYm = DateFormat('yyyy-MM').format(dateAdd!); + dateY = DateFormat('yyyy').format(dateAdd!); } - this.propertyValue = json['propertyValue']; + propertyValue = json['propertyValue']; - print("Json $json, ${this.toString()}"); + print("Json $json, ${toString()}"); } Map toJson() { diff --git a/lib/service/api.dart b/lib/service/api.dart index 4626267..d1030a0 100644 --- a/lib/service/api.dart +++ b/lib/service/api.dart @@ -4,7 +4,6 @@ import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:workouttest_util/util/logging.dart'; import 'package:workouttest_util/util/common.dart'; import 'package:workouttest_util/util/not_found_exception.dart'; -import 'package:flutter/services.dart'; import 'package:workouttest_util/model/cache.dart'; class APIClient with Common, Logging { @@ -20,42 +19,40 @@ class APIClient with Common, Logging { } dynamic authenticateUser(String email, String password) async { - var url = Cache().getBaseUrl() + "authenticate"; + var baseUrl = Cache().getBaseUrl(); + log("Base URL: $baseUrl"); + var url = "${baseUrl}authenticate"; try { - ByteData data = await rootBundle.load('asset/data/aitrainer_server.crt.pem'); - SecurityContext context = SecurityContext.defaultContext; - if (cert == false) { - print("Set CERT $cert"); - context.setTrustedCertificatesBytes(data.buffer.asUint8List(), password: "[xxxx]"); - cert = true; - } - - HttpClient client = new HttpClient(); //context: context Todo provide the right certificate - client.badCertificateCallback = ((X509Certificate cert, String host, int port) { - print("Host: $host Port: $port"); - return true; - }); var uri = Uri.parse(url); + HttpClient client = HttpClient(); final HttpClientRequest request = await client.postUrl(uri); - request.headers.set('Content-Type', 'application/json'); + request.headers.contentType = ContentType('application', 'json', charset: 'utf-8'); request.headers.set('Authorization', '1'); - final body = '{"username":"$email", "password":"$password"}'; + final body = jsonEncode({ + 'username': email, + 'password': password + }); + request.write(body); HttpClientResponse result = await request.close(); client.close(); if (result.statusCode != 200) { - trace("authentication response: ${result.statusCode} with URL: $url"); + log("authentication response: ${result.statusCode} with URL: $url"); throw Exception("Authentication error: ${result.statusCode}"); } - return jsonDecode(await result.transform(utf8.decoder).join()); + + String response = await result.transform(utf8.decoder).join(); + log("Authentication status: ${result.statusCode}, response: $response"); + final data = jsonDecode(response); + return data; } catch (exception) { - print(exception.toString()); + log(exception.toString()); try { await Sentry.captureException(exception); } on Exception catch (e) { - print(e); + log(e.toString()); } throw Exception("Network error, try again later!"); @@ -67,35 +64,35 @@ class APIClient with Common, Logging { trace(" ------------ http/post body $body - url: $url "); try { String authToken = Cache().getAuthToken(); - if (authToken.length == 0) { - var responseJson = await this.authenticateUser(Cache.username, Cache.password); + if (authToken.isEmpty) { + var responseJson = await authenticateUser(Cache.username, Cache.password); authToken = responseJson['token']; Cache().authToken = authToken; } var uri = Uri.parse(url); - HttpClient client = new HttpClient(); + HttpClient client = HttpClient(); client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true); final HttpClientRequest request = await client.postUrl(uri); - request.headers.contentType = new ContentType("application", "json", charset: "utf-8"); + request.headers.contentType = ContentType("application", "json", charset: "utf-8"); request.headers.set('Authorization', 'Bearer $authToken'); //request.contentLength = body.length; request.write(body); HttpClientResponse result = await request.close(); client.close(); - trace(" ------------post response code: " + result.statusCode.toString()); + trace(" ------------post response code: ${result.statusCode}"); if (result.statusCode == 200) { return await result.transform(utf8.decoder).join(); } else if (result.statusCode == 404) { - throw NotFoundException(message: "Not Found"); + throw const NotFoundException(message: "Not Found"); } else { throw Exception("Network Error, please try again later"); } } on NotFoundException catch(e) { - throw NotFoundException(message: "Not Found"); + throw NotFoundException(message: "Not Found ${e.message}"); } on Exception catch (e) { - print("Post Exception: $e"); + log("Post Exception: $e"); await Sentry.captureException(e); throw Exception("Network Error, please try again later"); } @@ -104,36 +101,35 @@ class APIClient with Common, Logging { Future get(String endPoint, String param) async { final url = Cache().getBaseUrl() + endPoint + param; try { - trace("-------- API get " + url); + trace("-------- API get $url"); String authToken = Cache().getAuthToken(); - if (authToken.length == 0) { - var responseJson = await this.authenticateUser(Cache.username, Cache.password); + if (authToken.isEmpty) { + var responseJson = await authenticateUser(Cache.username, Cache.password); authToken = responseJson['token']; Cache().authToken = authToken; } var uri = Uri.parse(url); - HttpClient client = new HttpClient(); - - client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true); + HttpClient client = HttpClient(); final HttpClientRequest request = await client.getUrl(uri); - request.headers.set('Content-Type', 'application/json'); + request.headers.contentType = ContentType("application", "json", charset: "utf-8"); request.headers.set('Authorization', 'Bearer $authToken'); + request.write(""); HttpClientResponse result = await request.close(); client.close(); - trace(" ------------get response code: " + result.statusCode.toString()); + trace(" ------------get response code: ${result.statusCode}"); if (result.statusCode == 200) { return await result.transform(utf8.decoder).join(); } else if (result.statusCode == 404) { - throw NotFoundException(message: "Not Found"); + throw const NotFoundException(message: "Not Found"); } else { throw Exception("Network Error, please try again later"); } } on NotFoundException catch(e) { - throw NotFoundException(message: "Not Found"); + throw NotFoundException(message: "Not Found ${e.message}"); } on Exception catch (e) { - print("Post Exception: $e"); + log("Post Exception: $e"); await Sentry.captureException(e); throw Exception("Network Error, please try again later"); } diff --git a/lib/service/customer_service.dart b/lib/service/customer_service.dart index 68d72a6..23a4815 100644 --- a/lib/service/customer_service.dart +++ b/lib/service/customer_service.dart @@ -22,14 +22,14 @@ class CustomerApi with Logging { Future saveCustomer(Customer customer) async { customer.dateChange = DateTime.now(); - String body = JsonEncoder().convert(customer.toJson()); - log(" ===== saving customer id: " + customer.customerId.toString() + ":" + body); - await _client.post("customers/" + customer.customerId.toString(), body); + String body = const JsonEncoder().convert(customer.toJson()); + log(" ===== saving customer id: ${customer.customerId}:$body"); + await _client.post("customers/${customer.customerId}", body); } Future updateFirebaseUid(int customerId, String uid) async { - log(" ===== update Firebase uid : " + customerId.toString() + ": " + uid); - await _client.post("customers/update_firebase_uid/" + customerId.toString(), uid); + log(" ===== update Firebase uid : $customerId: $uid"); + await _client.post("customers/update_firebase_uid/$customerId", uid); } Future deactivateCustomer(int customerId) async { @@ -40,21 +40,21 @@ class CustomerApi with Logging { Future addCustomer(Customer customer) async { customer.dateAdd = DateTime.now(); customer.dateChange = DateTime.now(); - String body = JsonEncoder().convert(customer.toJson()); - log(" ===== add new customer: " + body); + String body = const JsonEncoder().convert(customer.toJson()); + log(" ===== add new customer: $body"); await _client.post("customers", body); } Future addUser(User user) async { - String body = JsonEncoder().convert(user.toJson()); - log(" ===== add new user: " + body); + String body = const JsonEncoder().convert(user.toJson()); + log(" ===== add new user: $body"); final String responseBody = await _client.post("registration", body); Customer customer; try { int? status = jsonDecode(responseBody)['status']; if (status != null) { String error = jsonDecode(responseBody)['error']; - throw new Exception(error); + throw Exception(error); } else { customer = Customer.fromJson(jsonDecode(responseBody)); await Cache().afterRegistration(customer); @@ -63,58 +63,58 @@ class CustomerApi with Logging { if (responseBody == "Customer exists") { throw WorkoutTestException(code: WorkoutTestException.CUSTOMER_EXISTS, message: responseBody); } - throw new Exception(responseBody); + throw Exception(responseBody); } } Future getUser(User user) async { - String body = JsonEncoder().convert(user.toJson()); - log(" ===== login the user: " + body); + String body = const JsonEncoder().convert(user.toJson()); + log(" ===== login the user: $body"); final String responseBody = await _client.post("login", body); Customer customer; try { customer = Customer.fromJson(jsonDecode(responseBody)); await Cache().afterLogin(customer); } on FormatException { - throw new Exception(responseBody); + throw Exception(responseBody); } } Future getUserByEmail(String email) async { - log(" ===== User getByEmail : " + email); - final String responseBody = await _client.get("customers/find_by_email/" + email, ""); + log(" ===== User getByEmail : $email"); + final String responseBody = await _client.get("customers/find_by_email/$email", ""); Customer customer; try { customer = Customer.fromJson(jsonDecode(responseBody)); if (customer.firebaseUid == null) { - await this.updateFirebaseUid(customer.customerId!, Cache().firebaseUid!); + await updateFirebaseUid(customer.customerId!, Cache().firebaseUid!); } Cache().userLoggedIn = customer; - final List? properties = await this.getActualProperties(customer.customerId!); + final List? properties = await getActualProperties(customer.customerId!); if (properties != null) { - this.initProperties(properties); + initProperties(properties); } } on FormatException { - throw new Exception(responseBody); + throw Exception(responseBody); } } Future getCustomer(int customerId) async { String body = ""; - log(" ===== get the customer by id: " + customerId.toString()); + log(" ===== get the customer by id: $customerId"); try { - final String responseBody = await _client.get("customers/" + customerId.toString(), body); + final String responseBody = await _client.get("customers/$customerId", body); Customer customer = Customer.fromJson(jsonDecode(responseBody)); - log(" --- Customer: " + customer.toJson().toString()); + log(" --- Customer: ${customer.toJson()}"); Cache().userLoggedIn = customer; - final List? properties = await this.getActualProperties(customerId); + final List? properties = await getActualProperties(customerId); //log(" ---- Props: " + properties.toJson().toString()); //await Cache().initCustomer(customerId); if (properties != null) { - this.initProperties(properties); + initProperties(properties); } } on Exception catch (exception) { - log("Exception: " + exception.toString()); + log("Exception: $exception"); log(" === go to registration "); Cache().logout(); Cache().startPage = "registration"; diff --git a/lib/service/exercise_device_service.dart b/lib/service/exercise_device_service.dart index bab29b9..19bf6fd 100644 --- a/lib/service/exercise_device_service.dart +++ b/lib/service/exercise_device_service.dart @@ -8,7 +8,7 @@ class ExerciseDeviceApi { final APIClient _client = APIClient(); Future> getDevices() async { - final body = await _client.get("exercise_device/", ""); + final body = await _client.get("exercise_device", ""); final Iterable json = jsonDecode(body); final List devices = json.map((device) => ExerciseDevice.fromJson(device)).toList(); Cache().setDevices(devices); diff --git a/lib/service/exercise_type_service.dart b/lib/service/exercise_type_service.dart index 3348692..458cbeb 100644 --- a/lib/service/exercise_type_service.dart +++ b/lib/service/exercise_type_service.dart @@ -14,7 +14,7 @@ class ExerciseTypeApi with Logging { final List exerciseTypes = json.map((exerciseType) => ExerciseType.fromJson(exerciseType)).toList(); await Future.forEach(exerciseTypes, (element) async { - ExerciseType exerciseType = element as ExerciseType; + ExerciseType exerciseType = element; exerciseType.imageUrl = await buildImage(exerciseType.imageUrl, exerciseType.exerciseTypeId); }); log("ExerciseTypes downloaded"); @@ -25,12 +25,12 @@ class ExerciseTypeApi with Logging { Future buildImage(String imageUrl, int exerciseTypeId) async { if (imageUrl.length > 8) { - String assetImage = 'asset/menu/' + imageUrl.substring(7); + String assetImage = 'asset/menu/${imageUrl.substring(7)}'; return rootBundle.load(assetImage).then((value) { return assetImage; }).catchError((_) { String imagePath = assetImage.substring(10); - String url = Cache.mediaUrl + 'images' + imagePath; + String url = '${Cache.mediaUrl}images$imagePath'; return url; }); } else { diff --git a/lib/service/firebase_api.dart b/lib/service/firebase_api.dart index 144997f..92ecb4d 100644 --- a/lib/service/firebase_api.dart +++ b/lib/service/firebase_api.dart @@ -117,7 +117,7 @@ class FirebaseApi with logger.Logging { } String generateNonce([int length = 32]) { - final charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._'; + const charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._'; final random = math.Random.secure(); return List.generate(length, (_) => charset[random.nextInt(charset.length)]).join(); } @@ -130,7 +130,7 @@ class FirebaseApi with logger.Logging { } Future> signInWithApple() async { - Map userData = Map(); + Map userData = {}; // To prevent replay attacks with the credential returned from Apple, we // include a nonce in the credential request. When signing in with @@ -163,7 +163,7 @@ class FirebaseApi with logger.Logging { throw Exception(e); } Cache().firebaseUid = userCredential.user!.uid; - log("userCredential: " + userCredential.toString()); + log("userCredential: $userCredential"); log("Apple Credentials: ${appleCredential.userIdentifier} state ${appleCredential.state} email ${userCredential.user!.email!}"); userData['email'] = userCredential.user!.email; @@ -212,16 +212,16 @@ class FirebaseApi with logger.Logging { Map userData = Map(); // Trigger the authentication flow - GoogleSignIn _googleSignIn = GoogleSignIn( + GoogleSignIn googleSignIn = GoogleSignIn( scopes: [ 'email', 'https://www.googleapis.com/auth/contacts.readonly', ], ); - final GoogleSignInAccount? googleUser = await _googleSignIn.signIn(); + final GoogleSignInAccount? googleUser = await googleSignIn.signIn(); if (googleUser == null) { - Sentry.captureException(new Exception("Google Sign In failed")); + Sentry.captureException(Exception("Google Sign In failed")); throw Exception("Google Sign In failed"); } @@ -237,7 +237,7 @@ class FirebaseApi with logger.Logging { UserCredential userCredential = await FirebaseAuth.instance.signInWithCredential(credential); Cache().firebaseUid = userCredential.user!.uid; - log("GoogleUser: " + googleUser.toString()); + log("GoogleUser: $googleUser"); userData['email'] = googleUser.email; userData['id'] = googleUser.id; userData['name'] = googleUser.displayName; @@ -249,16 +249,16 @@ class FirebaseApi with logger.Logging { Map userData = Map(); // Trigger the authentication flow - GoogleSignIn _googleSignIn = GoogleSignIn( + GoogleSignIn googleSignIn = GoogleSignIn( scopes: [ 'email', 'https://www.googleapis.com/auth/contacts.readonly', ], ); - final GoogleSignInAccount? googleUser = await _googleSignIn.signIn(); + final GoogleSignInAccount? googleUser = await googleSignIn.signIn(); if (googleUser == null) { - Sentry.captureException(new Exception("Google Sign In failed")); + Sentry.captureException(Exception("Google Sign In failed")); throw Exception("Google Sign In failed"); } @@ -273,7 +273,7 @@ class FirebaseApi with logger.Logging { final userCredential = await FirebaseAuth.instance.signInWithCredential(credential); - log("Google credentials: " + credential.toString() + " GoogleUser: " + googleUser.toString()); + log("Google credentials: $credential GoogleUser: $googleUser"); Cache().firebaseUid = userCredential.user!.uid; userData['email'] = googleUser.email; @@ -295,7 +295,7 @@ class FirebaseApi with logger.Logging { Cache().firebaseUid = userData['id']; log(userData.toString()); } else { - Sentry.captureException(new Exception(result.message)); + Sentry.captureException(Exception(result.message)); throw Exception("Facebook login was not successful"); } @@ -312,7 +312,7 @@ class FirebaseApi with logger.Logging { Cache().accessTokenFacebook = accessToken; // get the user data userData = await FacebookAuth.instance.getUserData(); - log("FB user data: " + userData.toString()); + log("FB user data: $userData"); // Create a credential from the access token final OAuthCredential facebookAuthCredential = FacebookAuthProvider.credential(accessToken.token); @@ -323,7 +323,7 @@ class FirebaseApi with logger.Logging { Cache().firebaseUid = userCredential.user!.uid; } else { - Sentry.captureException(new Exception(result.message)); + Sentry.captureException(Exception(result.message)); throw Exception("Facebook login was not successful"); } @@ -356,7 +356,7 @@ class FirebaseApi with logger.Logging { //RemoteConfigValue(null, ValueSource.valueStatic); //Cache().setRemoteConfig(remoteConfig); } on Exception catch (e) { - print('Unable to fetch remote config. Cached or default values will be used: $e'); + log('Unable to fetch remote config. Cached or default values will be used: $e'); if (remoteConfig != null) { await remoteConfig.setDefaults({ 'sales_page_text_a': '', @@ -375,29 +375,3 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { // make sure you call `initializeApp` before using other Firebase services. print('Handling a background message ${message.messageId}'); } - -/* Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { - print('Handling a background message: ${message.messageId}'); - - if (!StringUtils.isNullOrEmpty(message.notification?.title, considerWhiteSpaceAsEmpty: true) || - !StringUtils.isNullOrEmpty(message.notification?.body, considerWhiteSpaceAsEmpty: true)) { - print('message also contained a notification: ${message.notification}'); - - String? imageUrl; - imageUrl ??= message.notification!.android?.imageUrl; - imageUrl ??= message.notification!.apple?.imageUrl; - - Map notificationAdapter = { - NOTIFICATION_CHANNEL_KEY: 'basic_channel', - NOTIFICATION_ID: message.data[NOTIFICATION_CONTENT]?[NOTIFICATION_ID] ?? message.messageId ?? math.Random().nextInt(2147483647), - NOTIFICATION_TITLE: message.data[NOTIFICATION_CONTENT]?[NOTIFICATION_TITLE] ?? message.notification?.title, - NOTIFICATION_BODY: message.data[NOTIFICATION_CONTENT]?[NOTIFICATION_BODY] ?? message.notification?.body, - NOTIFICATION_LAYOUT: StringUtils.isNullOrEmpty(imageUrl) ? 'Default' : 'BigPicture', - NOTIFICATION_BIG_PICTURE: imageUrl - }; - - AwesomeNotifications().createNotificationFromJsonData(notificationAdapter); - } else { - AwesomeNotifications().createNotificationFromJsonData(message.data); - } -} */ diff --git a/lib/service/package_service.dart b/lib/service/package_service.dart index 1e09641..9aee85c 100644 --- a/lib/service/package_service.dart +++ b/lib/service/package_service.dart @@ -36,11 +36,11 @@ class PackageApi { Future getPackage() async { late List exerciseTree; late List exerciseTreeParents; - final body = await _client.get("app_package/", ""); + final body = await _client.get("app_package", ""); final List models = body.split("|||"); await Future.forEach(models, (elem) async { - final String element = elem as String; + final String element = elem; final List headRecord = element.split("***"); final Iterable json = jsonDecode(headRecord[1]); if (headRecord[0] == "ExerciseDevice") { @@ -57,7 +57,7 @@ class PackageApi { } else if (headRecord[0] == "ExerciseType") { final List exerciseTypes = json.map((exerciseType) => ExerciseType.fromJson(exerciseType)).toList(); await Future.forEach(exerciseTypes, (elem) async { - final ExerciseType exerciseType = elem as ExerciseType; + final ExerciseType exerciseType = elem; exerciseType.imageUrl = await ExerciseTypeApi().buildImage(exerciseType.imageUrl, exerciseType.exerciseTypeId); }); Cache().setExerciseTypes(exerciseTypes); @@ -81,48 +81,48 @@ class PackageApi { Cache().setTutorials(tutorials); } else if (headRecord[0] == "Description") { final Iterable json = jsonDecode(headRecord[1]); - final List? descriptions = json.map((description) => Description.fromJson(description)).toList(); + final List descriptions = json.map((description) => Description.fromJson(description)).toList(); //print("Description: $descriptions"); Cache().setDescriptions(descriptions); } else if (headRecord[0] == "Faq") { final Iterable json = jsonDecode(headRecord[1]); - final List? faqs = json.map((faq) => Faq.fromJson(faq)).toList(); + final List faqs = json.map((faq) => Faq.fromJson(faq)).toList(); //print("Faq: $faqs"); Cache().setFaqs(faqs); } else if (headRecord[0] == "TrainingPlan") { final Iterable json = jsonDecode(headRecord[1]); - final List? plans = json.map((plan) => TrainingPlan.fromJson(plan)).toList(); + final List plans = json.map((plan) => TrainingPlan.fromJson(plan)).toList(); List activePlans = []; - if (plans != null) { - plans.forEach((element) { - if (element.active) { - activePlans.add(element); - } - }); + + for (var element in plans) { + if (element.active) { + activePlans.add(element); + } } + Cache().setTrainingPlans(activePlans); } else if (headRecord[0] == "SplitTests") { final Iterable json = jsonDecode(headRecord[1]); - final List? tests = json.map((test) => SplitTest.fromJson(test)).toList(); + final List tests = json.map((test) => SplitTest.fromJson(test)).toList(); //print("A/B tests: $tests"); Cache().setSplitTests(tests); } else if (headRecord[0] == "TrainingPlanDay") { final Iterable json = jsonDecode(headRecord[1]); - final List? days = json.map((day) => TrainingPlanDay.fromJson(day)).toList(); + final List days = json.map((day) => TrainingPlanDay.fromJson(day)).toList(); Cache().setTrainingPlanDays(days); } }); - exerciseTree = this.getExerciseTreeParents(exerciseTree, exerciseTreeParents); + exerciseTree = getExerciseTreeParents(exerciseTree, exerciseTreeParents); await Future.forEach(exerciseTree, (element) async { - ExerciseTree tree = element as ExerciseTree; + ExerciseTree tree = element; tree.imageUrl = await ExerciseTreeApi().buildImage(tree.imageUrl, tree.treeId); }); Cache().setExerciseTree(exerciseTree); - TrainingPlanDayRepository trainingPlanDayRepository = TrainingPlanDayRepository(); + TrainingPlanDayRepository trainingPlanDayRepository = const TrainingPlanDayRepository(); trainingPlanDayRepository.assignTrainingPlanDays(); return; @@ -158,11 +158,11 @@ class PackageApi { Future getCustomerPackage(int customerId) async { try { - final body = await _client.get("app_customer_package/" + customerId.toString(), ""); + final body = await _client.get("app_customer_package/$customerId", ""); final List models = body.split("|||"); await Future.forEach(models, (elem) async { - final String element = elem as String; + final String element = elem; final List headRecord = element.split("***"); //print("Class " + headRecord[0]); if (headRecord[0] == "Customer") { diff --git a/lib/service/product_service.dart b/lib/service/product_service.dart index 1ebb44e..69337a6 100644 --- a/lib/service/product_service.dart +++ b/lib/service/product_service.dart @@ -8,7 +8,7 @@ class ProductApi { final APIClient _client = APIClient(); Future> getProducts() async { - final body = await _client.get("product/", ""); + final body = await _client.get("product", ""); final Iterable json = jsonDecode(body); final List products = json.map((product) => Product.fromJson(product)).toList(); Cache().setProducts(products); diff --git a/lib/service/property_service.dart b/lib/service/property_service.dart index 4950982..12bf226 100644 --- a/lib/service/property_service.dart +++ b/lib/service/property_service.dart @@ -2,14 +2,13 @@ import 'dart:convert'; import 'package:workouttest_util/model/cache.dart'; import 'package:workouttest_util/service/api.dart'; - import 'package:workouttest_util/model/property.dart'; class PropertyApi { final APIClient _client = APIClient(); Future> getProperties() async { - final body = await _client.get("property/", ""); + final body = await _client.get("property", ""); final Iterable json = jsonDecode(body); final List properties = json.map((property) => Property.fromJson(property)).toList(); Cache().setProperties(properties); diff --git a/lib/service/purchase_service.dart b/lib/service/purchase_service.dart index d52ede5..425f614 100644 --- a/lib/service/purchase_service.dart +++ b/lib/service/purchase_service.dart @@ -11,7 +11,7 @@ class PurchaseApi with Logging { Future> getPurchasesByCustomer(int customerId) async { List purchases = []; try { - final body = await _client.get("purchase/customer/" + customerId.toString(), ""); + final body = await _client.get("purchase/customer/$customerId", ""); final Iterable json = jsonDecode(body); final List purchases = json.map((purchase) => Purchase.fromJson(purchase)).toList(); Cache().setPurchases(purchases); @@ -23,7 +23,7 @@ class PurchaseApi with Logging { Future savePurchase(Purchase purchase) async { String body = JsonEncoder().convert(purchase.toJson()); - log(" ===== saving purchase:" + body); - await _client.post("purchase/", body); + log(" ===== saving purchase:$body"); + await _client.post("purchase", body); } } diff --git a/lib/service/tracking_service.dart b/lib/service/tracking_service.dart index aa00564..9b2fc62 100644 --- a/lib/service/tracking_service.dart +++ b/lib/service/tracking_service.dart @@ -10,7 +10,7 @@ class TrackingApi with Logging { try { String body = const JsonEncoder().convert(tracking.toJson()); log(" ===== saving tracking: $body"); - await _client.post("tracking/", body); + await _client.post("tracking", body); } catch (exception) { log("exception in tracking: ${exception.toString()}"); } diff --git a/lib/service/training_plan_service.dart b/lib/service/training_plan_service.dart index e2823f2..65e276b 100644 --- a/lib/service/training_plan_service.dart +++ b/lib/service/training_plan_service.dart @@ -9,24 +9,24 @@ class TrainingPlanApi with Logging { final APIClient _client = APIClient(); Future saveCustomerTrainingPlan(CustomerTrainingPlan plan) async { - String body = JsonEncoder().convert(plan.toJson()); - log(" ===== saving customer training plan:" + body); - final String response = await _client.post("customer_training_plan/", body); + String body = const JsonEncoder().convert(plan.toJson()); + log(" ===== saving customer training plan:$body"); + final String response = await _client.post("customer_training_plan", body); final CustomerTrainingPlan saved = CustomerTrainingPlan.fromJson(jsonDecode(response)); return saved; } Future saveCustomerTrainingPlanExercise(CustomerTrainingPlanExercise planExercise) async { - String body = JsonEncoder().convert(planExercise.toJson()); - log(" ===== saving customer training plan exercise:" + body); - final String response = await _client.post("customer_training_plan_exercise/", body); + String body = const JsonEncoder().convert(planExercise.toJson()); + log(" ===== saving customer training plan exercise:$body"); + final String response = await _client.post("customer_training_plan_exercise", body); final CustomerTrainingPlanExercise saved = CustomerTrainingPlanExercise.fromJson(jsonDecode(response)); return saved; } Future updateCustomerTrainingPlan(CustomerTrainingPlan plan, int customerTrainingPlanId) async { - String body = JsonEncoder().convert(plan.toJson()); - log(" ===== update customer training plan:" + body); + String body = const JsonEncoder().convert(plan.toJson()); + log(" ===== update customer training plan:$body"); final String response = await _client.post("customer_training_plan/update/$customerTrainingPlanId", body); final CustomerTrainingPlan saved = CustomerTrainingPlan.fromJson(jsonDecode(response)); return saved; diff --git a/lib/util/common.dart b/lib/util/common.dart index 8fc3dfd..5fd0722 100644 --- a/lib/util/common.dart +++ b/lib/util/common.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:workouttest_util/util/app_language.dart'; import 'package:flutter/material.dart'; +// ignore: depend_on_referenced_packages import 'package:intl/intl.dart'; class DateRate { @@ -11,7 +12,7 @@ class DateRate { static String yearly = "yearly"; } -mixin Common { +mixin Common{ final emailError = "Please type a right email address here."; final passwordError = "The password must have at least 8 characters."; @@ -29,7 +30,7 @@ mixin Common { String dateName = DateFormat(DateFormat.YEAR_NUM_MONTH_DAY, AppLanguage().appLocal.toString()).format(date.toUtc()); if (timeDisplay) { - dateName += " " + DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc()); + dateName += " ${DateFormat(DateFormat.HOUR_MINUTE, AppLanguage().appLocal.toString()).format(date.toUtc())}"; } return dateName; @@ -51,7 +52,7 @@ mixin Common { } static String? emailValidation(String? email) { - final String error = "Please type an email address"; + const String error = "Please type an email address"; if (email == null) { return error; } @@ -60,8 +61,8 @@ mixin Common { } static String? passwordValidation(String? value) { - final String error = "Password too short"; - if (value == null || value.length == 0) { + const String error = "Password too short"; + if (value == null || value.isEmpty) { return error; } bool valid = 8 < value.length; diff --git a/pubspec.yaml b/pubspec.yaml index dda66ca..3a729f8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: workouttest_util description: Workout Test app and web functions. -version: 1.0.0 +version: 1.0.1 homepage: environment: