diff --git a/analysis_options.yaml b/analysis_options.yaml index 0d29021..c4d2cef 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,28 +1,19 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + sort_pub_dependencies: false + prefer_relative_imports: true -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options +analyzer: + errors: + missing_required_param: error + missing_return: error + must_be_immutable: error + sort_unnamed_constructors_first: ignore + invalid_annotation_target: ignore + use_build_context_synchronously: ignore + exclude: + - test/generated/** + - "**/**.g.dart" + - "**/**.freezed.dart" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 204476c..8ccc061 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:icon="@mipmap/launcher_icon"> + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/launcher_icon.png b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png new file mode 100644 index 0000000..bba5c1e Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/launcher_icon.png b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png new file mode 100644 index 0000000..6afb640 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png new file mode 100644 index 0000000..6c8394e Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png new file mode 100644 index 0000000..7e4d63b Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png new file mode 100644 index 0000000..483f22e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png differ diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..ab98328 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,4 @@ + + + #ffffff + \ No newline at end of file diff --git a/assets/fonts/quicksand/Quicksand-Bold.ttf b/assets/fonts/quicksand/Quicksand-Bold.ttf new file mode 100644 index 0000000..0106805 Binary files /dev/null and b/assets/fonts/quicksand/Quicksand-Bold.ttf differ diff --git a/assets/fonts/quicksand/Quicksand-Light.ttf b/assets/fonts/quicksand/Quicksand-Light.ttf new file mode 100644 index 0000000..fcf86af Binary files /dev/null and b/assets/fonts/quicksand/Quicksand-Light.ttf differ diff --git a/assets/fonts/quicksand/Quicksand-Medium.ttf b/assets/fonts/quicksand/Quicksand-Medium.ttf new file mode 100644 index 0000000..afca2d9 Binary files /dev/null and b/assets/fonts/quicksand/Quicksand-Medium.ttf differ diff --git a/assets/fonts/quicksand/Quicksand-Regular.ttf b/assets/fonts/quicksand/Quicksand-Regular.ttf new file mode 100644 index 0000000..c03548a Binary files /dev/null and b/assets/fonts/quicksand/Quicksand-Regular.ttf differ diff --git a/assets/fonts/quicksand/Quicksand-SemiBold.ttf b/assets/fonts/quicksand/Quicksand-SemiBold.ttf new file mode 100644 index 0000000..83475ea Binary files /dev/null and b/assets/fonts/quicksand/Quicksand-SemiBold.ttf differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..93f2c08 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..e549ee2 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index edcd653..e17b8a2 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -427,7 +427,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -484,7 +484,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fa..d0d98aa 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} +{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png index dc9ada4..1db7ead 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 7353c41..8e144ce 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 797d452..6316890 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index 6ed2d93..aae451f 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cd7b00..3cb23a6 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index fe73094..2dcd41a 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index 321773c..4f6198a 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 797d452..6316890 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 502f463..a98c5fd 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index 0ec3034..03ff2ff 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png new file mode 100644 index 0000000..b6525a6 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png new file mode 100644 index 0000000..125c04b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..023043b Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..c9b2d52 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 0ec3034..03ff2ff 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index e9f5fea..2363ed4 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png new file mode 100644 index 0000000..92dc668 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png new file mode 100644 index 0000000..2407101 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 84ac32a..31bac3f 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 8953cba..095f3f0 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index 0467bf1..7b22e10 100644 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/launcher_icon.yaml b/launcher_icon.yaml new file mode 100644 index 0000000..45742ec --- /dev/null +++ b/launcher_icon.yaml @@ -0,0 +1,17 @@ +# Generate: dart run flutter_launcher_icons -f launcher_icon.yaml + +flutter_launcher_icons: + android: "launcher_icon" + ios: true + image_path: "assets/images/logo.png" + remove_alpha_ios: true + min_sdk_android: 21 # android min sdk min:16, default 21 + adaptive_icon_background: "#ffffff" + adaptive_icon_foreground: "assets/images/logo.png" + web: + generate: true + image_path: "assets/images/logo.png" + windows: + generate: true + image_path: "assets/images/logo.png" + icon_size: 48 diff --git a/lib/common/api/api_client.dart b/lib/common/api/api_client.dart new file mode 100644 index 0000000..ca71634 --- /dev/null +++ b/lib/common/api/api_client.dart @@ -0,0 +1,238 @@ +import 'package:awesome_dio_interceptor/awesome_dio_interceptor.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/foundation.dart'; +import 'package:injectable/injectable.dart'; + +import '../../env.dart'; +import 'api_failure.dart'; +import 'errors/bad_network_error.dart'; +import 'errors/bad_request_error.dart'; +import 'errors/connection_timeout_error.dart'; +import 'errors/internal_server_error.dart'; +import 'errors/not_found_error.dart'; +import 'errors/unauthorized_error.dart'; +import 'interceptors/bad_network_interceptor.dart'; +import 'interceptors/bad_request_interceptor.dart'; +import 'interceptors/connection_timeout_interceptor.dart'; +import 'interceptors/internal_server_interceptor.dart'; +import 'interceptors/not_found_interceptor.dart'; +import 'interceptors/unauthorized_interceptor.dart'; + +@lazySingleton +class ApiClient { + final Dio _dio; + final Env _env; + + ApiClient(this._dio, this._env) { + _dio.options.baseUrl = _env.baseUrl; + _dio.options.connectTimeout = const Duration(seconds: 20); + _dio.interceptors.add(BadNetworkErrorInterceptor()); + _dio.interceptors.add(BadRequestErrorInterceptor()); + _dio.interceptors.add(InternalServerErrorInterceptor()); + _dio.interceptors.add(NotFoundErrorInterceptor()); + _dio.interceptors.add(UnauthorizedInterceptor()); + _dio.interceptors.add(ConnectionTimeoutErrorInterceptor()); + + if (kDebugMode) { + _dio.interceptors.add( + AwesomeDioInterceptor( + logResponseHeaders: false, + logRequestTimeout: false, + logRequestHeaders: true, + ), + ); + } + } + + Future post( + String path, { + dynamic data, + Map? headers, + Map? params, + bool followRedirects = true, + bool Function(int?)? validateStatus, + String? contentType, + }) async { + try { + return await _dio.post( + path, + data: data, + options: Options( + headers: headers, + followRedirects: followRedirects, + validateStatus: validateStatus, + contentType: contentType, + ), + queryParameters: params, + ); + } on UnauthorizedError catch (e) { + throw ApiFailure.unauthorized(e.messageError); + } on InternalServerError { + throw const ApiFailure.internalServerError(); + } on BadNetworkError { + throw const ApiFailure.connectionError(); + } on BadRequestError catch (e) { + throw ApiFailure.badRequest(e.messageError); + } on NotFoundError catch (e) { + throw ApiFailure.notFound(e.messageError); + } on ConnectionTimeoutError { + throw const ApiFailure.connectionTimeout(); + } on DioException catch (e) { + var errorMessage = + e.response?.data['message'] ?? e.response?.statusMessage ?? e.error; + + if (errorMessage.toString().contains('Connection reset')) { + errorMessage = 'Connection reset'; + } + + throw ApiFailure.serverError( + statusCode: e.response?.statusCode ?? 0, + errorMessage: errorMessage.toString(), + ); + } catch (e, s) { + throw ApiFailure.unexpectedError(errorMessage: e, stackTrace: s); + } + } + + Future get( + String path, { + Map? headers, + Map? params, + bool followRedirects = true, + bool Function(int?)? validateStatus, + String? contentType, + }) async { + try { + return await _dio.get( + path, + options: Options( + headers: headers, + followRedirects: followRedirects, + validateStatus: validateStatus, + contentType: contentType, + ), + queryParameters: params, + ); + } on UnauthorizedError catch (e) { + throw ApiFailure.unauthorized(e.messageError); + } on InternalServerError { + throw const ApiFailure.internalServerError(); + } on BadNetworkError { + throw const ApiFailure.connectionError(); + } on BadRequestError catch (e) { + throw ApiFailure.badRequest(e.messageError); + } on NotFoundError catch (e) { + throw ApiFailure.notFound(e.messageError); + } on ConnectionTimeoutError { + throw const ApiFailure.connectionTimeout(); + } on DioException catch (e) { + var errorMessage = + e.response?.data['message'] ?? e.response?.statusMessage ?? e.error; + + if (errorMessage.toString().contains('Connection reset')) { + errorMessage = 'Connection reset'; + } + + throw ApiFailure.serverError( + statusCode: e.response?.statusCode ?? 0, + errorMessage: errorMessage.toString(), + ); + } catch (e, s) { + throw ApiFailure.unexpectedError(errorMessage: e, stackTrace: s); + } + } + + Future put( + String path, { + dynamic data, + Map? headers, + Map? params, + bool followRedirects = true, + bool Function(int?)? validateStatus, + String? contentType, + void Function(int count, int total)? onSendProgress, + }) async { + try { + return await _dio.put( + path, + data: data, + options: Options( + headers: headers, + followRedirects: followRedirects, + validateStatus: validateStatus, + contentType: contentType, + ), + queryParameters: params, + onSendProgress: onSendProgress, + ); + } on UnauthorizedError catch (e) { + throw ApiFailure.unauthorized(e.messageError); + } on InternalServerError { + throw const ApiFailure.internalServerError(); + } on BadNetworkError { + throw const ApiFailure.connectionError(); + } on BadRequestError catch (e) { + throw ApiFailure.badRequest(e.messageError); + } on NotFoundError catch (e) { + throw ApiFailure.notFound(e.messageError); + } on ConnectionTimeoutError { + throw const ApiFailure.connectionTimeout(); + } on DioException catch (e) { + var errorMessage = + e.response?.data['message'] ?? e.response?.statusMessage ?? e.error; + + if (errorMessage.toString().contains('Connection reset')) { + errorMessage = 'Connection reset'; + } + + throw ApiFailure.serverError( + statusCode: e.response?.statusCode ?? 0, + errorMessage: errorMessage.toString(), + ); + } catch (e, s) { + throw ApiFailure.unexpectedError(errorMessage: e, stackTrace: s); + } + } + + Future delete( + String path, { + dynamic data, + Map? headers, + Map? params, + bool followRedirects = true, + bool Function(int?)? validateStatus, + String? contentType, + }) async { + try { + return await _dio.delete( + path, + data: data, + options: Options( + headers: headers, + followRedirects: followRedirects, + validateStatus: validateStatus, + contentType: contentType, + ), + queryParameters: params, + ); + } on UnauthorizedError catch (e) { + throw ApiFailure.unauthorized(e.messageError); + } on InternalServerError { + throw const ApiFailure.internalServerError(); + } on BadNetworkError { + throw const ApiFailure.connectionError(); + } on BadRequestError catch (e) { + throw ApiFailure.badRequest(e.messageError); + } on NotFoundError catch (e) { + throw ApiFailure.notFound(e.messageError); + } on DioException catch (e) { + throw ApiFailure.serverError( + statusCode: e.response?.statusCode ?? 0, + errorMessage: + e.response?.data['message'] ?? e.response?.statusMessage ?? e.error, + ); + } catch (e, s) { + throw ApiFailure.unexpectedError(errorMessage: e, stackTrace: s); + } + } +} diff --git a/lib/common/api/api_failure.dart b/lib/common/api/api_failure.dart new file mode 100644 index 0000000..bcfbd28 --- /dev/null +++ b/lib/common/api/api_failure.dart @@ -0,0 +1,58 @@ +import 'package:flutter/material.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'api_failure.freezed.dart'; + +@freezed +sealed class ApiFailure with _$ApiFailure { + const ApiFailure._(); + + const factory ApiFailure.serverError({ + required int statusCode, + required Object errorMessage, + }) = _ServerError; + + const factory ApiFailure.unexpectedError({ + required Object errorMessage, + required StackTrace stackTrace, + }) = _UnexpectedError; + + const factory ApiFailure.connectionError() = _ConnectionError; + + const factory ApiFailure.internalServerError() = _InternalServerError; + + const factory ApiFailure.unauthorized(String? message) = _Unauthorized; + + const factory ApiFailure.badRequest(String? message) = _BadRequest; + + const factory ApiFailure.notFound(String? message) = _NotFound; + + const factory ApiFailure.connectionTimeout() = _ConnectionTimeout; + + String toStringFormatted( + BuildContext context, { + String? unauthorizedMessage, + }) { + return switch (this) { + _ServerError(:final statusCode, :final errorMessage) => + 'There is a problem with the server. Status code: $statusCode Error: $errorMessage', + + _UnexpectedError() => 'An error occurred. Please try again later.', + + _ConnectionError() => 'No Internet', + + _InternalServerError() => + 'The server is experiencing problems. Please try again later.', + + _Unauthorized(:final message) => + message ?? unauthorizedMessage ?? 'Session has expired.', + + _BadRequest(:final message) => + message ?? 'There is an incorrect entry. Please check again', + + _NotFound(:final message) => message ?? 'Not Found', + + _ConnectionTimeout() => 'Connection Timeout', + }; + } +} diff --git a/lib/common/api/api_failure.freezed.dart b/lib/common/api/api_failure.freezed.dart new file mode 100644 index 0000000..aac5bd3 --- /dev/null +++ b/lib/common/api/api_failure.freezed.dart @@ -0,0 +1,1506 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// 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 'api_failure.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models', +); + +/// @nodoc +mixin _$ApiFailure { + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) => throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ApiFailureCopyWith<$Res> { + factory $ApiFailureCopyWith( + ApiFailure value, + $Res Function(ApiFailure) then, + ) = _$ApiFailureCopyWithImpl<$Res, ApiFailure>; +} + +/// @nodoc +class _$ApiFailureCopyWithImpl<$Res, $Val extends ApiFailure> + implements $ApiFailureCopyWith<$Res> { + _$ApiFailureCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc +abstract class _$$ServerErrorImplCopyWith<$Res> { + factory _$$ServerErrorImplCopyWith( + _$ServerErrorImpl value, + $Res Function(_$ServerErrorImpl) then, + ) = __$$ServerErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({int statusCode, Object errorMessage}); +} + +/// @nodoc +class __$$ServerErrorImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$ServerErrorImpl> + implements _$$ServerErrorImplCopyWith<$Res> { + __$$ServerErrorImplCopyWithImpl( + _$ServerErrorImpl _value, + $Res Function(_$ServerErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? statusCode = null, Object? errorMessage = null}) { + return _then( + _$ServerErrorImpl( + statusCode: null == statusCode + ? _value.statusCode + : statusCode // ignore: cast_nullable_to_non_nullable + as int, + errorMessage: null == errorMessage ? _value.errorMessage : errorMessage, + ), + ); + } +} + +/// @nodoc + +class _$ServerErrorImpl extends _ServerError { + const _$ServerErrorImpl({ + required this.statusCode, + required this.errorMessage, + }) : super._(); + + @override + final int statusCode; + @override + final Object errorMessage; + + @override + String toString() { + return 'ApiFailure.serverError(statusCode: $statusCode, errorMessage: $errorMessage)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ServerErrorImpl && + (identical(other.statusCode, statusCode) || + other.statusCode == statusCode) && + const DeepCollectionEquality().equals( + other.errorMessage, + errorMessage, + )); + } + + @override + int get hashCode => Object.hash( + runtimeType, + statusCode, + const DeepCollectionEquality().hash(errorMessage), + ); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith => + __$$ServerErrorImplCopyWithImpl<_$ServerErrorImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return serverError(statusCode, errorMessage); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return serverError?.call(statusCode, errorMessage); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(statusCode, errorMessage); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return serverError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return serverError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (serverError != null) { + return serverError(this); + } + return orElse(); + } +} + +abstract class _ServerError extends ApiFailure { + const factory _ServerError({ + required final int statusCode, + required final Object errorMessage, + }) = _$ServerErrorImpl; + const _ServerError._() : super._(); + + int get statusCode; + Object get errorMessage; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$UnexpectedErrorImplCopyWith<$Res> { + factory _$$UnexpectedErrorImplCopyWith( + _$UnexpectedErrorImpl value, + $Res Function(_$UnexpectedErrorImpl) then, + ) = __$$UnexpectedErrorImplCopyWithImpl<$Res>; + @useResult + $Res call({Object errorMessage, StackTrace stackTrace}); +} + +/// @nodoc +class __$$UnexpectedErrorImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$UnexpectedErrorImpl> + implements _$$UnexpectedErrorImplCopyWith<$Res> { + __$$UnexpectedErrorImplCopyWithImpl( + _$UnexpectedErrorImpl _value, + $Res Function(_$UnexpectedErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? errorMessage = null, Object? stackTrace = null}) { + return _then( + _$UnexpectedErrorImpl( + errorMessage: null == errorMessage ? _value.errorMessage : errorMessage, + stackTrace: null == stackTrace + ? _value.stackTrace + : stackTrace // ignore: cast_nullable_to_non_nullable + as StackTrace, + ), + ); + } +} + +/// @nodoc + +class _$UnexpectedErrorImpl extends _UnexpectedError { + const _$UnexpectedErrorImpl({ + required this.errorMessage, + required this.stackTrace, + }) : super._(); + + @override + final Object errorMessage; + @override + final StackTrace stackTrace; + + @override + String toString() { + return 'ApiFailure.unexpectedError(errorMessage: $errorMessage, stackTrace: $stackTrace)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$UnexpectedErrorImpl && + const DeepCollectionEquality().equals( + other.errorMessage, + errorMessage, + ) && + (identical(other.stackTrace, stackTrace) || + other.stackTrace == stackTrace)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(errorMessage), + stackTrace, + ); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$UnexpectedErrorImplCopyWith<_$UnexpectedErrorImpl> get copyWith => + __$$UnexpectedErrorImplCopyWithImpl<_$UnexpectedErrorImpl>( + this, + _$identity, + ); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return unexpectedError(errorMessage, stackTrace); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return unexpectedError?.call(errorMessage, stackTrace); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (unexpectedError != null) { + return unexpectedError(errorMessage, stackTrace); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return unexpectedError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return unexpectedError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (unexpectedError != null) { + return unexpectedError(this); + } + return orElse(); + } +} + +abstract class _UnexpectedError extends ApiFailure { + const factory _UnexpectedError({ + required final Object errorMessage, + required final StackTrace stackTrace, + }) = _$UnexpectedErrorImpl; + const _UnexpectedError._() : super._(); + + Object get errorMessage; + StackTrace get stackTrace; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$UnexpectedErrorImplCopyWith<_$UnexpectedErrorImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ConnectionErrorImplCopyWith<$Res> { + factory _$$ConnectionErrorImplCopyWith( + _$ConnectionErrorImpl value, + $Res Function(_$ConnectionErrorImpl) then, + ) = __$$ConnectionErrorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ConnectionErrorImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$ConnectionErrorImpl> + implements _$$ConnectionErrorImplCopyWith<$Res> { + __$$ConnectionErrorImplCopyWithImpl( + _$ConnectionErrorImpl _value, + $Res Function(_$ConnectionErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$ConnectionErrorImpl extends _ConnectionError { + const _$ConnectionErrorImpl() : super._(); + + @override + String toString() { + return 'ApiFailure.connectionError()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ConnectionErrorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return connectionError(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return connectionError?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (connectionError != null) { + return connectionError(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return connectionError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return connectionError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (connectionError != null) { + return connectionError(this); + } + return orElse(); + } +} + +abstract class _ConnectionError extends ApiFailure { + const factory _ConnectionError() = _$ConnectionErrorImpl; + const _ConnectionError._() : super._(); +} + +/// @nodoc +abstract class _$$InternalServerErrorImplCopyWith<$Res> { + factory _$$InternalServerErrorImplCopyWith( + _$InternalServerErrorImpl value, + $Res Function(_$InternalServerErrorImpl) then, + ) = __$$InternalServerErrorImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$InternalServerErrorImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$InternalServerErrorImpl> + implements _$$InternalServerErrorImplCopyWith<$Res> { + __$$InternalServerErrorImplCopyWithImpl( + _$InternalServerErrorImpl _value, + $Res Function(_$InternalServerErrorImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$InternalServerErrorImpl extends _InternalServerError { + const _$InternalServerErrorImpl() : super._(); + + @override + String toString() { + return 'ApiFailure.internalServerError()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$InternalServerErrorImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return internalServerError(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return internalServerError?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (internalServerError != null) { + return internalServerError(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return internalServerError(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return internalServerError?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (internalServerError != null) { + return internalServerError(this); + } + return orElse(); + } +} + +abstract class _InternalServerError extends ApiFailure { + const factory _InternalServerError() = _$InternalServerErrorImpl; + const _InternalServerError._() : super._(); +} + +/// @nodoc +abstract class _$$UnauthorizedImplCopyWith<$Res> { + factory _$$UnauthorizedImplCopyWith( + _$UnauthorizedImpl value, + $Res Function(_$UnauthorizedImpl) then, + ) = __$$UnauthorizedImplCopyWithImpl<$Res>; + @useResult + $Res call({String? message}); +} + +/// @nodoc +class __$$UnauthorizedImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$UnauthorizedImpl> + implements _$$UnauthorizedImplCopyWith<$Res> { + __$$UnauthorizedImplCopyWithImpl( + _$UnauthorizedImpl _value, + $Res Function(_$UnauthorizedImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? message = freezed}) { + return _then( + _$UnauthorizedImpl( + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } +} + +/// @nodoc + +class _$UnauthorizedImpl extends _Unauthorized { + const _$UnauthorizedImpl(this.message) : super._(); + + @override + final String? message; + + @override + String toString() { + return 'ApiFailure.unauthorized(message: $message)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$UnauthorizedImpl && + (identical(other.message, message) || other.message == message)); + } + + @override + int get hashCode => Object.hash(runtimeType, message); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$UnauthorizedImplCopyWith<_$UnauthorizedImpl> get copyWith => + __$$UnauthorizedImplCopyWithImpl<_$UnauthorizedImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return unauthorized(message); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return unauthorized?.call(message); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (unauthorized != null) { + return unauthorized(message); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return unauthorized(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return unauthorized?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (unauthorized != null) { + return unauthorized(this); + } + return orElse(); + } +} + +abstract class _Unauthorized extends ApiFailure { + const factory _Unauthorized(final String? message) = _$UnauthorizedImpl; + const _Unauthorized._() : super._(); + + String? get message; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$UnauthorizedImplCopyWith<_$UnauthorizedImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$BadRequestImplCopyWith<$Res> { + factory _$$BadRequestImplCopyWith( + _$BadRequestImpl value, + $Res Function(_$BadRequestImpl) then, + ) = __$$BadRequestImplCopyWithImpl<$Res>; + @useResult + $Res call({String? message}); +} + +/// @nodoc +class __$$BadRequestImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$BadRequestImpl> + implements _$$BadRequestImplCopyWith<$Res> { + __$$BadRequestImplCopyWithImpl( + _$BadRequestImpl _value, + $Res Function(_$BadRequestImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? message = freezed}) { + return _then( + _$BadRequestImpl( + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } +} + +/// @nodoc + +class _$BadRequestImpl extends _BadRequest { + const _$BadRequestImpl(this.message) : super._(); + + @override + final String? message; + + @override + String toString() { + return 'ApiFailure.badRequest(message: $message)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$BadRequestImpl && + (identical(other.message, message) || other.message == message)); + } + + @override + int get hashCode => Object.hash(runtimeType, message); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$BadRequestImplCopyWith<_$BadRequestImpl> get copyWith => + __$$BadRequestImplCopyWithImpl<_$BadRequestImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return badRequest(message); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return badRequest?.call(message); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (badRequest != null) { + return badRequest(message); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return badRequest(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return badRequest?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (badRequest != null) { + return badRequest(this); + } + return orElse(); + } +} + +abstract class _BadRequest extends ApiFailure { + const factory _BadRequest(final String? message) = _$BadRequestImpl; + const _BadRequest._() : super._(); + + String? get message; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$BadRequestImplCopyWith<_$BadRequestImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$NotFoundImplCopyWith<$Res> { + factory _$$NotFoundImplCopyWith( + _$NotFoundImpl value, + $Res Function(_$NotFoundImpl) then, + ) = __$$NotFoundImplCopyWithImpl<$Res>; + @useResult + $Res call({String? message}); +} + +/// @nodoc +class __$$NotFoundImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$NotFoundImpl> + implements _$$NotFoundImplCopyWith<$Res> { + __$$NotFoundImplCopyWithImpl( + _$NotFoundImpl _value, + $Res Function(_$NotFoundImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({Object? message = freezed}) { + return _then( + _$NotFoundImpl( + freezed == message + ? _value.message + : message // ignore: cast_nullable_to_non_nullable + as String?, + ), + ); + } +} + +/// @nodoc + +class _$NotFoundImpl extends _NotFound { + const _$NotFoundImpl(this.message) : super._(); + + @override + final String? message; + + @override + String toString() { + return 'ApiFailure.notFound(message: $message)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$NotFoundImpl && + (identical(other.message, message) || other.message == message)); + } + + @override + int get hashCode => Object.hash(runtimeType, message); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$NotFoundImplCopyWith<_$NotFoundImpl> get copyWith => + __$$NotFoundImplCopyWithImpl<_$NotFoundImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return notFound(message); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return notFound?.call(message); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (notFound != null) { + return notFound(message); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return notFound(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return notFound?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (notFound != null) { + return notFound(this); + } + return orElse(); + } +} + +abstract class _NotFound extends ApiFailure { + const factory _NotFound(final String? message) = _$NotFoundImpl; + const _NotFound._() : super._(); + + String? get message; + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NotFoundImplCopyWith<_$NotFoundImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$ConnectionTimeoutImplCopyWith<$Res> { + factory _$$ConnectionTimeoutImplCopyWith( + _$ConnectionTimeoutImpl value, + $Res Function(_$ConnectionTimeoutImpl) then, + ) = __$$ConnectionTimeoutImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$ConnectionTimeoutImplCopyWithImpl<$Res> + extends _$ApiFailureCopyWithImpl<$Res, _$ConnectionTimeoutImpl> + implements _$$ConnectionTimeoutImplCopyWith<$Res> { + __$$ConnectionTimeoutImplCopyWithImpl( + _$ConnectionTimeoutImpl _value, + $Res Function(_$ConnectionTimeoutImpl) _then, + ) : super(_value, _then); + + /// Create a copy of ApiFailure + /// with the given fields replaced by the non-null parameter values. +} + +/// @nodoc + +class _$ConnectionTimeoutImpl extends _ConnectionTimeout { + const _$ConnectionTimeoutImpl() : super._(); + + @override + String toString() { + return 'ApiFailure.connectionTimeout()'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$ConnectionTimeoutImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(int statusCode, Object errorMessage) serverError, + required TResult Function(Object errorMessage, StackTrace stackTrace) + unexpectedError, + required TResult Function() connectionError, + required TResult Function() internalServerError, + required TResult Function(String? message) unauthorized, + required TResult Function(String? message) badRequest, + required TResult Function(String? message) notFound, + required TResult Function() connectionTimeout, + }) { + return connectionTimeout(); + } + + @override + @optionalTypeArgs + TResult? whenOrNull({ + TResult? Function(int statusCode, Object errorMessage)? serverError, + TResult? Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult? Function()? connectionError, + TResult? Function()? internalServerError, + TResult? Function(String? message)? unauthorized, + TResult? Function(String? message)? badRequest, + TResult? Function(String? message)? notFound, + TResult? Function()? connectionTimeout, + }) { + return connectionTimeout?.call(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(int statusCode, Object errorMessage)? serverError, + TResult Function(Object errorMessage, StackTrace stackTrace)? + unexpectedError, + TResult Function()? connectionError, + TResult Function()? internalServerError, + TResult Function(String? message)? unauthorized, + TResult Function(String? message)? badRequest, + TResult Function(String? message)? notFound, + TResult Function()? connectionTimeout, + required TResult orElse(), + }) { + if (connectionTimeout != null) { + return connectionTimeout(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ServerError value) serverError, + required TResult Function(_UnexpectedError value) unexpectedError, + required TResult Function(_ConnectionError value) connectionError, + required TResult Function(_InternalServerError value) internalServerError, + required TResult Function(_Unauthorized value) unauthorized, + required TResult Function(_BadRequest value) badRequest, + required TResult Function(_NotFound value) notFound, + required TResult Function(_ConnectionTimeout value) connectionTimeout, + }) { + return connectionTimeout(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_ServerError value)? serverError, + TResult? Function(_UnexpectedError value)? unexpectedError, + TResult? Function(_ConnectionError value)? connectionError, + TResult? Function(_InternalServerError value)? internalServerError, + TResult? Function(_Unauthorized value)? unauthorized, + TResult? Function(_BadRequest value)? badRequest, + TResult? Function(_NotFound value)? notFound, + TResult? Function(_ConnectionTimeout value)? connectionTimeout, + }) { + return connectionTimeout?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ServerError value)? serverError, + TResult Function(_UnexpectedError value)? unexpectedError, + TResult Function(_ConnectionError value)? connectionError, + TResult Function(_InternalServerError value)? internalServerError, + TResult Function(_Unauthorized value)? unauthorized, + TResult Function(_BadRequest value)? badRequest, + TResult Function(_NotFound value)? notFound, + TResult Function(_ConnectionTimeout value)? connectionTimeout, + required TResult orElse(), + }) { + if (connectionTimeout != null) { + return connectionTimeout(this); + } + return orElse(); + } +} + +abstract class _ConnectionTimeout extends ApiFailure { + const factory _ConnectionTimeout() = _$ConnectionTimeoutImpl; + const _ConnectionTimeout._() : super._(); +} diff --git a/lib/common/api/errors/bad_network_error.dart b/lib/common/api/errors/bad_network_error.dart new file mode 100644 index 0000000..ef9bb82 --- /dev/null +++ b/lib/common/api/errors/bad_network_error.dart @@ -0,0 +1,15 @@ +import 'package:dio/dio.dart'; + +class BadNetworkError extends DioException { + final DioException dioError; + + BadNetworkError(this.dioError) + : super( + requestOptions: dioError.requestOptions, + error: dioError.error, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/errors/bad_request_error.dart b/lib/common/api/errors/bad_request_error.dart new file mode 100644 index 0000000..70660de --- /dev/null +++ b/lib/common/api/errors/bad_request_error.dart @@ -0,0 +1,16 @@ +import 'package:dio/dio.dart'; + +class BadRequestError extends DioException { + final DioException dioError; + final String? messageError; + + BadRequestError(this.dioError, this.messageError) + : super( + error: dioError.error, + requestOptions: dioError.requestOptions, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/errors/connection_timeout_error.dart b/lib/common/api/errors/connection_timeout_error.dart new file mode 100644 index 0000000..d7d1b12 --- /dev/null +++ b/lib/common/api/errors/connection_timeout_error.dart @@ -0,0 +1,15 @@ +import 'package:dio/dio.dart'; + +class ConnectionTimeoutError extends DioException { + final DioException dioError; + + ConnectionTimeoutError(this.dioError) + : super( + error: dioError.error, + requestOptions: dioError.requestOptions, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/errors/internal_server_error.dart b/lib/common/api/errors/internal_server_error.dart new file mode 100644 index 0000000..e94bcbf --- /dev/null +++ b/lib/common/api/errors/internal_server_error.dart @@ -0,0 +1,15 @@ + import 'package:dio/dio.dart'; + +class InternalServerError extends DioException { + final DioException dioError; + + InternalServerError(this.dioError) + : super( + requestOptions: dioError.requestOptions, + error: dioError.error, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/errors/not_found_error.dart b/lib/common/api/errors/not_found_error.dart new file mode 100644 index 0000000..957a4ef --- /dev/null +++ b/lib/common/api/errors/not_found_error.dart @@ -0,0 +1,16 @@ +import 'package:dio/dio.dart'; + +class NotFoundError extends DioException { + final DioException dioError; + final String? messageError; + + NotFoundError(this.dioError, this.messageError) + : super( + error: dioError.error, + requestOptions: dioError.requestOptions, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/errors/unauthorized_error.dart b/lib/common/api/errors/unauthorized_error.dart new file mode 100644 index 0000000..b1c967e --- /dev/null +++ b/lib/common/api/errors/unauthorized_error.dart @@ -0,0 +1,16 @@ +import 'package:dio/dio.dart'; + +class UnauthorizedError extends DioException { + final DioException dioError; + final String? messageError; + + UnauthorizedError(this.dioError, this.messageError) + : super( + requestOptions: dioError.requestOptions, + error: dioError.error, + response: dioError.response, + type: dioError.type, + message: dioError.message, + stackTrace: dioError.stackTrace, + ); +} diff --git a/lib/common/api/interceptors/bad_network_interceptor.dart b/lib/common/api/interceptors/bad_network_interceptor.dart new file mode 100644 index 0000000..3e82fd1 --- /dev/null +++ b/lib/common/api/interceptors/bad_network_interceptor.dart @@ -0,0 +1,22 @@ +import 'package:dio/dio.dart'; + +import '../../../injection.dart'; +import '../../network/network_client.dart'; +import '../errors/bad_network_error.dart'; + +class BadNetworkErrorInterceptor extends Interceptor { + final _networkClient = getIt(); + + @override + void onError(DioException err, ErrorInterceptorHandler handler) async { + final isConnected = await _networkClient.isConnected; + + if (err.type == DioExceptionType.connectionTimeout || + !isConnected || + err.type == DioExceptionType.receiveTimeout || + err.type == DioExceptionType.connectionError) { + return super.onError(BadNetworkError(err), handler); + } + super.onError(err, handler); + } +} diff --git a/lib/common/api/interceptors/bad_request_interceptor.dart b/lib/common/api/interceptors/bad_request_interceptor.dart new file mode 100644 index 0000000..efac3fc --- /dev/null +++ b/lib/common/api/interceptors/bad_request_interceptor.dart @@ -0,0 +1,15 @@ +import 'package:dio/dio.dart'; + +import '../errors/bad_request_error.dart'; + +class BadRequestErrorInterceptor extends Interceptor { + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + if (err.response?.statusCode == 422 || + err.response?.statusCode == 400 || + err.response?.statusCode == 405) { + return super.onError(BadRequestError(err, null), handler); + } + super.onError(err, handler); + } +} diff --git a/lib/common/api/interceptors/connection_timeout_interceptor.dart b/lib/common/api/interceptors/connection_timeout_interceptor.dart new file mode 100644 index 0000000..c5abe94 --- /dev/null +++ b/lib/common/api/interceptors/connection_timeout_interceptor.dart @@ -0,0 +1,13 @@ +import 'package:dio/dio.dart'; + +import '../errors/connection_timeout_error.dart'; + +class ConnectionTimeoutErrorInterceptor extends Interceptor { + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + if (err.type == DioExceptionType.connectionTimeout) { + return super.onError(ConnectionTimeoutError(err), handler); + } + super.onError(err, handler); + } +} diff --git a/lib/common/api/interceptors/internal_server_interceptor.dart b/lib/common/api/interceptors/internal_server_interceptor.dart new file mode 100644 index 0000000..8eddc5c --- /dev/null +++ b/lib/common/api/interceptors/internal_server_interceptor.dart @@ -0,0 +1,18 @@ +import 'package:dio/dio.dart'; + +import '../errors/internal_server_error.dart'; + +class InternalServerErrorInterceptor extends Interceptor { + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + if (err.response != null) { + if (err.response?.statusCode != null && + err.response!.statusCode! >= 500 && + err.response!.statusCode! < 600) { + return super.onError(InternalServerError(err), handler); + } + } + + super.onError(err, handler); + } +} diff --git a/lib/common/api/interceptors/not_found_interceptor.dart b/lib/common/api/interceptors/not_found_interceptor.dart new file mode 100644 index 0000000..e625b92 --- /dev/null +++ b/lib/common/api/interceptors/not_found_interceptor.dart @@ -0,0 +1,13 @@ +import 'package:dio/dio.dart'; + +import '../errors/not_found_error.dart'; + +class NotFoundErrorInterceptor extends Interceptor { + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + if (err.response?.statusCode == 404) { + return super.onError(NotFoundError(err, null), handler); + } + super.onError(err, handler); + } +} diff --git a/lib/common/api/interceptors/unauthorized_interceptor.dart b/lib/common/api/interceptors/unauthorized_interceptor.dart new file mode 100644 index 0000000..36752e0 --- /dev/null +++ b/lib/common/api/interceptors/unauthorized_interceptor.dart @@ -0,0 +1,15 @@ +import 'package:dio/dio.dart'; + +import '../errors/unauthorized_error.dart'; + +class UnauthorizedInterceptor extends Interceptor { + @override + void onError(DioException err, ErrorInterceptorHandler handler) { + if (err.response?.statusCode == 401 || + err.response?.statusCode == 403 || + err.response?.statusCode == 419) { + return super.onError(UnauthorizedError(err, null), handler); + } + super.onError(err, handler); + } +} diff --git a/lib/common/constant/app_constant.dart b/lib/common/constant/app_constant.dart new file mode 100644 index 0000000..b0dbc06 --- /dev/null +++ b/lib/common/constant/app_constant.dart @@ -0,0 +1,3 @@ +class AppConstant { + static const String appName = ""; +} diff --git a/lib/common/di/di_auto_route.dart b/lib/common/di/di_auto_route.dart new file mode 100644 index 0000000..f5277bd --- /dev/null +++ b/lib/common/di/di_auto_route.dart @@ -0,0 +1,9 @@ +import 'package:injectable/injectable.dart'; + +import '../../presentation/router/app_router.dart'; + +@module +abstract class AutoRouteDi { + @lazySingleton + AppRouter get appRouter => AppRouter(); +} diff --git a/lib/common/di/di_connectivity.dart b/lib/common/di/di_connectivity.dart new file mode 100644 index 0000000..2bc7026 --- /dev/null +++ b/lib/common/di/di_connectivity.dart @@ -0,0 +1,8 @@ +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:injectable/injectable.dart'; + +@module +abstract class ConnectivityDi { + @lazySingleton + Connectivity get connectivity => Connectivity(); +} diff --git a/lib/common/di/di_dio.dart b/lib/common/di/di_dio.dart new file mode 100644 index 0000000..56f622e --- /dev/null +++ b/lib/common/di/di_dio.dart @@ -0,0 +1,8 @@ +import 'package:dio/dio.dart'; +import 'package:injectable/injectable.dart'; + +@module +abstract class DioDi { + @lazySingleton + Dio get dio => Dio(); +} diff --git a/lib/common/di/di_shared_preferences.dart b/lib/common/di/di_shared_preferences.dart new file mode 100644 index 0000000..3e4b581 --- /dev/null +++ b/lib/common/di/di_shared_preferences.dart @@ -0,0 +1,8 @@ +import 'package:injectable/injectable.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +@module +abstract class SharedPreferencesDi { + @preResolve + Future get prefs => SharedPreferences.getInstance(); +} diff --git a/lib/common/extension/extension.dart b/lib/common/extension/extension.dart new file mode 100644 index 0000000..7199fdd --- /dev/null +++ b/lib/common/extension/extension.dart @@ -0,0 +1 @@ + // TODO: define your code diff --git a/lib/common/function/app_function.dart b/lib/common/function/app_function.dart new file mode 100644 index 0000000..ddffdda --- /dev/null +++ b/lib/common/function/app_function.dart @@ -0,0 +1,8 @@ +import 'package:flutter/material.dart'; + +void dismissKeyboard(BuildContext context) { + final currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) { + FocusManager.instance.primaryFocus?.unfocus(); + } +} diff --git a/lib/common/network/network_client.dart b/lib/common/network/network_client.dart new file mode 100644 index 0000000..081a6b5 --- /dev/null +++ b/lib/common/network/network_client.dart @@ -0,0 +1,19 @@ +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:injectable/injectable.dart'; + +@lazySingleton +class NetworkClient extends NetworkInfoBase { + final Connectivity connectivity; + + NetworkClient(this.connectivity); + + @override + Future get isConnected async { + final result = await connectivity.checkConnectivity(); + return result.first != ConnectivityResult.none; + } +} + +abstract class NetworkInfoBase { + Future get isConnected; +} diff --git a/lib/common/theme/app_color.dart b/lib/common/theme/app_color.dart new file mode 100644 index 0000000..63dd90f --- /dev/null +++ b/lib/common/theme/app_color.dart @@ -0,0 +1,5 @@ +part of 'theme.dart'; + +class AppColor { + // TODO: define color +} diff --git a/lib/common/theme/app_style.dart b/lib/common/theme/app_style.dart new file mode 100644 index 0000000..5c422cc --- /dev/null +++ b/lib/common/theme/app_style.dart @@ -0,0 +1,5 @@ +part of 'theme.dart'; + +class AppStyle { + // TODO: define style +} diff --git a/lib/common/theme/app_value.dart b/lib/common/theme/app_value.dart new file mode 100644 index 0000000..d76dbcc --- /dev/null +++ b/lib/common/theme/app_value.dart @@ -0,0 +1,5 @@ +part of 'theme.dart'; + +class AppValue { + // TODO: define value +} diff --git a/lib/common/theme/theme.dart b/lib/common/theme/theme.dart new file mode 100644 index 0000000..4d69f35 --- /dev/null +++ b/lib/common/theme/theme.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; + +part 'app_color.dart'; +part 'app_style.dart'; +part 'app_value.dart'; + +class ThemeApp { + static ThemeData get theme => ThemeData( + useMaterial3: true, + ); +} diff --git a/lib/env.dart b/lib/env.dart new file mode 100644 index 0000000..de21eb6 --- /dev/null +++ b/lib/env.dart @@ -0,0 +1,20 @@ +import 'package:injectable/injectable.dart'; + +abstract class Env { + String get baseUrl; + // add getter here... +} + +@Injectable(as: Env) +@dev +class DevEnv implements Env { + @override + String get baseUrl => ''; // example value +} + +@Injectable(as: Env) +@prod +class ProdEnv implements Env { + @override + String get baseUrl => ''; +} diff --git a/lib/injection.config.dart b/lib/injection.config.dart new file mode 100644 index 0000000..96db829 --- /dev/null +++ b/lib/injection.config.dart @@ -0,0 +1,68 @@ +// dart format width=80 +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ************************************************************************** +// InjectableConfigGenerator +// ************************************************************************** + +// ignore_for_file: type=lint +// coverage:ignore-file + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:apskel_owner_flutter/common/api/api_client.dart' as _i115; +import 'package:apskel_owner_flutter/common/di/di_auto_route.dart' as _i311; +import 'package:apskel_owner_flutter/common/di/di_connectivity.dart' as _i586; +import 'package:apskel_owner_flutter/common/di/di_dio.dart' as _i103; +import 'package:apskel_owner_flutter/common/di/di_shared_preferences.dart' + as _i402; +import 'package:apskel_owner_flutter/common/network/network_client.dart' + as _i543; +import 'package:apskel_owner_flutter/env.dart' as _i6; +import 'package:apskel_owner_flutter/presentation/router/app_router.dart' + as _i258; +import 'package:connectivity_plus/connectivity_plus.dart' as _i895; +import 'package:dio/dio.dart' as _i361; +import 'package:get_it/get_it.dart' as _i174; +import 'package:injectable/injectable.dart' as _i526; +import 'package:shared_preferences/shared_preferences.dart' as _i460; + +const String _dev = 'dev'; +const String _prod = 'prod'; + +extension GetItInjectableX on _i174.GetIt { + // initializes the registration of main-scope dependencies inside of GetIt + Future<_i174.GetIt> init({ + String? environment, + _i526.EnvironmentFilter? environmentFilter, + }) async { + final gh = _i526.GetItHelper(this, environment, environmentFilter); + final sharedPreferencesDi = _$SharedPreferencesDi(); + final dioDi = _$DioDi(); + final autoRouteDi = _$AutoRouteDi(); + final connectivityDi = _$ConnectivityDi(); + await gh.factoryAsync<_i460.SharedPreferences>( + () => sharedPreferencesDi.prefs, + preResolve: true, + ); + gh.lazySingleton<_i361.Dio>(() => dioDi.dio); + gh.lazySingleton<_i258.AppRouter>(() => autoRouteDi.appRouter); + gh.lazySingleton<_i895.Connectivity>(() => connectivityDi.connectivity); + gh.lazySingleton<_i543.NetworkClient>( + () => _i543.NetworkClient(gh<_i895.Connectivity>()), + ); + gh.factory<_i6.Env>(() => _i6.DevEnv(), registerFor: {_dev}); + gh.lazySingleton<_i115.ApiClient>( + () => _i115.ApiClient(gh<_i361.Dio>(), gh<_i6.Env>()), + ); + gh.factory<_i6.Env>(() => _i6.ProdEnv(), registerFor: {_prod}); + return this; + } +} + +class _$SharedPreferencesDi extends _i402.SharedPreferencesDi {} + +class _$DioDi extends _i103.DioDi {} + +class _$AutoRouteDi extends _i311.AutoRouteDi {} + +class _$ConnectivityDi extends _i586.ConnectivityDi {} diff --git a/lib/injection.dart b/lib/injection.dart new file mode 100644 index 0000000..85d0036 --- /dev/null +++ b/lib/injection.dart @@ -0,0 +1,9 @@ +import 'package:get_it/get_it.dart'; +import 'package:injectable/injectable.dart'; + +import 'injection.config.dart'; + +final getIt = GetIt.instance; + +@InjectableInit() +Future configureDependencies(String env) => getIt.init(environment: env); diff --git a/lib/main.dart b/lib/main.dart index 7b7f5b6..826ecd4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,122 +1,28 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:injectable/injectable.dart'; -void main() { - runApp(const MyApp()); -} +import 'injection.dart'; +import 'presentation/app_widget.dart'; -class MyApp extends StatelessWidget { - const MyApp({super.key}); +void main() async { + WidgetsFlutterBinding.ensureInitialized(); - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // TRY THIS: Try running your application with "flutter run". You'll see - // the application has a purple toolbar. Then, without quitting the app, - // try changing the seedColor in the colorScheme below to Colors.green - // and then invoke "hot reload" (save your changes or press the "hot - // reload" button in a Flutter-supported IDE, or press "r" if you used - // the command line to start the app). - // - // Notice that the counter didn't reset back to zero; the application - // state is not lost during the reload. To reset the state, use hot - // restart instead. - // - // This works for code too, not just values: Most code changes can be - // tested with just a hot reload. - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - } -} + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarIconBrightness: Brightness.dark, + ), + ); -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); + if (kReleaseMode) { + debugPrint = (message, {wrapWidth}) => ''; } - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('You have pushed the button this many times:'), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } + await configureDependencies( + kReleaseMode ? Environment.prod : Environment.dev, + ); + + runApp(const AppWidget()); } diff --git a/lib/presentation/app_widget.dart b/lib/presentation/app_widget.dart new file mode 100644 index 0000000..38ae400 --- /dev/null +++ b/lib/presentation/app_widget.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +import '../common/theme/theme.dart'; +import '../common/constant/app_constant.dart'; +import '../injection.dart'; +import 'router/app_router.dart'; +import 'router/app_router_observer.dart'; + +class AppWidget extends StatefulWidget { + const AppWidget({super.key}); + + @override + State createState() => _AppWidgetState(); +} + +class _AppWidgetState extends State { + final _appRouter = getIt(); + + @override + Widget build(BuildContext context) { + return MaterialApp.router( + debugShowCheckedModeBanner: false, + title: AppConstant.appName, + theme: ThemeApp.theme, + routerConfig: _appRouter.config( + navigatorObservers: () => [AppRouteObserver()], + ), + ); + } +} diff --git a/lib/presentation/components/assets/assets.gen.dart b/lib/presentation/components/assets/assets.gen.dart new file mode 100644 index 0000000..c528e32 --- /dev/null +++ b/lib/presentation/components/assets/assets.gen.dart @@ -0,0 +1,116 @@ +// dart format width=80 + +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import + +import 'package:flutter/widgets.dart'; + +class $AssetsImagesGen { + const $AssetsImagesGen(); + + /// File path: assets/images/logo.png + AssetGenImage get logo => const AssetGenImage('assets/images/logo.png'); + + /// List of all assets + List get values => [logo]; +} + +class Assets { + const Assets._(); + + static const $AssetsImagesGen images = $AssetsImagesGen(); +} + +class AssetGenImage { + const AssetGenImage( + this._assetName, { + this.size, + this.flavors = const {}, + this.animation, + }); + + final String _assetName; + + final Size? size; + final Set flavors; + final AssetGenImageAnimation? animation; + + Image image({ + Key? key, + AssetBundle? bundle, + ImageFrameBuilder? frameBuilder, + ImageErrorWidgetBuilder? errorBuilder, + String? semanticLabel, + bool excludeFromSemantics = false, + double? scale, + double? width, + double? height, + Color? color, + Animation? opacity, + BlendMode? colorBlendMode, + BoxFit? fit, + AlignmentGeometry alignment = Alignment.center, + ImageRepeat repeat = ImageRepeat.noRepeat, + Rect? centerSlice, + bool matchTextDirection = false, + bool gaplessPlayback = true, + bool isAntiAlias = false, + String? package, + FilterQuality filterQuality = FilterQuality.medium, + int? cacheWidth, + int? cacheHeight, + }) { + return Image.asset( + _assetName, + key: key, + bundle: bundle, + frameBuilder: frameBuilder, + errorBuilder: errorBuilder, + semanticLabel: semanticLabel, + excludeFromSemantics: excludeFromSemantics, + scale: scale, + width: width, + height: height, + color: color, + opacity: opacity, + colorBlendMode: colorBlendMode, + fit: fit, + alignment: alignment, + repeat: repeat, + centerSlice: centerSlice, + matchTextDirection: matchTextDirection, + gaplessPlayback: gaplessPlayback, + isAntiAlias: isAntiAlias, + package: package, + filterQuality: filterQuality, + cacheWidth: cacheWidth, + cacheHeight: cacheHeight, + ); + } + + ImageProvider provider({AssetBundle? bundle, String? package}) { + return AssetImage(_assetName, bundle: bundle, package: package); + } + + String get path => _assetName; + + String get keyName => _assetName; +} + +class AssetGenImageAnimation { + const AssetGenImageAnimation({ + required this.isAnimation, + required this.duration, + required this.frames, + }); + + final bool isAnimation; + final Duration duration; + final int frames; +} diff --git a/lib/presentation/components/assets/fonts.gen.dart b/lib/presentation/components/assets/fonts.gen.dart new file mode 100644 index 0000000..6b60f37 --- /dev/null +++ b/lib/presentation/components/assets/fonts.gen.dart @@ -0,0 +1,16 @@ +// dart format width=80 +/// GENERATED CODE - DO NOT MODIFY BY HAND +/// ***************************************************** +/// FlutterGen +/// ***************************************************** + +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import + +class FontFamily { + FontFamily._(); + + /// Font family: Quicksand + static const String quicksand = 'Quicksand'; +} diff --git a/lib/presentation/components/component.dart b/lib/presentation/components/component.dart new file mode 100644 index 0000000..7199fdd --- /dev/null +++ b/lib/presentation/components/component.dart @@ -0,0 +1 @@ + // TODO: define your code diff --git a/lib/presentation/pages/splash_page.dart b/lib/presentation/pages/splash_page.dart new file mode 100644 index 0000000..12c890a --- /dev/null +++ b/lib/presentation/pages/splash_page.dart @@ -0,0 +1,21 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +@RoutePage() +class SplashPage extends StatefulWidget { + const SplashPage({super.key}); + + @override + State createState() => _SplashPageState(); +} + +class _SplashPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Text("Splash Page"), + ), + ); + } +} diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart new file mode 100644 index 0000000..4c75faf --- /dev/null +++ b/lib/presentation/router/app_router.dart @@ -0,0 +1,11 @@ +import 'package:auto_route/auto_route.dart'; +import 'app_router.gr.dart'; + +@AutoRouterConfig() +class AppRouter extends RootStackRouter { + @override + List get routes => [ + // Splash + AutoRoute(page: SplashRoute.page, initial: true), + ]; +} diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart new file mode 100644 index 0000000..54491c3 --- /dev/null +++ b/lib/presentation/router/app_router.gr.dart @@ -0,0 +1,30 @@ +// dart format width=80 +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ************************************************************************** +// AutoRouterGenerator +// ************************************************************************** + +// ignore_for_file: type=lint +// coverage:ignore-file + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:apskel_owner_flutter/presentation/pages/splash_page.dart' + as _i1; +import 'package:auto_route/auto_route.dart' as _i2; + +/// generated route for +/// [_i1.SplashPage] +class SplashRoute extends _i2.PageRouteInfo { + const SplashRoute({List<_i2.PageRouteInfo>? children}) + : super(SplashRoute.name, initialChildren: children); + + static const String name = 'SplashRoute'; + + static _i2.PageInfo page = _i2.PageInfo( + name, + builder: (data) { + return const _i1.SplashPage(); + }, + ); +} diff --git a/lib/presentation/router/app_router_observer.dart b/lib/presentation/router/app_router_observer.dart new file mode 100644 index 0000000..e3707f4 --- /dev/null +++ b/lib/presentation/router/app_router_observer.dart @@ -0,0 +1,21 @@ +import 'dart:developer'; + +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +class AppRouteObserver extends AutoRouterObserver { + @override + void didPush(Route route, Route? previousRoute) { + log('New route pushed: ${route.settings.name}'); + } + + @override + void didInitTabRoute(TabPageRoute route, TabPageRoute? previousRoute) { + log('Tab route visited: ${route.name}'); + } + + @override + void didChangeTabRoute(TabPageRoute route, TabPageRoute previousRoute) { + log('Tab route re-visited: ${route.name}'); + } +} diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b..4b81f9b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/Flutter-Release.xcconfig b/macos/Flutter/Flutter-Release.xcconfig index c2efd0b..5caa9d1 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..7d12a67 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,12 @@ import FlutterMacOS import Foundation +import connectivity_plus +import path_provider_foundation +import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/macos/Podfile b/macos/Podfile new file mode 100644 index 0000000..29c8eb3 --- /dev/null +++ b/macos/Podfile @@ -0,0 +1,42 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/pubspec.lock b/pubspec.lock index eaa659f..01684df 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,38 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f + url: "https://pub.dev" + source: hosted + version: "85.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" + url: "https://pub.dev" + source: hosted + version: "7.7.1" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" async: dependency: transitive description: @@ -9,6 +41,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.13.0" + auto_route: + dependency: "direct main" + description: + name: auto_route + sha256: "1d1bd908a1fec327719326d5d0791edd37f16caff6493c01003689fb03315ad7" + url: "https://pub.dev" + source: hosted + version: "9.3.0+1" + auto_route_generator: + dependency: "direct dev" + description: + name: auto_route_generator + sha256: c2e359d8932986d4d1bcad7a428143f81384ce10fef8d4aa5bc29e1f83766a46 + url: "https://pub.dev" + source: hosted + version: "9.3.1" + awesome_dio_interceptor: + dependency: "direct main" + description: + name: awesome_dio_interceptor + sha256: "4aef4adfdd9d8fda159870277b898a97986c6624baaf42f8a986d3130860d007" + url: "https://pub.dev" + source: hosted + version: "1.3.0" boolean_selector: dependency: transitive description: @@ -17,6 +73,70 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + build: + dependency: transitive + description: + name: build + sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62 + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792" + url: "https://pub.dev" + source: hosted + version: "9.1.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ba95c961bafcd8686d1cf63be864eb59447e795e124d98d6a27d91fcd13602fb + url: "https://pub.dev" + source: hosted + version: "8.11.1" characters: dependency: transitive description: @@ -25,6 +145,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" clock: dependency: transitive description: @@ -33,6 +169,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" collection: dependency: transitive description: @@ -41,6 +185,54 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.1" + color: + dependency: transitive + description: + name: color + sha256: ddcdf1b3badd7008233f5acffaf20ca9f5dc2cd0172b75f68f24526a5f5725cb + url: "https://pub.dev" + source: hosted + version: "3.0.0" + colorize: + dependency: transitive + description: + name: colorize + sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + connectivity_plus: + dependency: "direct main" + description: + name: connectivity_plus + sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec + url: "https://pub.dev" + source: hosted + version: "6.1.5" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" cupertino_icons: dependency: "direct main" description: @@ -49,6 +241,62 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + dartx: + dependency: transitive + description: + name: dartx + sha256: "8b25435617027257d43e6508b5fe061012880ddfdaa75a71d607c3de2a13d244" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + dartz: + dependency: "direct main" + description: + name: dartz + sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168 + url: "https://pub.dev" + source: hosted + version: "0.10.1" + data_channel: + dependency: "direct main" + description: + name: data_channel + sha256: "9fd800a76e95031c9887acf88091f4a9188c9812e15d1f1c15d759d3fea16160" + url: "https://pub.dev" + source: hosted + version: "2.0.0+1" + dbus: + dependency: transitive + description: + name: dbus + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + dio: + dependency: "direct main" + description: + name: dio + sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 + url: "https://pub.dev" + source: hosted + version: "5.9.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" + url: "https://pub.dev" + source: hosted + version: "2.1.1" fake_async: dependency: transitive description: @@ -57,11 +305,59 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_gen_core: + dependency: transitive + description: + name: flutter_gen_core + sha256: eda54fdc5de08e7eeea663eb8442aafc8660b5a13fda4e0c9e572c64e50195fb + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_gen_runner: + dependency: "direct dev" + description: + name: flutter_gen_runner + sha256: "669bf8b7a9b4acbdcb7fcc5e12bf638aca19acedf43341714cbca3bf3a219521" + url: "https://pub.dev" + source: hosted + version: "5.11.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7" + url: "https://pub.dev" + source: hosted + version: "0.14.4" flutter_lints: dependency: "direct dev" description: @@ -70,11 +366,176 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: cd57f7969b4679317c17af6fd16ee233c1e60a82ed209d8a475c54fd6fd6f845 + url: "https://pub.dev" + source: hosted + version: "2.2.0" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "59a584c24b3acdc5250bb856d0d3e9c0b798ed14a4af1ddb7dc1c7b41df91c9c" + url: "https://pub.dev" + source: hosted + version: "2.5.8" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + get_it: + dependency: "direct main" + description: + name: get_it + sha256: a4292e7cf67193f8e7c1258203104eb2a51ec8b3a04baa14695f4064c144297b + url: "https://pub.dev" + source: hosted + version: "8.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + hashcodes: + dependency: transitive + description: + name: hashcodes + sha256: "80f9410a5b3c8e110c4b7604546034749259f5d6dcca63e0d3c17c9258f1a651" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + image_size_getter: + dependency: transitive + description: + name: image_size_getter + sha256: "7c26937e0ae341ca558b7556591fd0cc456fcc454583b7cb665d2f03e93e590f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + injectable: + dependency: "direct main" + description: + name: injectable + sha256: "1b86fab6a98c11a97e5c718afb00e628d47d183c2a2256392e995a4c561141c1" + url: "https://pub.dev" + source: hosted + version: "2.5.1" + injectable_generator: + dependency: "direct dev" + description: + name: injectable_generator + sha256: b04673a4c88b3a848c0c77bf58b8309f9b9e064d9fe1df5450c8ee1675eaea1a + url: "https://pub.dev" + source: hosted + version: "2.7.0" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + url: "https://pub.dev" + source: hosted + version: "0.20.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c + url: "https://pub.dev" + source: hosted + version: "6.9.5" leak_tracker: dependency: transitive description: @@ -107,6 +568,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" matcher: dependency: transitive description: @@ -131,19 +600,251 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" - path: + mime: dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: "direct main" description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted version: "1.9.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 + url: "https://pub.dev" + source: hosted + version: "2.2.17" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + url: "https://pub.dev" + source: hosted + version: "3.1.6" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + recase: + dependency: transitive + description: + name: recase + sha256: e4eb4ec2dcdee52dcf99cb4ceabaffc631d7424ee55e56f280bc039737f89213 + url: "https://pub.dev" + source: hosted + version: "4.1.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" + url: "https://pub.dev" + source: hosted + version: "2.5.3" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e" + url: "https://pub.dev" + source: hosted + version: "2.4.11" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + url: "https://pub.dev" + source: hosted + version: "2.5.4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca + url: "https://pub.dev" + source: hosted + version: "1.3.7" source_span: dependency: transitive description: @@ -168,6 +869,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" string_scanner: dependency: transitive description: @@ -192,6 +901,54 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4" + time: + dependency: transitive + description: + name: time + sha256: "370572cf5d1e58adcb3e354c47515da3f7469dac3a95b447117e728e7be6f461" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6 + url: "https://pub.dev" + source: hosted + version: "1.1.19" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + url: "https://pub.dev" + source: hosted + version: "1.1.13" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "557a315b7d2a6dbb0aaaff84d857967ce6bdc96a63dc6ee2a57ce5a6ee5d3331" + url: "https://pub.dev" + source: hosted + version: "1.1.17" vector_math: dependency: transitive description: @@ -208,6 +965,62 @@ packages: url: "https://pub.dev" source: hosted version: "15.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" sdks: dart: ">=3.8.1 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.27.0" diff --git a/pubspec.yaml b/pubspec.yaml index d3f6a1a..c73810e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,89 +1,69 @@ name: apskel_owner_flutter description: "A new Flutter project." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. +publish_to: "none" + version: 1.0.0+1 environment: sdk: ^3.8.1 -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 + auto_route: ^9.3.0 + get_it: ^8.0.3 + injectable: ^2.5.0 + dio: ^5.8.0+1 + connectivity_plus: ^6.1.4 + data_channel: ^2.0.0+1 + path: ^1.9.1 + path_provider: ^2.1.5 + dartz: ^0.10.1 + intl: ^0.20.2 + flutter_svg: ^2.2.0 + freezed_annotation: ^2.4.1 + json_annotation: ^4.9.0 + shared_preferences: ^2.5.3 + awesome_dio_interceptor: ^1.3.0 dev_dependencies: flutter_test: sdk: flutter - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. flutter_lints: ^5.0.0 + auto_route_generator: ^9.3.0 + build_runner: ^2.4.6 + freezed: ^2.4.5 + injectable_generator: ^2.5.0 + flutter_gen_runner: ^5.11.0 + flutter_launcher_icons: ^0.14.4 + json_serializable: ^6.9.5 -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true + assets: + - assets/images/ + - assets/icons/ + - assets/json/ - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + fonts: + - family: Quicksand + fonts: + - asset: assets/fonts/quicksand/Quicksand-Light.ttf + weight: 300 + - asset: assets/fonts/quicksand/Quicksand-Regular.ttf + weight: 400 + - asset: assets/fonts/quicksand/Quicksand-Medium.ttf + weight: 500 + - asset: assets/fonts/quicksand/Quicksand-SemiBold.ttf + weight: 600 + - asset: assets/fonts/quicksand/Quicksand-Bold.ttf + weight: 700 - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package +flutter_gen: + output: lib/presentation/components/assets/ + integrations: + flutter_svg: true diff --git a/test/widget_test.dart b/test/widget_test.dart index fd9a2be..9322cd7 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -8,12 +8,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:apskel_owner_flutter/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); + // await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); diff --git a/web/favicon.png b/web/favicon.png index 8aaa46a..91b113e 100644 Binary files a/web/favicon.png and b/web/favicon.png differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png index b749bfe..483f22e 100644 Binary files a/web/icons/Icon-192.png and b/web/icons/Icon-192.png differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png index 88cfd48..3d0d42e 100644 Binary files a/web/icons/Icon-512.png and b/web/icons/Icon-512.png differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png index eb9b4d7..483f22e 100644 Binary files a/web/icons/Icon-maskable-192.png and b/web/icons/Icon-maskable-192.png differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png index d69c566..3d0d42e 100644 Binary files a/web/icons/Icon-maskable-512.png and b/web/icons/Icon-maskable-512.png differ diff --git a/web/manifest.json b/web/manifest.json index 6176c62..7adf26a 100644 --- a/web/manifest.json +++ b/web/manifest.json @@ -32,4 +32,4 @@ "purpose": "maskable" } ] -} +} \ No newline at end of file diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..8777c93 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..cc1361d 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico index c04e20c..eba7b0f 100644 Binary files a/windows/runner/resources/app_icon.ico and b/windows/runner/resources/app_icon.ico differ