Skip to content

Commit

Permalink
fix: 3459 - Added a shortcut in app settings to In-app settings (#3726)
Browse files Browse the repository at this point in the history
* Added a shortcut in app settings to In-app settings

* Provided ontap() functionality to listTile on _AdvancedSettings()

* Added version of the app_settings

* Rolled back fluter version in pubspec.lock

* Changed theme style of _AdvancedSettings()

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
  • Loading branch information
Adiii1436 and monsieurtanuki committed Feb 26, 2023
1 parent cad3041 commit 9113c4a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,14 @@
"@product_removed_comparison": {
"description": "Product got removed from comparison list"
},
"native_app_settings": "Native App Settings",
"@native_app_settings": {
"description": "Native App Settings in app settings"
},
"native_app_description": "Open systems settings for Open Food Facts",
"@native_app_description": {
"description": "Native App description in app settings"
},
"product_removed_history": "Product removed from history",
"@product_removed_history": {
"description": "Product got removed from history"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:app_settings/app_settings.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
Expand Down Expand Up @@ -334,6 +336,52 @@ class _PrivacySettings extends StatelessWidget {
const UserPreferencesListItemDivider(),
const _SendAnonymousDataSetting(),
const UserPreferencesListItemDivider(),
const _AdvancedSettings(),
const UserPreferencesListItemDivider(),
],
);
}
}

class _AdvancedSettings extends StatelessWidget {
const _AdvancedSettings({
Key? key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
final AppLocalizations appLocalizations = AppLocalizations.of(context);

return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: ListTile(
onTap: () async {
await AppSettings.openAppSettings();
},
title: Text(
appLocalizations.native_app_settings,
style: Theme.of(context).textTheme.headlineMedium,
),
subtitle: Padding(
padding: const EdgeInsets.only(top: SMALL_SPACE),
child: Text(
appLocalizations.native_app_description,
style: Theme.of(context).textTheme.bodyText2,
),
),
trailing: const Padding(
padding: EdgeInsets.only(
right: LARGE_SPACE,
),
child: Icon(
CupertinoIcons.settings_solid,
),
),
minVerticalPadding: MEDIUM_SPACE,
),
),
],
);
}
Expand Down
9 changes: 8 additions & 1 deletion packages/smooth_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.7.0"
app_settings:
dependency: "direct main"
description:
name: app_settings
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
app_store_apple_store:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1521,4 +1528,4 @@ packages:
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
flutter: ">=3.0.1"
1 change: 1 addition & 0 deletions packages/smooth_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies:
url_launcher: 6.1.3
visibility_detector: 0.3.3
assorted_layout_widgets: 6.1.1
app_settings: 4.2.0

# Camera (custom implementation for Android)
camera:
Expand Down

0 comments on commit 9113c4a

Please sign in to comment.