From d054a1a216ff4d69428549a201008236daf87518 Mon Sep 17 00:00:00 2001 From: Aman Yadav Date: Wed, 16 Mar 2022 12:22:23 +0530 Subject: [PATCH 1/4] feat:add feature to show password --- android/app/build.gradle | 2 +- android/build.gradle | 12 +- lib/screens/loginScreen.dart | 16 ++- lib/screens/registerScreen.dart | 31 +++++- pubspec.lock | 187 ++++++++++++++++++-------------- 5 files changed, 154 insertions(+), 94 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4c9cc7c..374cc4e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' diff --git a/android/build.gradle b/android/build.gradle index b4c2aa8..1a1052f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.0' + classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,18 +14,16 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { project.evaluationDependsOn(':app') } task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/lib/screens/loginScreen.dart b/lib/screens/loginScreen.dart index c63cf22..8a25b2d 100644 --- a/lib/screens/loginScreen.dart +++ b/lib/screens/loginScreen.dart @@ -30,6 +30,7 @@ class _LoginScreenState extends State { String _username; String _password; bool _wrongCredentials = false; + bool _isObscure = true; Future _showDialogbox(String message) async { _logger.i('Showing dialog'); @@ -95,9 +96,22 @@ class _LoginScreenState extends State { // Password TextFormField( - obscureText: true, + obscureText: _isObscure, decoration: inputDecoration.copyWith( labelText: 'Password', + suffixIcon: IconButton( + icon: Icon( + _isObscure + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.white, + ), + onPressed: () { + setState(() { + _isObscure = !_isObscure; + }); + }, + ), ), // validator: (value) { // return validator.validatePassword(value); diff --git a/lib/screens/registerScreen.dart b/lib/screens/registerScreen.dart index cedb89e..5a95767 100644 --- a/lib/screens/registerScreen.dart +++ b/lib/screens/registerScreen.dart @@ -31,6 +31,7 @@ class _RegisterScreenState extends State { bool _acceptedTerms = false; bool _acceptedPrivacy = false; bool _showError = false; + bool _isObscure = true; Future _showDialogbox(String message) async { _logger.i('Showing dialog'); @@ -113,9 +114,22 @@ class _RegisterScreenState extends State { // Password TextFormField( - obscureText: true, + obscureText: _isObscure, decoration: inputDecoration.copyWith( labelText: 'Password', + suffixIcon: IconButton( + icon: Icon( + _isObscure + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.white, + ), + onPressed: () { + setState(() { + _isObscure = !_isObscure; + }); + }, + ), ), // validator: (value) { // return validator.validatePassword(value); @@ -131,9 +145,22 @@ class _RegisterScreenState extends State { // Confirm Password TextFormField( - obscureText: true, + obscureText: _isObscure, decoration: inputDecoration.copyWith( labelText: 'Password', + suffixIcon: IconButton( + icon: Icon( + _isObscure + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.white, + ), + onPressed: () { + setState(() { + _isObscure = !_isObscure; + }); + }, + ), ), validator: (value) { if (_confirmPassword.compareTo(_password) != 0) { diff --git a/pubspec.lock b/pubspec.lock index cf6194d..51e96c6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "30.0.0" + version: "36.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.7.0" + version: "3.3.1" archive: dependency: transitive description: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "3.2.2" args: dependency: transitive description: @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.1" build_config: dependency: transitive description: @@ -70,21 +70,21 @@ packages: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.8" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.2.2" + version: "7.2.3" built_collection: dependency: transitive description: @@ -98,14 +98,14 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.3" + version: "8.1.4" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -120,13 +120,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" clock: dependency: transitive description: @@ -175,42 +168,42 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.2.2" dbus: dependency: transitive description: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.5.6" + version: "0.7.1" device_frame: dependency: transitive description: name: device_frame url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-alpha.2" + version: "1.0.0" device_preview: dependency: "direct main" description: name: device_preview url: "https://pub.dartlang.org" source: hosted - version: "1.0.0-alpha.15" + version: "1.0.0" dio: dependency: "direct main" description: name: dio url: "https://pub.dartlang.org" source: hosted - version: "4.0.3" + version: "4.0.4" dots_indicator: dependency: transitive description: name: dots_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" equatable: dependency: transitive description: @@ -252,7 +245,7 @@ packages: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.40.2" + version: "0.40.6" flutter: dependency: "direct main" description: flutter @@ -271,14 +264,14 @@ packages: name: flutter_local_notifications url: "https://pub.dartlang.org" source: hosted - version: "9.1.2" + version: "9.4.0" flutter_local_notifications_linux: dependency: transitive description: name: flutter_local_notifications_linux url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.4.2" flutter_local_notifications_platform_interface: dependency: transitive description: @@ -304,7 +297,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" flutter_polyline_points: dependency: "direct main" description: @@ -377,7 +370,7 @@ packages: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "0.15.0" + version: "1.1.0" frontend_server_client: dependency: transitive description: @@ -433,21 +426,21 @@ packages: name: google_fonts url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.3.1" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.5" graphs: dependency: transitive description: @@ -461,7 +454,7 @@ packages: name: hive url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.6" hive_flutter: dependency: "direct main" description: @@ -475,7 +468,7 @@ packages: name: hive_generator url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" http: dependency: "direct main" description: @@ -489,7 +482,7 @@ packages: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.2.0" http_parser: dependency: transitive description: @@ -503,7 +496,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "3.0.8" + version: "3.1.3" intl: dependency: transitive description: @@ -538,7 +531,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "4.4.0" latlong2: dependency: "direct main" description: @@ -552,7 +545,7 @@ packages: name: lint url: "https://pub.dartlang.org" source: hosted - version: "1.7.2" + version: "1.8.2" lists: dependency: transitive description: @@ -601,7 +594,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -629,7 +629,7 @@ packages: name: mockito url: "https://pub.dartlang.org" source: hosted - version: "5.0.16" + version: "5.1.0" nested: dependency: transitive description: @@ -678,56 +678,49 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.9" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.12" path_provider_ios: dependency: transitive description: name: path_provider_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" + version: "2.0.5" petitparser: dependency: transitive description: @@ -741,14 +734,14 @@ packages: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.2" pool: dependency: transitive description: @@ -783,28 +776,28 @@ packages: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.1" + version: "6.0.2" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" quiver: dependency: transitive description: @@ -825,21 +818,35 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.13" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_platform_interface: dependency: transitive description: @@ -853,14 +860,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.1.0" shelf: dependency: transitive description: @@ -881,7 +888,7 @@ packages: name: showcaseview url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.1.5" sky_engine: dependency: transitive description: flutter @@ -893,14 +900,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.2.1" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" source_span: dependency: transitive description: @@ -942,21 +949,21 @@ packages: name: syncfusion_flutter_core url: "https://pub.dartlang.org" source: hosted - version: "19.3.54" + version: "19.4.56" syncfusion_flutter_xlsio: dependency: "direct main" description: name: syncfusion_flutter_xlsio url: "https://pub.dartlang.org" source: hosted - version: "19.3.54-beta" + version: "19.4.56-beta" syncfusion_officecore: dependency: transitive description: name: syncfusion_officecore url: "https://pub.dartlang.org" source: hosted - version: "19.3.54-beta" + version: "19.4.56-beta" system_shortcuts: dependency: "direct main" description: @@ -977,7 +984,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.8" timezone: dependency: transitive description: @@ -1033,56 +1040,70 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.13" + version: "6.0.20" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.9" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" uuid: dependency: "direct main" description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.5" + version: "3.0.6" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" watcher: dependency: transitive description: @@ -1103,7 +1124,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.4.1" wkt_parser: dependency: transitive description: @@ -1117,7 +1138,7 @@ packages: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: @@ -1133,5 +1154,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + dart: ">=2.15.0 <3.0.0" + flutter: ">=2.10.0" From b71a0ab779083601f07388903956f436faf87218 Mon Sep 17 00:00:00 2001 From: Aman Yadav Date: Wed, 16 Mar 2022 12:56:25 +0530 Subject: [PATCH 2/4] chor:replace deprecated 'disallowGlow()' with 'disallowIndicator' --- lib/screens/loginScreen.dart | 2 +- lib/screens/registerScreen.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/loginScreen.dart b/lib/screens/loginScreen.dart index 8a25b2d..d55ecc5 100644 --- a/lib/screens/loginScreen.dart +++ b/lib/screens/loginScreen.dart @@ -54,7 +54,7 @@ class _LoginScreenState extends State { EdgeInsets.fromLTRB(deviceWidth * 0.05, 0, deviceWidth * 0.05, 0), child: NotificationListener( onNotification: (OverscrollIndicatorNotification overscroll) { - overscroll.disallowGlow(); + overscroll.disallowIndicator(); return; }, child: Form( diff --git a/lib/screens/registerScreen.dart b/lib/screens/registerScreen.dart index 5a95767..a907115 100644 --- a/lib/screens/registerScreen.dart +++ b/lib/screens/registerScreen.dart @@ -59,7 +59,7 @@ class _RegisterScreenState extends State { EdgeInsets.fromLTRB(deviceWidth * 0.05, 0, deviceWidth * 0.05, 0), child: NotificationListener( onNotification: (OverscrollIndicatorNotification overscroll) { - overscroll.disallowGlow(); + overscroll.disallowIndicator(); return; }, child: Form( From ebbf715aaeb2e102fca265e37594e747917e5b6b Mon Sep 17 00:00:00 2001 From: Aman Yadav Date: Thu, 17 Mar 2022 13:37:14 +0530 Subject: [PATCH 3/4] bfix:update changed settings in the screen --- lib/values/settingsValues.dart | 26 ++++++++++++------- .../settingsListWidget.dart | 5 ++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/values/settingsValues.dart b/lib/values/settingsValues.dart index 4ab400a..b7d8529 100644 --- a/lib/values/settingsValues.dart +++ b/lib/values/settingsValues.dart @@ -9,25 +9,27 @@ List generalSettings = [ title: 'Automatic Upload', subtitle: 'Enables the automatic upload of recorded tracks after the recording has been finished. It is only tried to upload the track directly afterwards. If the upload fails (e.g. no internet connection), the track has to be uploaded manually.', - isChecked: false, + isChecked: (preferences.get('Automatic Upload') ?? 'false') == 'true', ), SettingsTileModel( title: 'Keep the screen on', subtitle: 'When checked, this setting keeps the screen on while the application is running.', - isChecked: false, + isChecked: (preferences.get('Keep the screen on') ?? 'false') == 'true', ), SettingsTileModel( title: 'Verbal Announcements', subtitle: 'Enabling the verbal announcements of specific events, e.g. OBD-II connection established/lost, track finished.', - isChecked: false, + isChecked: (preferences.get('Verbal Announcements') ?? 'false') == 'true', ), SettingsTileModel( title: 'Anonymize Start and Destination', subtitle: 'Only upload measurements which are taken 250 meter (820 feet) and one minute after start and before end of each track.', - isChecked: false, + isChecked: + (preferences.get('Anonymize Start and Destination') ?? 'false') == + 'true', ), ]; @@ -37,19 +39,20 @@ List obdModeSettings = [ title: 'Auto Connect', subtitle: 'In case of OBD track, it automatically connects to the OBD-II adapter and starts the recording of a track. This feature periodically checks whether the selected OBD-II adapter is within range. In case of GPS track, it uses activity recognition features and automatically starts the GPS based track once it detects that the user is IN_VEHICLE. Therefore, this setting requires additional battery power.', - isChecked: false, + isChecked: (preferences.get('Auto Connect') ?? 'false') == 'true', ), SettingsTileModel( title: 'Discovery Interval', subtitle: 'The search interval at which the final String device searches for the selected OBD-II final String device. Note: the higher the value, the more the battery gets drained.', - isChecked: false, + isChecked: (preferences.get('Discovery Interval') ?? 'false') == 'true', ), SettingsTileModel( title: 'Diesel Consumption Estimation', subtitle: 'Enables the estimation of consumption values for diesel. NOTE: This feature is just a beta feature.', - isChecked: false, + isChecked: + (preferences.get('Diesel Consumption Estimation') ?? 'false') == 'true', ), ]; @@ -59,13 +62,16 @@ List gpsModeSettings = [ title: 'Enable GPS based track recording', subtitle: "Activates an additional recording mode that enables the recording of plain GPS based tracks that does not require an OBD-II adapter.\n\nNOTE: This feature is just a beta feature.", - isChecked: false, + isChecked: + (preferences.get('Enable GPS based track recording') ?? 'false') == + 'true', ), SettingsTileModel( title: 'Automatic Recording (GPS)', subtitle: 'Activates automatic recording of GPS-based trips based on activity detection mechanisms.\n\nNote: This Android function does not work reliably on some smartphone models.', - isChecked: false, + isChecked: + (preferences.get('Automatic Recording (GPS)') ?? 'false') == 'true', ), ]; @@ -73,7 +79,7 @@ List debuggingSettings = [ SettingsTileModel( title: 'Enable Debug Logging', subtitle: 'Increase the log level (used in issue/problem report)', - isChecked: false, + isChecked: (preferences.get('Enable Debug Logging') ?? 'false') == 'true', ), ]; diff --git a/lib/widgets/settingsScreenWidgets/settingsListWidget.dart b/lib/widgets/settingsScreenWidgets/settingsListWidget.dart index b948876..f32cfc9 100644 --- a/lib/widgets/settingsScreenWidgets/settingsListWidget.dart +++ b/lib/widgets/settingsScreenWidgets/settingsListWidget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../../globals.dart'; import '../../models/settingsTileModel.dart'; // List of checkbox settings tile on settings screen @@ -22,6 +23,10 @@ class _SettingsListWidgetState extends State { final bool currentVal = widget.settings[index].isChecked; widget.settings[index].isChecked = !currentVal; }); + preferences.setString( + widget.settings[index].title, + '${widget.settings[index].isChecked}', + ); } @override From 023dfbdd689e0a74d9facda0cfdc381ad4e685b7 Mon Sep 17 00:00:00 2001 From: Aman Yadav Date: Thu, 24 Mar 2022 19:32:14 +0530 Subject: [PATCH 4/4] update android permissions for url_launcher plugin --- android/app/src/main/AndroidManifest.xml | 2 +- lib/values/settingsValues.dart | 26 +++++++------------ .../settingsListWidget.dart | 5 ---- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 266c2b9..1f1733f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ package="com.example.envirocar_app_main"> - + diff --git a/lib/values/settingsValues.dart b/lib/values/settingsValues.dart index b7d8529..4ab400a 100644 --- a/lib/values/settingsValues.dart +++ b/lib/values/settingsValues.dart @@ -9,27 +9,25 @@ List generalSettings = [ title: 'Automatic Upload', subtitle: 'Enables the automatic upload of recorded tracks after the recording has been finished. It is only tried to upload the track directly afterwards. If the upload fails (e.g. no internet connection), the track has to be uploaded manually.', - isChecked: (preferences.get('Automatic Upload') ?? 'false') == 'true', + isChecked: false, ), SettingsTileModel( title: 'Keep the screen on', subtitle: 'When checked, this setting keeps the screen on while the application is running.', - isChecked: (preferences.get('Keep the screen on') ?? 'false') == 'true', + isChecked: false, ), SettingsTileModel( title: 'Verbal Announcements', subtitle: 'Enabling the verbal announcements of specific events, e.g. OBD-II connection established/lost, track finished.', - isChecked: (preferences.get('Verbal Announcements') ?? 'false') == 'true', + isChecked: false, ), SettingsTileModel( title: 'Anonymize Start and Destination', subtitle: 'Only upload measurements which are taken 250 meter (820 feet) and one minute after start and before end of each track.', - isChecked: - (preferences.get('Anonymize Start and Destination') ?? 'false') == - 'true', + isChecked: false, ), ]; @@ -39,20 +37,19 @@ List obdModeSettings = [ title: 'Auto Connect', subtitle: 'In case of OBD track, it automatically connects to the OBD-II adapter and starts the recording of a track. This feature periodically checks whether the selected OBD-II adapter is within range. In case of GPS track, it uses activity recognition features and automatically starts the GPS based track once it detects that the user is IN_VEHICLE. Therefore, this setting requires additional battery power.', - isChecked: (preferences.get('Auto Connect') ?? 'false') == 'true', + isChecked: false, ), SettingsTileModel( title: 'Discovery Interval', subtitle: 'The search interval at which the final String device searches for the selected OBD-II final String device. Note: the higher the value, the more the battery gets drained.', - isChecked: (preferences.get('Discovery Interval') ?? 'false') == 'true', + isChecked: false, ), SettingsTileModel( title: 'Diesel Consumption Estimation', subtitle: 'Enables the estimation of consumption values for diesel. NOTE: This feature is just a beta feature.', - isChecked: - (preferences.get('Diesel Consumption Estimation') ?? 'false') == 'true', + isChecked: false, ), ]; @@ -62,16 +59,13 @@ List gpsModeSettings = [ title: 'Enable GPS based track recording', subtitle: "Activates an additional recording mode that enables the recording of plain GPS based tracks that does not require an OBD-II adapter.\n\nNOTE: This feature is just a beta feature.", - isChecked: - (preferences.get('Enable GPS based track recording') ?? 'false') == - 'true', + isChecked: false, ), SettingsTileModel( title: 'Automatic Recording (GPS)', subtitle: 'Activates automatic recording of GPS-based trips based on activity detection mechanisms.\n\nNote: This Android function does not work reliably on some smartphone models.', - isChecked: - (preferences.get('Automatic Recording (GPS)') ?? 'false') == 'true', + isChecked: false, ), ]; @@ -79,7 +73,7 @@ List debuggingSettings = [ SettingsTileModel( title: 'Enable Debug Logging', subtitle: 'Increase the log level (used in issue/problem report)', - isChecked: (preferences.get('Enable Debug Logging') ?? 'false') == 'true', + isChecked: false, ), ]; diff --git a/lib/widgets/settingsScreenWidgets/settingsListWidget.dart b/lib/widgets/settingsScreenWidgets/settingsListWidget.dart index f32cfc9..b948876 100644 --- a/lib/widgets/settingsScreenWidgets/settingsListWidget.dart +++ b/lib/widgets/settingsScreenWidgets/settingsListWidget.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import '../../globals.dart'; import '../../models/settingsTileModel.dart'; // List of checkbox settings tile on settings screen @@ -23,10 +22,6 @@ class _SettingsListWidgetState extends State { final bool currentVal = widget.settings[index].isChecked; widget.settings[index].isChecked = !currentVal; }); - preferences.setString( - widget.settings[index].title, - '${widget.settings[index].isChecked}', - ); } @override