From 5ffbc1b16adb5e0342cee85000232783b49b08fd Mon Sep 17 00:00:00 2001 From: Romasav <77693799+Romasav@users.noreply.github.com> Date: Mon, 2 Dec 2024 14:09:05 +0000 Subject: [PATCH] Revert "Feature/settings" --- .github/workflows/ci.yaml | 3 - analysis_options.yaml | 5 - android/app/src/main/AndroidManifest.xml | 17 - ios/Flutter/Debug.xcconfig | 1 - ios/Flutter/Release.xcconfig | 1 - ios/Podfile | 44 -- ios/Podfile.lock | 29 - ios/Runner.xcodeproj/project.pbxproj | 112 --- .../contents.xcworkspacedata | 3 - ios/Runner/Info.plist | 6 - lib/core/failure.dart | 31 - lib/core/use_case.dart | 25 - .../providers/device_repo_impl_provider.dart | 13 - .../device_repo_impl_provider.g.dart | 28 - .../settings_repo_impl_provider.dart | 12 - .../settings_repo_impl_provider.g.dart | 28 - lib/data/repositories/ble_repo_impl.dart | 126 ---- lib/data/repositories/settings_repo_impl.dart | 70 -- lib/domain/entities/algorithm_result.dart | 2 - lib/domain/entities/settings.dart | 25 - lib/domain/failures/device_failures.dart | 63 -- lib/domain/failures/settings_failures.dart | 36 - lib/domain/providers/connect_use_case.dart | 15 - lib/domain/providers/connect_use_case.g.dart | 30 - lib/domain/providers/disconnect_use_case.dart | 15 - .../providers/disconnect_use_case.g.dart | 30 - .../get_processed_data_stream_use_case.dart | 16 - .../get_processed_data_stream_use_case.g.dart | 32 - .../providers/get_settings_use_case.dart | 13 - .../providers/get_settings_use_case.g.dart | 30 - .../providers/save_settings_use_case.dart | 13 - .../providers/save_settings_use_case.g.dart | 30 - lib/domain/repositories/device_repo.dart | 14 - lib/domain/repositories/settings_repo.dart | 12 - lib/domain/use_cases/connect_use_case.dart | 17 - lib/domain/use_cases/disconnect_use_case.dart | 17 - .../get_processed_data_stream_use_case.dart | 41 -- .../use_cases/get_settings_use_case.dart | 18 - .../use_cases/save_settings_use_case.dart | 27 - lib/main.dart | 96 ++- .../notifiers/processed_data.dart | 34 - .../notifiers/processed_data.g.dart | 29 - lib/presentation/notifiers/settings.dart | 37 - lib/presentation/notifiers/settings.g.dart | 28 - lib/presentation/pages/main_page.dart | 111 --- lib/presentation/widgets/settings_dialog.dart | 90 --- macos/Flutter/Flutter-Debug.xcconfig | 1 - macos/Flutter/Flutter-Release.xcconfig | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 4 - macos/Podfile | 43 -- macos/Podfile.lock | 22 - macos/Runner.xcodeproj/project.pbxproj | 98 +-- .../contents.xcworkspacedata | 3 - pubspec.lock | 660 +----------------- pubspec.yaml | 22 +- test/placeholder_test.dart | 7 - test/widget_test.dart | 30 + 57 files changed, 129 insertions(+), 2237 deletions(-) delete mode 100644 ios/Podfile delete mode 100644 ios/Podfile.lock delete mode 100644 lib/core/failure.dart delete mode 100644 lib/core/use_case.dart delete mode 100644 lib/data/providers/device_repo_impl_provider.dart delete mode 100644 lib/data/providers/device_repo_impl_provider.g.dart delete mode 100644 lib/data/providers/settings_repo_impl_provider.dart delete mode 100644 lib/data/providers/settings_repo_impl_provider.g.dart delete mode 100644 lib/data/repositories/ble_repo_impl.dart delete mode 100644 lib/data/repositories/settings_repo_impl.dart delete mode 100644 lib/domain/entities/algorithm_result.dart delete mode 100644 lib/domain/entities/settings.dart delete mode 100644 lib/domain/failures/device_failures.dart delete mode 100644 lib/domain/failures/settings_failures.dart delete mode 100644 lib/domain/providers/connect_use_case.dart delete mode 100644 lib/domain/providers/connect_use_case.g.dart delete mode 100644 lib/domain/providers/disconnect_use_case.dart delete mode 100644 lib/domain/providers/disconnect_use_case.g.dart delete mode 100644 lib/domain/providers/get_processed_data_stream_use_case.dart delete mode 100644 lib/domain/providers/get_processed_data_stream_use_case.g.dart delete mode 100644 lib/domain/providers/get_settings_use_case.dart delete mode 100644 lib/domain/providers/get_settings_use_case.g.dart delete mode 100644 lib/domain/providers/save_settings_use_case.dart delete mode 100644 lib/domain/providers/save_settings_use_case.g.dart delete mode 100644 lib/domain/repositories/device_repo.dart delete mode 100644 lib/domain/repositories/settings_repo.dart delete mode 100644 lib/domain/use_cases/connect_use_case.dart delete mode 100644 lib/domain/use_cases/disconnect_use_case.dart delete mode 100644 lib/domain/use_cases/get_processed_data_stream_use_case.dart delete mode 100644 lib/domain/use_cases/get_settings_use_case.dart delete mode 100644 lib/domain/use_cases/save_settings_use_case.dart delete mode 100644 lib/presentation/notifiers/processed_data.dart delete mode 100644 lib/presentation/notifiers/processed_data.g.dart delete mode 100644 lib/presentation/notifiers/settings.dart delete mode 100644 lib/presentation/notifiers/settings.g.dart delete mode 100644 lib/presentation/pages/main_page.dart delete mode 100644 lib/presentation/widgets/settings_dialog.dart delete mode 100644 macos/Podfile delete mode 100644 macos/Podfile.lock delete mode 100644 test/placeholder_test.dart create mode 100644 test/widget_test.dart diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5d5efff..a7c197c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,9 +33,6 @@ jobs: - name: Analyze run: flutter analyze - - - name: Analyze with riverpod_lint - run: dart run custom_lint - name: Test run: flutter test \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index 2b30c8c..3bf8125 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -9,11 +9,6 @@ # packages, and plugins designed to encourage good coding practices. include: package:very_good_analysis/analysis_options.yaml -# Enabling riverpod_lint -analyzer: - plugins: - - custom_lint - 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` diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 28ee885..7f26896 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,21 +1,4 @@ - - - - - - - - - - - - - - - :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! - use_modular_headers! - - 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/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index f04ac83..0000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,29 +0,0 @@ -PODS: - - Flutter (1.0.0) - - flutter_blue_plus (0.0.1): - - Flutter - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - -DEPENDENCIES: - - Flutter (from `Flutter`) - - flutter_blue_plus (from `.symlinks/plugins/flutter_blue_plus/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - flutter_blue_plus: - :path: ".symlinks/plugins/flutter_blue_plus/ios" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - -SPEC CHECKSUMS: - Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_blue_plus: 4837da7d00cf5d441fdd6635b3a57f936778ea96 - shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 - -PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796 - -COCOAPODS: 1.15.2 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 63ffbcc..4ad1f09 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,14 +8,12 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 16591845AD27DE720F6A60C3 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD60DB143AA26898607BBE66 /* Pods_RunnerTests.framework */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - D8D841521ECD8BB5FDB622FF /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE4BB38786E19348E2B8E88D /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -42,18 +40,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0F50297D05BFBD5574DBBC07 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 1EF4D11027AE5B61B448A1C2 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 4434C22957AA633B18FD7F5E /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7B288BB69CC77BA97F7C82E9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -61,10 +55,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A35294EE97506C63C3FAA718 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - CD60DB143AA26898607BBE66 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - CE4BB38786E19348E2B8E88D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E9BAF60D23F68DBBF81394C4 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,15 +62,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8D841521ECD8BB5FDB622FF /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F307FAC29F16D24084514574 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 16591845AD27DE720F6A60C3 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -95,20 +76,6 @@ path = RunnerTests; sourceTree = ""; }; - 33246678A6806F53CAD69556 /* Pods */ = { - isa = PBXGroup; - children = ( - 7B288BB69CC77BA97F7C82E9 /* Pods-Runner.debug.xcconfig */, - 0F50297D05BFBD5574DBBC07 /* Pods-Runner.release.xcconfig */, - 4434C22957AA633B18FD7F5E /* Pods-Runner.profile.xcconfig */, - A35294EE97506C63C3FAA718 /* Pods-RunnerTests.debug.xcconfig */, - E9BAF60D23F68DBBF81394C4 /* Pods-RunnerTests.release.xcconfig */, - 1EF4D11027AE5B61B448A1C2 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -127,8 +94,6 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - 33246678A6806F53CAD69556 /* Pods */, - F025A7C24053B094B3040E0D /* Frameworks */, ); sourceTree = ""; }; @@ -156,15 +121,6 @@ path = Runner; sourceTree = ""; }; - F025A7C24053B094B3040E0D /* Frameworks */ = { - isa = PBXGroup; - children = ( - CE4BB38786E19348E2B8E88D /* Pods_Runner.framework */, - CD60DB143AA26898607BBE66 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -172,10 +128,8 @@ isa = PBXNativeTarget; buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 4A09151F2FBAFB91235DBF94 /* [CP] Check Pods Manifest.lock */, 331C807D294A63A400263BE5 /* Sources */, 331C807F294A63A400263BE5 /* Resources */, - F307FAC29F16D24084514574 /* Frameworks */, ); buildRules = ( ); @@ -191,14 +145,12 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 14AA7DC0163A872C498246D1 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - F2393BC763B0B6B6F1595D08 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -270,28 +222,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 14AA7DC0163A872C498246D1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -308,28 +238,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 4A09151F2FBAFB91235DBF94 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -345,23 +253,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - F2393BC763B0B6B6F1595D08 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -487,7 +378,6 @@ }; 331C8088294A63A400263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A35294EE97506C63C3FAA718 /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -505,7 +395,6 @@ }; 331C8089294A63A400263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E9BAF60D23F68DBBF81394C4 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; @@ -521,7 +410,6 @@ }; 331C808A294A63A400263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1EF4D11027AE5B61B448A1C2 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc1..1d526a1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 3377258..f0ab3c9 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,12 +2,6 @@ - NSBluetoothAlwaysUsageDescription - This app needs Bluetooth to function - NSLocationWhenInUseUsageDescription - This app requires location access to provide location-based features while in use. - NSLocationAlwaysUsageDescription - This app requires location access to provide location-based features even when the app is not in use. CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName diff --git a/lib/core/failure.dart b/lib/core/failure.dart deleted file mode 100644 index 110f2b6..0000000 --- a/lib/core/failure.dart +++ /dev/null @@ -1,31 +0,0 @@ -/// An abstract class representing a failure with an associated message. -/// -/// This class serves as a base class for different types of failures that -/// can occur in the application. Each failure has a message that provides -/// more details about the failure. -/// -/// The [Failure] class is intended to be extended by other classes to -/// represent specific types of failures. -/// -/// Example: -/// ```dart -/// class NetworkFailure extends Failure { -/// const NetworkFailure(String message) : super(message); -/// } -/// ``` -/// -/// Properties: -/// - `message`: A string containing details about the failure. -abstract class Failure { - /// Constructs a [Failure] with the given message. - const Failure(this.message, this.stackTrace); - - /// A string containing details about the failure. - final String message; - - /// A stack trace that provides information about where the failure occurred. - final StackTrace stackTrace; - - @override - String toString() => message; -} diff --git a/lib/core/use_case.dart b/lib/core/use_case.dart deleted file mode 100644 index 83c2704..0000000 --- a/lib/core/use_case.dart +++ /dev/null @@ -1,25 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:equatable/equatable.dart'; - -/// An abstract class representing a use case that can be -/// executed with the given parameters. -/// -/// [ResultType] is the type of the result produced by the use case. -/// [Params] is the type of the parameters required to execute the use case. -// ignore: one_member_abstracts -abstract class UseCase { - /// Executes the use case with the given [params]. - /// - /// Returns a [Future] that completes with either a [Failure] - /// or a [ResultType]. - Future> call(Params params); -} - -/// Represents no parameters. -/// -/// Use this when a use case does not require any parameters. -class NoParams extends Equatable { - @override - List get props => []; -} diff --git a/lib/data/providers/device_repo_impl_provider.dart b/lib/data/providers/device_repo_impl_provider.dart deleted file mode 100644 index f59ab04..0000000 --- a/lib/data/providers/device_repo_impl_provider.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:eeg_app/data/repositories/ble_repo_impl.dart'; -import 'package:eeg_app/domain/repositories/device_repo.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'device_repo_impl_provider.g.dart'; - -/// A provider that creates a [DeviceRepo]. -@Riverpod(keepAlive: true) -DeviceRepo deviceRepo(Ref ref) { - final bleDeviceImpl = BleDeviceImpl(); - return bleDeviceImpl; -} diff --git a/lib/data/providers/device_repo_impl_provider.g.dart b/lib/data/providers/device_repo_impl_provider.g.dart deleted file mode 100644 index e44d1a1..0000000 --- a/lib/data/providers/device_repo_impl_provider.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'device_repo_impl_provider.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$deviceRepoHash() => r'04fea4ad05695d951d6135082859e5d4c4f7d2d4'; - -/// A provider that creates a [DeviceRepo]. -/// -/// Copied from [deviceRepo]. -@ProviderFor(deviceRepo) -final deviceRepoProvider = Provider.internal( - deviceRepo, - name: r'deviceRepoProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$deviceRepoHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DeviceRepoRef = ProviderRef; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/data/providers/settings_repo_impl_provider.dart b/lib/data/providers/settings_repo_impl_provider.dart deleted file mode 100644 index cf90943..0000000 --- a/lib/data/providers/settings_repo_impl_provider.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:eeg_app/data/repositories/settings_repo_impl.dart'; -import 'package:eeg_app/domain/repositories/settings_repo.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'settings_repo_impl_provider.g.dart'; - -/// A provider that creates a [SettingsRepo]. -@Riverpod(keepAlive: true) -SettingsRepo settingsRepo(Ref ref) { - return SettingsRepoImpl(); -} diff --git a/lib/data/providers/settings_repo_impl_provider.g.dart b/lib/data/providers/settings_repo_impl_provider.g.dart deleted file mode 100644 index fc9ffa0..0000000 --- a/lib/data/providers/settings_repo_impl_provider.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'settings_repo_impl_provider.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$settingsRepoHash() => r'f49caaf5239aee4643cb4377d2aa31952e3a6039'; - -/// A provider that creates a [SettingsRepo]. -/// -/// Copied from [settingsRepo]. -@ProviderFor(settingsRepo) -final settingsRepoProvider = Provider.internal( - settingsRepo, - name: r'settingsRepoProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') ? null : _$settingsRepoHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SettingsRepoRef = ProviderRef; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/data/repositories/ble_repo_impl.dart b/lib/data/repositories/ble_repo_impl.dart deleted file mode 100644 index b46d5c2..0000000 --- a/lib/data/repositories/ble_repo_impl.dart +++ /dev/null @@ -1,126 +0,0 @@ -import 'dart:async'; -import 'dart:developer'; - -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/domain/failures/device_failures.dart'; -import 'package:eeg_app/domain/repositories/device_repo.dart'; -import 'package:flutter_blue_plus/flutter_blue_plus.dart'; - -const _characteristicUUID = '0000fe42-8e22-4541-9d4c-21edae82ed19'; -const _platformName = 'EAREEG'; - -/// Implementation of the [DeviceRepo] interface for devices. -class BleDeviceImpl implements DeviceRepo { - BluetoothDevice? _connectedDevice; - - @override - Future> connect() async { - if (_connectedDevice != null) { - log('Device already connected', stackTrace: StackTrace.current); - return left(DeviceFailure.failedToConnect(StackTrace.current)); - } - - try { - final device = await _scanForDevice( - platformName: _platformName, - timeout: const Duration(seconds: 5), - ); - await device.connect(timeout: const Duration(seconds: 5)); - _connectedDevice = device; - return right(unit); - } catch (e, s) { - log('Failed to connect to device', error: e, stackTrace: s); - return left(DeviceFailure.failedToConnect(s)); - } - } - - @override - Future> disconnect() async { - if (_connectedDevice == null) { - log('Device not connected', stackTrace: StackTrace.current); - return left(DeviceFailure.unconnectedDevice(StackTrace.current)); - } - - try { - await _connectedDevice!.disconnect(timeout: 5); - _connectedDevice = null; - return right(unit); - } catch (e, s) { - log('Failed to disconnect from device', error: e, stackTrace: s); - return left(DeviceFailure.unknown(s)); - } - } - - @override - Future>>> getDataStream() async { - if (_connectedDevice == null) { - log('Device not connected', stackTrace: StackTrace.current); - return left(DeviceFailure.unconnectedDevice(StackTrace.current)); - } - - try { - final dataStream = await _dataStreamFromDevice( - _connectedDevice!, - _characteristicUUID, - ); - return right(dataStream); - } catch (e, s) { - log('Failed to get data stream', error: e, stackTrace: s); - return left(DeviceFailure.noDataStream(s)); - } - } - - Future _scanForDevice({ - required String platformName, - required Duration timeout, - }) async { - await FlutterBluePlus.startScan( - timeout: timeout, - androidUsesFineLocation: true, - ); - final devices = await FlutterBluePlus.onScanResults - .firstWhere( - (result) => result.any((r) => r.device.platformName == platformName), - ) - .timeout(timeout); - - final scanResult = devices.firstWhere( - (scanResult) => scanResult.device.platformName == platformName, - ); - return scanResult.device; - } - - Future>> _dataStreamFromDevice( - BluetoothDevice device, - String characteristicUUID, - ) async { - final characteristic = await _findCharacteristicByUuid( - characteristicUUID: characteristicUUID, - connectedDevice: device, - ); - - if (characteristic == null) { - log('Characteristic not found', stackTrace: StackTrace.current); - throw Exception('Characteristic not found'); - } - - await characteristic.setNotifyValue(true); - return characteristic.onValueReceived; - } - - Future _findCharacteristicByUuid({ - required String characteristicUUID, - required BluetoothDevice connectedDevice, - }) async { - final services = await connectedDevice.discoverServices(); - for (final service in services) { - final characteristics = service.characteristics; - for (final characteristic in characteristics) { - if (characteristic.uuid.toString() == characteristicUUID) { - return characteristic; - } - } - } - return null; - } -} diff --git a/lib/data/repositories/settings_repo_impl.dart b/lib/data/repositories/settings_repo_impl.dart deleted file mode 100644 index 9b30b48..0000000 --- a/lib/data/repositories/settings_repo_impl.dart +++ /dev/null @@ -1,70 +0,0 @@ -import 'dart:developer'; - -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/domain/entities/settings.dart'; -import 'package:eeg_app/domain/failures/settings_failures.dart'; -import 'package:eeg_app/domain/repositories/settings_repo.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -/// Implementation of the settings repository -class SettingsRepoImpl implements SettingsRepo { - /// Constructor for [SettingsRepoImpl] - SettingsRepoImpl() : _asyncPrefs = SharedPreferencesAsync(); - final SharedPreferencesAsync _asyncPrefs; - - @override - Future> getSettings() async { - try { - final bandPassHighCutOff = await _asyncPrefs.getDouble( - SettingsList.bandPassHighCutOff.name, - ) ?? - 30.0; - final bandPassLowCutOff = await _asyncPrefs.getDouble( - SettingsList.bandPassLowCutOff.name, - ) ?? - 0.0; - return right( - Settings( - bandPassHighCutOff: bandPassHighCutOff, - bandPassLowCutOff: bandPassLowCutOff, - ), - ); - } catch (e, s) { - log('Failed to get settings', error: e, stackTrace: s); - return left(SettingsFailures.unknown(s)); - } - } - - @override - Future> saveSettings(Settings settings) async { - try { - if (settings.bandPassLowCutOff < 0 || - settings.bandPassHighCutOff < settings.bandPassLowCutOff) { - return left( - SettingsFailures.incorrectBandPassCutOffs(StackTrace.current), - ); - } - await _asyncPrefs.setDouble( - SettingsList.bandPassHighCutOff.name, - settings.bandPassHighCutOff, - ); - await _asyncPrefs.setDouble( - SettingsList.bandPassLowCutOff.name, - settings.bandPassLowCutOff, - ); - return right(unit); - } catch (e, s) { - log('Failed to save settings', error: e, stackTrace: s); - return left(SettingsFailures.unknown(s)); - } - } -} - -/// List of settings that can be saved -enum SettingsList { - /// The low cut off frequency for the band pass filter - bandPassHighCutOff, - - /// The high cut off frequency for the band pass filter - bandPassLowCutOff, -} diff --git a/lib/domain/entities/algorithm_result.dart b/lib/domain/entities/algorithm_result.dart deleted file mode 100644 index dfd6a81..0000000 --- a/lib/domain/entities/algorithm_result.dart +++ /dev/null @@ -1,2 +0,0 @@ -/// Abstract class for all algorithm results -abstract class AlgorithmResult {} diff --git a/lib/domain/entities/settings.dart b/lib/domain/entities/settings.dart deleted file mode 100644 index 7e83ebd..0000000 --- a/lib/domain/entities/settings.dart +++ /dev/null @@ -1,25 +0,0 @@ -/// Settings entity, contains all the settings -class Settings { - /// Settings constructor - Settings({ - required this.bandPassHighCutOff, - required this.bandPassLowCutOff, - }); - - /// Band pass high cut - final double bandPassHighCutOff; - - /// Band pass low cut - final double bandPassLowCutOff; - - /// Copy with method - Settings copyWith({ - double? bandPassHighCutOff, - double? bandPassLowCutOff, - }) { - return Settings( - bandPassHighCutOff: bandPassHighCutOff ?? this.bandPassHighCutOff, - bandPassLowCutOff: bandPassLowCutOff ?? this.bandPassLowCutOff, - ); - } -} diff --git a/lib/domain/failures/device_failures.dart b/lib/domain/failures/device_failures.dart deleted file mode 100644 index 63aaa84..0000000 --- a/lib/domain/failures/device_failures.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:eeg_app/core/failure.dart'; - -/// Represents a failure related to a device. -/// -/// This is an abstract class that extends [Failure]. -/// It contains a message describing the failure. -/// It contains a stack trace to help with debugging. -sealed class DeviceFailure extends Failure { - /// Constructs a [DeviceFailure] with the given [message] and [stackTrace]. - const DeviceFailure(super.message, super.stackTrace); - - /// Factory constructor for creating a `FailedToConnectFailure` instance. - factory DeviceFailure.failedToConnect(StackTrace stackTrace) => - FailedToConnectFailure._(stackTrace); - - /// Factory constructor for creating an `UnconnectedDeviceFailure` instance. - factory DeviceFailure.unconnectedDevice(StackTrace stackTrace) => - UnconnectedDeviceFailure._(stackTrace); - - /// Factory constructor for creating a `NoDataStreamFailure` instance. - factory DeviceFailure.noDataStream(StackTrace stackTrace) => - NoDataStreamFailure._(stackTrace); - - /// Factory constructor for creating an `UnknownDeviceFailure` instance. - factory DeviceFailure.unknown(StackTrace stackTrace) => - UnknownDeviceFailure._(stackTrace); -} - -/// Represents a failure when the device fails to connect. -/// -/// This class extends [DeviceFailure] with a predefined message. -class FailedToConnectFailure extends DeviceFailure { - /// Constructs a [FailedToConnectFailure]. - const FailedToConnectFailure._(StackTrace stackTrace) - : super('Failed to connect to device', stackTrace); -} - -/// Represents a failure when no device is connected. -/// -/// This class extends [DeviceFailure] with a predefined message. -class UnconnectedDeviceFailure extends DeviceFailure { - /// Constructs an [UnconnectedDeviceFailure]. - const UnconnectedDeviceFailure._(StackTrace stackTrace) - : super('No device connected', stackTrace); -} - -/// Represents a failure when no data stream is available. -/// -/// This class extends [DeviceFailure] with a predefined message. -class NoDataStreamFailure extends DeviceFailure { - /// Constructs a [NoDataStreamFailure]. - const NoDataStreamFailure._(StackTrace stackTrace) - : super('No data stream available', stackTrace); -} - -/// Represents an unknown device failure. -/// -/// This class extends [DeviceFailure] with a predefined message. -class UnknownDeviceFailure extends DeviceFailure { - /// Constructs an [UnknownDeviceFailure]. - const UnknownDeviceFailure._(StackTrace stackTrace) - : super('Unknown device failure', stackTrace); -} diff --git a/lib/domain/failures/settings_failures.dart b/lib/domain/failures/settings_failures.dart deleted file mode 100644 index 94bfa21..0000000 --- a/lib/domain/failures/settings_failures.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:eeg_app/core/failure.dart'; - -/// Failures for the settings repository -/// -/// This is an abstract class that extends [Failure]. -/// It contains a message describing the failure. -/// It contains a stack trace to help with debugging. -sealed class SettingsFailures extends Failure { - /// Constructs a [SettingsFailures] with the given [message] and [stackTrace]. - const SettingsFailures(super.message, super.stackTrace); - - /// Factory constructor for creating - /// an `IncorrectBandPassCutOffsFailure` instance. - factory SettingsFailures.incorrectBandPassCutOffs(StackTrace stackTrace) => - IncorrectBandPassCutOffsFailure._(stackTrace); - - /// Factory constructor for creating an `UnknownSettingsFailure` instance. - factory SettingsFailures.unknown(StackTrace stackTrace) => - UnknownSettingsFailure._(stackTrace); -} - -/// Represents a failure when the band pass cut off values are incorrect. -/// -/// This class extends [SettingsFailures] with a predefined message. -class IncorrectBandPassCutOffsFailure extends SettingsFailures { - const IncorrectBandPassCutOffsFailure._(StackTrace stackTrace) - : super('Incorrect band pass cut off values', stackTrace); -} - -/// Represents an unknown settings failure. -/// -/// This class extends [SettingsFailures] with a predefined message. -class UnknownSettingsFailure extends SettingsFailures { - const UnknownSettingsFailure._(StackTrace stackTrace) - : super('Unknown settings failure', stackTrace); -} diff --git a/lib/domain/providers/connect_use_case.dart b/lib/domain/providers/connect_use_case.dart deleted file mode 100644 index a764d21..0000000 --- a/lib/domain/providers/connect_use_case.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/data/providers/device_repo_impl_provider.dart'; -import 'package:eeg_app/domain/use_cases/connect_use_case.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'connect_use_case.g.dart'; - -/// A provider that creates a [ConnectUseCase]. -@riverpod -UseCase connectUseCase(Ref ref) { - final deviceRepo = ref.read(deviceRepoProvider); - return ConnectUseCase(deviceRepo); -} diff --git a/lib/domain/providers/connect_use_case.g.dart b/lib/domain/providers/connect_use_case.g.dart deleted file mode 100644 index 4f44d20..0000000 --- a/lib/domain/providers/connect_use_case.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'connect_use_case.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$connectUseCaseHash() => r'e2dbc1c2677dddf86019d2539fafd2c6b7b0929d'; - -/// A provider that creates a [ConnectUseCase]. -/// -/// Copied from [connectUseCase]. -@ProviderFor(connectUseCase) -final connectUseCaseProvider = - AutoDisposeProvider>.internal( - connectUseCase, - name: r'connectUseCaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$connectUseCaseHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef ConnectUseCaseRef = AutoDisposeProviderRef>; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/domain/providers/disconnect_use_case.dart b/lib/domain/providers/disconnect_use_case.dart deleted file mode 100644 index c557976..0000000 --- a/lib/domain/providers/disconnect_use_case.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/data/providers/device_repo_impl_provider.dart'; -import 'package:eeg_app/domain/use_cases/disconnect_use_case.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'disconnect_use_case.g.dart'; - -/// A provider that creates a [DisconnectUseCase]. -@riverpod -UseCase disconnectUseCase(Ref ref) { - final deviceRepo = ref.read(deviceRepoProvider); - return DisconnectUseCase(deviceRepo); -} diff --git a/lib/domain/providers/disconnect_use_case.g.dart b/lib/domain/providers/disconnect_use_case.g.dart deleted file mode 100644 index 06eee9e..0000000 --- a/lib/domain/providers/disconnect_use_case.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'disconnect_use_case.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$disconnectUseCaseHash() => r'ae10fc4d4b0d2e3167a45630c726db74f083c117'; - -/// A provider that creates a [DisconnectUseCase]. -/// -/// Copied from [disconnectUseCase]. -@ProviderFor(disconnectUseCase) -final disconnectUseCaseProvider = - AutoDisposeProvider>.internal( - disconnectUseCase, - name: r'disconnectUseCaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$disconnectUseCaseHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef DisconnectUseCaseRef = AutoDisposeProviderRef>; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/domain/providers/get_processed_data_stream_use_case.dart b/lib/domain/providers/get_processed_data_stream_use_case.dart deleted file mode 100644 index 99b7551..0000000 --- a/lib/domain/providers/get_processed_data_stream_use_case.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/data/providers/device_repo_impl_provider.dart'; -import 'package:eeg_app/domain/use_cases/get_processed_data_stream_use_case.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'get_processed_data_stream_use_case.g.dart'; - -/// A provider that creates a []. -@riverpod -UseCase>>, NoParams> getProcessedDataStreamUseCase( - Ref ref, -) { - final deviceRepo = ref.read(deviceRepoProvider); - return GetProcessedDataStreamUseCase(deviceRepo); -} diff --git a/lib/domain/providers/get_processed_data_stream_use_case.g.dart b/lib/domain/providers/get_processed_data_stream_use_case.g.dart deleted file mode 100644 index 6627650..0000000 --- a/lib/domain/providers/get_processed_data_stream_use_case.g.dart +++ /dev/null @@ -1,32 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'get_processed_data_stream_use_case.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$getProcessedDataStreamUseCaseHash() => - r'1fe4eb7bf33ba320b242dfbaeaf1b45538c4e629'; - -/// A provider that creates a []. -/// -/// Copied from [getProcessedDataStreamUseCase]. -@ProviderFor(getProcessedDataStreamUseCase) -final getProcessedDataStreamUseCaseProvider = - AutoDisposeProvider>>, NoParams>>.internal( - getProcessedDataStreamUseCase, - name: r'getProcessedDataStreamUseCaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$getProcessedDataStreamUseCaseHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef GetProcessedDataStreamUseCaseRef - = AutoDisposeProviderRef>>, NoParams>>; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/domain/providers/get_settings_use_case.dart b/lib/domain/providers/get_settings_use_case.dart deleted file mode 100644 index a1d011e..0000000 --- a/lib/domain/providers/get_settings_use_case.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:eeg_app/data/providers/settings_repo_impl_provider.dart'; -import 'package:eeg_app/domain/use_cases/get_settings_use_case.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'get_settings_use_case.g.dart'; - -/// Get settings provider for the use case [GetSettings] -@riverpod -GetSettings getSettingsUseCase(Ref ref) { - final settindsRepo = ref.read(settingsRepoProvider); - return GetSettings(settindsRepo); -} diff --git a/lib/domain/providers/get_settings_use_case.g.dart b/lib/domain/providers/get_settings_use_case.g.dart deleted file mode 100644 index 669eb2d..0000000 --- a/lib/domain/providers/get_settings_use_case.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'get_settings_use_case.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$getSettingsUseCaseHash() => - r'0934ff77ad8d412a9e5cbc884591b7b7f4f3efc9'; - -/// Get settings provider for the use case [GetSettings] -/// -/// Copied from [getSettingsUseCase]. -@ProviderFor(getSettingsUseCase) -final getSettingsUseCaseProvider = AutoDisposeProvider.internal( - getSettingsUseCase, - name: r'getSettingsUseCaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$getSettingsUseCaseHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef GetSettingsUseCaseRef = AutoDisposeProviderRef; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/domain/providers/save_settings_use_case.dart b/lib/domain/providers/save_settings_use_case.dart deleted file mode 100644 index ec89e96..0000000 --- a/lib/domain/providers/save_settings_use_case.dart +++ /dev/null @@ -1,13 +0,0 @@ -import 'package:eeg_app/data/providers/settings_repo_impl_provider.dart'; -import 'package:eeg_app/domain/use_cases/save_settings_use_case.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'save_settings_use_case.g.dart'; - -/// Save settings provider for the use case [SaveSettings] -@riverpod -SaveSettings saveSettingsUseCase(Ref ref) { - final settindsRepo = ref.read(settingsRepoProvider); - return SaveSettings(settindsRepo); -} diff --git a/lib/domain/providers/save_settings_use_case.g.dart b/lib/domain/providers/save_settings_use_case.g.dart deleted file mode 100644 index d361ecf..0000000 --- a/lib/domain/providers/save_settings_use_case.g.dart +++ /dev/null @@ -1,30 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'save_settings_use_case.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$saveSettingsUseCaseHash() => - r'62d33514a71fcfeaa656e897bae5ac66c4a2e13f'; - -/// Save settings provider for the use case [SaveSettings] -/// -/// Copied from [saveSettingsUseCase]. -@ProviderFor(saveSettingsUseCase) -final saveSettingsUseCaseProvider = AutoDisposeProvider.internal( - saveSettingsUseCase, - name: r'saveSettingsUseCaseProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$saveSettingsUseCaseHash, - dependencies: null, - allTransitiveDependencies: null, -); - -@Deprecated('Will be removed in 3.0. Use Ref instead') -// ignore: unused_element -typedef SaveSettingsUseCaseRef = AutoDisposeProviderRef; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/domain/repositories/device_repo.dart b/lib/domain/repositories/device_repo.dart deleted file mode 100644 index cf73265..0000000 --- a/lib/domain/repositories/device_repo.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/domain/failures/device_failures.dart'; - -/// Abstract class for device repository. -abstract class DeviceRepo { - /// Connects to a device. - Future> connect(); - - /// Disconnects from the connected device. - Future> disconnect(); - - /// Returns a stream of data from the connected device. - Future>>> getDataStream(); -} diff --git a/lib/domain/repositories/settings_repo.dart b/lib/domain/repositories/settings_repo.dart deleted file mode 100644 index 02a1026..0000000 --- a/lib/domain/repositories/settings_repo.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/domain/entities/settings.dart'; -import 'package:eeg_app/domain/failures/settings_failures.dart'; - -/// Abstract class for the settings repository -abstract class SettingsRepo { - /// Save the settings locally - Future> saveSettings(Settings settings); - - /// Get the settings - Future> getSettings(); -} diff --git a/lib/domain/use_cases/connect_use_case.dart b/lib/domain/use_cases/connect_use_case.dart deleted file mode 100644 index 28c12f1..0000000 --- a/lib/domain/use_cases/connect_use_case.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/repositories/device_repo.dart'; - -/// A use case that connects to the BLE device. -class ConnectUseCase implements UseCase { - /// Constructs a [ConnectUseCase] with the given [DeviceRepo]. - ConnectUseCase(this._deviceRepo); - - final DeviceRepo _deviceRepo; - - @override - Future> call(NoParams params) { - return _deviceRepo.connect(); - } -} diff --git a/lib/domain/use_cases/disconnect_use_case.dart b/lib/domain/use_cases/disconnect_use_case.dart deleted file mode 100644 index 96300d8..0000000 --- a/lib/domain/use_cases/disconnect_use_case.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/repositories/device_repo.dart'; - -/// A use case that disconnects from the BLE device. -class DisconnectUseCase implements UseCase { - /// Constructs a [DisconnectUseCase] with the given [DeviceRepo]. - DisconnectUseCase(this._deviceRepo); - - final DeviceRepo _deviceRepo; - - @override - Future> call(NoParams params) { - return _deviceRepo.disconnect(); - } -} diff --git a/lib/domain/use_cases/get_processed_data_stream_use_case.dart b/lib/domain/use_cases/get_processed_data_stream_use_case.dart deleted file mode 100644 index bdc6429..0000000 --- a/lib/domain/use_cases/get_processed_data_stream_use_case.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/repositories/device_repo.dart'; - -/// A use case that gets a stream of processed data. -class GetProcessedDataStreamUseCase - implements UseCase>>, NoParams> { - /// Constructs a [GetProcessedDataStreamUseCase] with the given [DeviceRepo]. - GetProcessedDataStreamUseCase(this._deviceRepo); - - final DeviceRepo _deviceRepo; - - @override - Future>>>> call( - NoParams params, - ) async { - // Get the data stream result from the repository - final dataStreamResult = await _deviceRepo.getDataStream(); - - // Handle the Either result - return Future.value( - dataStreamResult.fold( - (failure) { - // If there's a failure, return an empty stream wrapped in Right - return const Right(Stream>>.empty()); - }, - (dataStream) { - // Process the data stream - final processedDataStream = - dataStream.map>>((data) { - return [data.map((e) => e.toDouble()).toList()]; - }); - - // Return the processed data stream wrapped in Right - return Right(processedDataStream); - }, - ), - ); - } -} diff --git a/lib/domain/use_cases/get_settings_use_case.dart b/lib/domain/use_cases/get_settings_use_case.dart deleted file mode 100644 index 92e7d00..0000000 --- a/lib/domain/use_cases/get_settings_use_case.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/entities/settings.dart'; -import 'package:eeg_app/domain/repositories/settings_repo.dart'; - -/// A use case that gets the settings. -class GetSettings implements UseCase { - /// Constructs a [GetSettings] with the given [SettingsRepo]. - const GetSettings(this._settingsRepo); - - final SettingsRepo _settingsRepo; - - @override - Future> call(NoParams params) { - return _settingsRepo.getSettings(); - } -} diff --git a/lib/domain/use_cases/save_settings_use_case.dart b/lib/domain/use_cases/save_settings_use_case.dart deleted file mode 100644 index af2a5d4..0000000 --- a/lib/domain/use_cases/save_settings_use_case.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/entities/settings.dart'; -import 'package:eeg_app/domain/repositories/settings_repo.dart'; - -/// A use case that saves the settings. -class SaveSettings implements UseCase { - /// Constructs a [SaveSettings] with the given [SettingsRepo]. - const SaveSettings(this._settingsRepo); - - final SettingsRepo _settingsRepo; - - @override - Future> call(Params params) { - return _settingsRepo.saveSettings(params.settings); - } -} - -/// Parameters for the [SaveSettings] use case. -class Params { - /// Constructs a [Params] with the given [Settings]. - Params(this.settings); - - /// The settings to save. - final Settings settings; -} diff --git a/lib/main.dart b/lib/main.dart index b1f2ae5..3b859c8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,15 +1,11 @@ -import 'package:eeg_app/presentation/pages/main_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; void main() { - runApp(const ProviderScope(child: MyApp())); + runApp(const MyApp()); } -/// This is the main application widget. class MyApp extends StatelessWidget { - /// The main application widget constructor. const MyApp({super.key}); // This widget is the root of your application. @@ -38,7 +34,95 @@ class MyApp extends StatelessWidget { colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), - home: const MainPage(), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +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++; + }); + } + + @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(AppLocalizations.of(context)!.helloWorld), + ), + 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. ); } } diff --git a/lib/presentation/notifiers/processed_data.dart b/lib/presentation/notifiers/processed_data.dart deleted file mode 100644 index 6394a59..0000000 --- a/lib/presentation/notifiers/processed_data.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/providers/get_processed_data_stream_use_case.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'processed_data.g.dart'; - -/// Notifier to store the processed data -@riverpod -class ProcessedDataNotifier extends _$ProcessedDataNotifier { - @override - Future>> build() { - return Future.value(List.generate(4, (i) => [])); - } - - /// Start listening for data - Future startListeningForData() async { - final getProcessedDataStreamUseCase = - ref.read(getProcessedDataStreamUseCaseProvider); - final result = await getProcessedDataStreamUseCase(NoParams()); - - result.fold( - (failure) { - state = AsyncError(failure, failure.stackTrace); - }, - (dataStream) { - dataStream.listen( - (data) { - state = AsyncData(data); - }, - ); - }, - ); - } -} diff --git a/lib/presentation/notifiers/processed_data.g.dart b/lib/presentation/notifiers/processed_data.g.dart deleted file mode 100644 index f4602c4..0000000 --- a/lib/presentation/notifiers/processed_data.g.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'processed_data.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$processedDataNotifierHash() => - r'1b111300fa753ab274659eaacb55235432a9bb06'; - -/// Notifier to store the processed data -/// -/// Copied from [ProcessedDataNotifier]. -@ProviderFor(ProcessedDataNotifier) -final processedDataNotifierProvider = AutoDisposeAsyncNotifierProvider< - ProcessedDataNotifier, List>>.internal( - ProcessedDataNotifier.new, - name: r'processedDataNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$processedDataNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$ProcessedDataNotifier = AutoDisposeAsyncNotifier>>; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/presentation/notifiers/settings.dart b/lib/presentation/notifiers/settings.dart deleted file mode 100644 index b64cfef..0000000 --- a/lib/presentation/notifiers/settings.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'package:dartz/dartz.dart'; -import 'package:eeg_app/core/failure.dart'; -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/entities/settings.dart'; -import 'package:eeg_app/domain/providers/get_settings_use_case.dart'; -import 'package:eeg_app/domain/providers/save_settings_use_case.dart'; -import 'package:eeg_app/domain/use_cases/save_settings_use_case.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; - -part 'settings.g.dart'; - -/// Notifier for settings -@riverpod -class SettingsNotifier extends _$SettingsNotifier { - @override - Future build() async { - final getSettingsUseCase = ref.read(getSettingsUseCaseProvider); - final settings = await getSettingsUseCase(NoParams()); - return settings.fold( - (failure) { - throw Exception(failure.message); - }, - (data) { - return data; - }, - ); - } - - /// Save the settings - /// - /// [settings] The settings to save - Future> saveSettings(Settings settings) { - final saveSettingsUseCase = ref.read(saveSettingsUseCaseProvider); - final params = Params(settings); - return saveSettingsUseCase(params); - } -} diff --git a/lib/presentation/notifiers/settings.g.dart b/lib/presentation/notifiers/settings.g.dart deleted file mode 100644 index 5c33e31..0000000 --- a/lib/presentation/notifiers/settings.g.dart +++ /dev/null @@ -1,28 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'settings.dart'; - -// ************************************************************************** -// RiverpodGenerator -// ************************************************************************** - -String _$settingsNotifierHash() => r'03a45bf795e34395e1ac723f45fdfa6e4ae0fa83'; - -/// Notifier for settings -/// -/// Copied from [SettingsNotifier]. -@ProviderFor(SettingsNotifier) -final settingsNotifierProvider = - AutoDisposeAsyncNotifierProvider.internal( - SettingsNotifier.new, - name: r'settingsNotifierProvider', - debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') - ? null - : _$settingsNotifierHash, - dependencies: null, - allTransitiveDependencies: null, -); - -typedef _$SettingsNotifier = AutoDisposeAsyncNotifier; -// ignore_for_file: type=lint -// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/presentation/pages/main_page.dart b/lib/presentation/pages/main_page.dart deleted file mode 100644 index db6d883..0000000 --- a/lib/presentation/pages/main_page.dart +++ /dev/null @@ -1,111 +0,0 @@ -import 'package:eeg_app/core/use_case.dart'; -import 'package:eeg_app/domain/providers/connect_use_case.dart'; -import 'package:eeg_app/domain/providers/disconnect_use_case.dart'; -import 'package:eeg_app/presentation/notifiers/processed_data.dart'; -import 'package:eeg_app/presentation/widgets/settings_dialog.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; - -/// Main page of the app -class MainPage extends ConsumerWidget { - /// Default constructor - const MainPage({super.key}); - - @override - Widget build(BuildContext context, WidgetRef ref) { - final connectDeviceUseCase = ref.read(connectUseCaseProvider); - final disconnectDeviceUseCase = ref.read(disconnectUseCaseProvider); - final processedData = ref.watch(processedDataNotifierProvider); - final processedDataNotifier = - ref.read(processedDataNotifierProvider.notifier); - return Scaffold( - appBar: AppBar( - title: const Text('EEG App'), - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ElevatedButton( - onPressed: () async { - final result = await connectDeviceUseCase(NoParams()); - result.fold( - (failure) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(failure.message), - ), - ); - }, - (data) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Successfully connected to the device!'), - duration: Duration( - seconds: 2, - ), - ), - ); - processedDataNotifier.startListeningForData(); - }, - ); - }, - child: const Text('Connect'), - ), - const SizedBox(height: 20), - ElevatedButton( - onPressed: () async { - final result = await disconnectDeviceUseCase(NoParams()); - result.fold( - (failure) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(failure.message), - ), - ); - }, - (data) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Successfully disconnected!'), - duration: Duration( - seconds: 2, - ), - ), - ); - }, - ); - }, - child: const Text('Disconnect'), - ), - const SizedBox(height: 20), - ElevatedButton( - onPressed: () { - showDialog( - context: context, - builder: (context) { - return SettingsDialog(); - }, - ); - }, - child: const Text('Settings'), - ), - const SizedBox(height: 20), - processedData.when( - data: (data) { - return Column( - children: List.generate( - data.length, - (i) => Text('Channel $i: ${data[i]}'), - ), - ); - }, - error: (error, stackTrace) => Text('Error: $error'), - loading: () => const CircularProgressIndicator(), - ), - ], - ), - ), - ); - } -} diff --git a/lib/presentation/widgets/settings_dialog.dart b/lib/presentation/widgets/settings_dialog.dart deleted file mode 100644 index 6ddfbf6..0000000 --- a/lib/presentation/widgets/settings_dialog.dart +++ /dev/null @@ -1,90 +0,0 @@ -import 'package:eeg_app/presentation/notifiers/settings.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; - -/// Dialog for settings -class SettingsDialog extends ConsumerWidget { - /// Default constructor - SettingsDialog({super.key}); - - final _bandPassHighCutOffController = TextEditingController(); - final _bandPassLowCutOffController = TextEditingController(); - - @override - Widget build(BuildContext context, WidgetRef ref) { - final settings = ref.watch(settingsNotifierProvider); - final settingsNotifier = ref.read(settingsNotifierProvider.notifier); - return settings.when( - data: (data) { - _bandPassHighCutOffController.text = data.bandPassHighCutOff.toString(); - _bandPassLowCutOffController.text = data.bandPassLowCutOff.toString(); - return AlertDialog( - title: const Text('Settings'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextField( - controller: _bandPassHighCutOffController, - decoration: const InputDecoration( - labelText: 'Band Pass High Cut Off', - ), - keyboardType: TextInputType.number, - ), - TextField( - controller: _bandPassLowCutOffController, - decoration: const InputDecoration( - labelText: 'Band Pass Low Cut Off', - ), - keyboardType: TextInputType.number, - ), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: const Text('Cancel'), - ), - TextButton( - onPressed: () async { - final newSettings = data.copyWith( - bandPassHighCutOff: - double.tryParse(_bandPassHighCutOffController.text), - bandPassLowCutOff: - double.tryParse(_bandPassLowCutOffController.text), - ); - final result = await settingsNotifier.saveSettings(newSettings); - result.fold( - (failure) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(failure.message), - ), - ); - }, - (_) { - Navigator.of(context).pop(); - }, - ); - }, - child: const Text('Confirm'), - ), - ], - ); - }, - error: (e, s) { - return AlertDialog( - title: const Text('Error'), - content: Text(e.toString()), - ); - }, - loading: () { - return const AlertDialog( - title: Text('Loading'), - content: Center(child: CircularProgressIndicator()), - ); - }, - ); - } -} diff --git a/macos/Flutter/Flutter-Debug.xcconfig b/macos/Flutter/Flutter-Debug.xcconfig index 4b81f9b..c2efd0b 100644 --- a/macos/Flutter/Flutter-Debug.xcconfig +++ b/macos/Flutter/Flutter-Debug.xcconfig @@ -1,2 +1 @@ -#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 5caa9d1..c2efd0b 100644 --- a/macos/Flutter/Flutter-Release.xcconfig +++ b/macos/Flutter/Flutter-Release.xcconfig @@ -1,2 +1 @@ -#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 194ebba..cccf817 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,6 @@ import FlutterMacOS import Foundation -import flutter_blue_plus -import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FlutterBluePlusPlugin.register(with: registry.registrar(forPlugin: "FlutterBluePlusPlugin")) - SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/macos/Podfile b/macos/Podfile deleted file mode 100644 index c795730..0000000 --- a/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -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! - use_modular_headers! - - 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/macos/Podfile.lock b/macos/Podfile.lock deleted file mode 100644 index b3b9986..0000000 --- a/macos/Podfile.lock +++ /dev/null @@ -1,22 +0,0 @@ -PODS: - - flutter_blue_plus (0.0.1): - - FlutterMacOS - - FlutterMacOS (1.0.0) - -DEPENDENCIES: - - flutter_blue_plus (from `Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus/macos`) - - FlutterMacOS (from `Flutter/ephemeral`) - -EXTERNAL SOURCES: - flutter_blue_plus: - :path: Flutter/ephemeral/.symlinks/plugins/flutter_blue_plus/macos - FlutterMacOS: - :path: Flutter/ephemeral - -SPEC CHECKSUMS: - flutter_blue_plus: e2868679021f19d12a8c0c58a33f1df66ec7fa6a - FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - -PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 - -COCOAPODS: 1.15.2 diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 29fd96e..d85210d 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -27,8 +27,6 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 847A1D13156623166CC10128 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B2A4D9C6ED0A8DD94C913E5 /* Pods_RunnerTests.framework */; }; - D06D3BBE099F184A7D62AD74 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4570ECE24105F2C5C10FF81D /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,13 +60,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 145C65043BB8F1D99F3C059F /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 2024E51EAFC55F7B1496F011 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* eeg_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = eeg_app.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* eeg_app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "eeg_app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -80,14 +76,8 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 38C0BBF375D463226EBF25F0 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - 4570ECE24105F2C5C10FF81D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5FE0E8FB2275A27D88F51507 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 7B2A4D9C6ED0A8DD94C913E5 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - CEECC60DEDD9EFD1379A344F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - D6A416EAEACDD36690FF10A1 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,7 +85,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 847A1D13156623166CC10128 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,7 +92,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D06D3BBE099F184A7D62AD74 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,7 +125,6 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - 820A5A37C8C06432ABBDC9D9 /* Pods */, ); sourceTree = ""; }; @@ -185,25 +172,9 @@ path = Runner; sourceTree = ""; }; - 820A5A37C8C06432ABBDC9D9 /* Pods */ = { - isa = PBXGroup; - children = ( - CEECC60DEDD9EFD1379A344F /* Pods-Runner.debug.xcconfig */, - 2024E51EAFC55F7B1496F011 /* Pods-Runner.release.xcconfig */, - 5FE0E8FB2275A27D88F51507 /* Pods-Runner.profile.xcconfig */, - 145C65043BB8F1D99F3C059F /* Pods-RunnerTests.debug.xcconfig */, - D6A416EAEACDD36690FF10A1 /* Pods-RunnerTests.release.xcconfig */, - 38C0BBF375D463226EBF25F0 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 4570ECE24105F2C5C10FF81D /* Pods_Runner.framework */, - 7B2A4D9C6ED0A8DD94C913E5 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -215,7 +186,6 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 0D0174472EC8E52778EDE9E2 /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -234,13 +204,11 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - B285E5D8B2D6C04666E3553F /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - 2ECF136AFDEED8EF489F34FB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -323,45 +291,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0D0174472EC8E52778EDE9E2 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 2ECF136AFDEED8EF489F34FB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -400,28 +329,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - B285E5D8B2D6C04666E3553F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -473,7 +380,6 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 145C65043BB8F1D99F3C059F /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -488,7 +394,6 @@ }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = D6A416EAEACDD36690FF10A1 /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; @@ -503,7 +408,6 @@ }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 38C0BBF375D463226EBF25F0 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; diff --git a/macos/Runner.xcworkspace/contents.xcworkspacedata b/macos/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc1..1d526a1 100644 --- a/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/pubspec.lock b/pubspec.lock index a0fd428..6bb54a9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,43 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 - url: "https://pub.dev" - source: hosted - version: "72.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.2" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 - url: "https://pub.dev" - source: hosted - version: "6.7.0" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" - url: "https://pub.dev" - source: hosted - version: "0.11.3" - args: - dependency: transitive - description: - name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 - url: "https://pub.dev" - source: hosted - version: "2.6.0" async: dependency: transitive description: @@ -54,70 +17,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - build: - dependency: transitive - description: - name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - build_config: - dependency: transitive - description: - name: build_config - sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 - url: "https://pub.dev" - source: hosted - version: "1.1.1" - build_daemon: - dependency: transitive - description: - name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" - url: "https://pub.dev" - source: hosted - version: "2.4.2" - build_runner: - dependency: "direct dev" - description: - name: build_runner - sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" - url: "https://pub.dev" - source: hosted - version: "2.4.13" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 - url: "https://pub.dev" - source: hosted - version: "7.3.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: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb - url: "https://pub.dev" - source: hosted - version: "8.9.2" characters: dependency: transitive description: @@ -126,30 +25,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" - ci: - dependency: transitive - description: - name: ci - sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" - url: "https://pub.dev" - source: hosted - version: "0.1.0" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c - url: "https://pub.dev" - source: hosted - version: "0.4.2" clock: dependency: transitive description: @@ -158,14 +33,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - code_builder: - dependency: transitive - description: - name: code_builder - sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" - url: "https://pub.dev" - source: hosted - version: "4.10.1" collection: dependency: transitive description: @@ -174,22 +41,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" - 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: @@ -198,62 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" - custom_lint: - dependency: "direct dev" - description: - name: custom_lint - sha256: "3486c470bb93313a9417f926c7dd694a2e349220992d7b9d14534dc49c15bba9" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - custom_lint_builder: - dependency: transitive - description: - name: custom_lint_builder - sha256: "42cdc41994eeeddab0d7a722c7093ec52bd0761921eeb2cbdbf33d192a234759" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - custom_lint_core: - dependency: transitive - description: - name: custom_lint_core - sha256: "02450c3e45e2a6e8b26c4d16687596ab3c4644dd5792e3313aa9ceba5a49b7f5" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - custom_lint_visitor: - dependency: transitive - description: - name: custom_lint_visitor - sha256: "8aeb3b6ae2bb765e7716b93d1d10e8356d04e0ff6d7592de6ee04e0dd7d6587d" - url: "https://pub.dev" - source: hosted - version: "1.0.0+6.7.0" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" - url: "https://pub.dev" - source: hosted - version: "2.3.7" - dartz: - dependency: "direct main" - description: - name: dartz - sha256: e6acf34ad2e31b1eb00948692468c30ab48ac8250e0f0df661e29f12dd252168 - url: "https://pub.dev" - source: hosted - version: "0.10.1" - equatable: - dependency: "direct main" - description: - name: equatable - sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 - url: "https://pub.dev" - source: hosted - version: "2.0.5" fake_async: dependency: transitive description: @@ -262,51 +57,11 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" - url: "https://pub.dev" - source: hosted - version: "2.1.3" - 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" - fl_chart: - dependency: "direct main" - description: - name: fl_chart - sha256: "94307bef3a324a0d329d3ab77b2f0c6e5ed739185ffc029ed28c0f9b019ea7ef" - url: "https://pub.dev" - source: hosted - version: "0.69.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_blue_plus: - dependency: "direct main" - description: - name: flutter_blue_plus - sha256: "45ccee4a838f321c301b6130fbf3de28f07a2d6334a69eb5e13b6f83683080e0" - url: "https://pub.dev" - source: hosted - version: "1.33.6" flutter_lints: dependency: "direct dev" description: @@ -320,80 +75,11 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_riverpod: - dependency: "direct main" - description: - name: flutter_riverpod - sha256: "9532ee6db4a943a1ed8383072a2e3eeda041db5657cdf6d2acecf3c21ecbe7e1" - url: "https://pub.dev" - source: hosted - version: "2.6.1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - freezed_annotation: - dependency: transitive - 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" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - graphs: - dependency: transitive - description: - name: graphs - sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - hotreloader: - dependency: transitive - description: - name: hotreloader - sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e - url: "https://pub.dev" - source: hosted - version: "4.2.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" intl: dependency: "direct main" description: @@ -402,30 +88,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.19.0" - io: - dependency: transitive - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.dev" - source: hosted - version: "4.9.0" leak_tracker: dependency: transitive description: @@ -458,22 +120,6 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.0" - logging: - dependency: transitive - description: - name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - macros: - dependency: transitive - description: - name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" - url: "https://pub.dev" - source: hosted - version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -498,22 +144,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.15.0" - mime: - dependency: transitive - description: - name: mime - sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.dev" - source: hosted - version: "2.0.0" - package_config: - dependency: transitive - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" path: dependency: transitive description: @@ -522,203 +152,11 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.dev" - source: hosted - version: "2.3.0" - platform: - dependency: transitive - description: - name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.dev" - source: hosted - version: "3.1.6" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 - url: "https://pub.dev" - source: hosted - version: "1.3.0" - riverpod: - dependency: transitive - description: - name: riverpod - sha256: "59062512288d3056b2321804332a13ffdd1bf16df70dcc8e506e411280a72959" - url: "https://pub.dev" - source: hosted - version: "2.6.1" - riverpod_analyzer_utils: - dependency: transitive - description: - name: riverpod_analyzer_utils - sha256: dc53a659cb543b203cdc35cd4e942ed08ea893eb6ef12029301323bdf18c5d95 - url: "https://pub.dev" - source: hosted - version: "0.5.7" - riverpod_annotation: - dependency: "direct main" - description: - name: riverpod_annotation - sha256: e14b0bf45b71326654e2705d462f21b958f987087be850afd60578fcd502d1b8 - url: "https://pub.dev" - source: hosted - version: "2.6.1" - riverpod_generator: - dependency: "direct dev" - description: - name: riverpod_generator - sha256: "54458dac2fea976990dc9ed379060db6ae5c8790143f1963fedd0fb99980a326" - url: "https://pub.dev" - source: hosted - version: "2.6.2" - riverpod_lint: - dependency: "direct dev" - description: - name: riverpod_lint - sha256: "326efc199b87f21053b9a2afbf2aea26c41b3bf6f8ba346ce69126ee17d16ebd" - url: "https://pub.dev" - source: hosted - version: "2.6.2" - rxdart: - dependency: transitive - description: - name: rxdart - sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" - url: "https://pub.dev" - source: hosted - version: "0.28.0" - shared_preferences: - dependency: "direct main" - description: - name: shared_preferences - sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" - url: "https://pub.dev" - source: hosted - version: "2.3.3" - shared_preferences_android: - dependency: transitive - description: - name: shared_preferences_android - sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" - url: "https://pub.dev" - source: hosted - version: "2.3.3" - shared_preferences_foundation: - dependency: transitive - description: - name: shared_preferences_foundation - sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d" - url: "https://pub.dev" - source: hosted - version: "2.5.3" - 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: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e - url: "https://pub.dev" - source: hosted - version: "2.4.2" - 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: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" - source: hosted - version: "1.4.1" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" - url: "https://pub.dev" - source: hosted - version: "2.0.0" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" - url: "https://pub.dev" - source: hosted - version: "1.5.0" source_span: dependency: transitive description: @@ -727,14 +165,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" - sprintf: - dependency: transitive - description: - name: sprintf - sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" - url: "https://pub.dev" - source: hosted - version: "7.0.0" stack_trace: dependency: transitive description: @@ -743,14 +173,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" - state_notifier: - dependency: transitive - description: - name: state_notifier - sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb - url: "https://pub.dev" - source: hosted - version: "1.0.0" stream_channel: dependency: transitive description: @@ -759,14 +181,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" - stream_transform: - dependency: transitive - description: - name: stream_transform - sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" - url: "https://pub.dev" - source: hosted - version: "2.1.0" string_scanner: dependency: transitive description: @@ -791,30 +205,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.2" - timing: - dependency: transitive - description: - name: timing - sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - uuid: - dependency: transitive - description: - name: uuid - sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff - url: "https://pub.dev" - source: hosted - version: "4.5.1" vector_math: dependency: transitive description: @@ -839,54 +229,6 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web: - dependency: transitive - description: - name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" - url: "https://pub.dev" - source: hosted - version: "0.1.6" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - yaml: - dependency: transitive - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" sdks: dart: ">=3.5.4 <4.0.0" - flutter: ">=3.24.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 83b23d5..2f7a5a1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,35 +28,27 @@ environment: # 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 - dartz: ^0.10.1 - equatable: ^2.0.5 - fl_chart: ^0.69.0 - flutter: - sdk: flutter - flutter_blue_plus: ^1.33.6 flutter_localizations: sdk: flutter - flutter_riverpod: ^2.6.1 intl: any - riverpod_annotation: ^2.6.1 - shared_preferences: ^2.3.3 dev_dependencies: - build_runner: ^2.4.13 - custom_lint: ^0.7.0 + 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: ^4.0.0 - flutter_test: - sdk: flutter - riverpod_generator: ^2.6.2 - riverpod_lint: ^2.6.2 very_good_analysis: ^6.0.0 # For information on the generic Dart part of this file, see the diff --git a/test/placeholder_test.dart b/test/placeholder_test.dart deleted file mode 100644 index 962a494..0000000 --- a/test/placeholder_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('Placeholder test', () { - expect(true, isTrue); - }); -} diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..b308a69 --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:eeg_app/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}