Skip to content

Commit

Permalink
feat: Added AppSettings to open the app settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Jan 21, 2025
1 parent 48a9253 commit 64bdc0e
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.10.0

## Feat

- Added AppSettings to open the app settings

# 0.9.0

## Feat
Expand Down
1 change: 1 addition & 0 deletions lib/impaktfull_architecture.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export 'src/repo/remote_config/remote_config_repository.dart';
export 'src/repo/version_check/version_check_repository.dart';
export 'src/service/version_check/version_check_service.dart';
export 'src/service/version_check/noop_version_check_service.dart';
export 'src/util/app_settings/app_settings.dart';
export 'src/util/connectivity/connectivity.dart';
export 'src/util/date_formatter/date_formatter_util.dart';
export 'src/util/dio/combining_smart_interceptor.dart';
Expand Down
89 changes: 89 additions & 0 deletions lib/src/util/app_settings/app_settings.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import 'package:app_settings/app_settings.dart' as app_settings;

class AppSettings {
static Future<void> openAccessibilitySettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.accessibility,
asAnotherTask: asAnotherTask,
);

static Future<void> openAppSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.settings,
asAnotherTask: asAnotherTask,
);

static Future<void> openBatteryOptimizationSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.batteryOptimization,
asAnotherTask: asAnotherTask,
);

static Future<void> openBluetoothSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.bluetooth,
asAnotherTask: asAnotherTask,
);

static Future<void> openHotspotSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.hotspot,
asAnotherTask: asAnotherTask,
);

static Future<void> openLocationSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.location,
asAnotherTask: asAnotherTask,
);

static Future<void> openNotificationSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.notification,
asAnotherTask: asAnotherTask,
);

static Future<void> openWifiSettings({
bool asAnotherTask = false,
}) async =>
await app_settings.AppSettings.openAppSettings(
type: app_settings.AppSettingsType.wifi,
asAnotherTask: asAnotherTask,
);

// static Android Setting Panels

static Future<void> openWifiSettingsPannel() async =>
await app_settings.AppSettings.openAppSettingsPanel(
app_settings.AppSettingsPanelType.wifi,
);

static Future<void> openInternetConnectivitySettingsPannel() async =>
await app_settings.AppSettings.openAppSettingsPanel(
app_settings.AppSettingsPanelType.internetConnectivity,
);

static Future<void> openNfcSettingsPannel() async =>
await app_settings.AppSettings.openAppSettingsPanel(
app_settings.AppSettingsPanelType.nfc,
);

static Future<void> openVolumeSettingsPannel() async =>
await app_settings.AppSettings.openAppSettingsPanel(
app_settings.AppSettingsPanelType.volume,
);
}
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ environment:
sdk: ">=3.3.0 <4.0.0"
flutter: ">=1.17.0"
dependencies:
app_settings: ^5.1.1
connectivity_plus: ^6.0.3
device_info_plus: ^10.1.0
flutter:
Expand Down

0 comments on commit 64bdc0e

Please sign in to comment.