Reduced haptic feedback (consequential actions only)

This commit is contained in:
Imran Remtulla
2022-09-17 16:48:42 -04:00
parent c724b276ab
commit 0f6b6253de
7 changed files with 10 additions and 15 deletions

View File

@@ -59,14 +59,13 @@ class _GeneratedFormModalState extends State<GeneratedFormModal> {
actions: [
TextButton(
onPressed: () {
HapticFeedback.lightImpact();
Navigator.of(context).pop(null);
},
child: const Text('Cancel')),
TextButton(
onPressed: () {
if (_formKey.currentState?.validate() == true) {
HapticFeedback.heavyImpact();
HapticFeedback.selectionClick();
Navigator.of(context).pop(formInputs
.map((e) => (e[0] as TextEditingController).value.text)
.toList());

View File

@@ -60,7 +60,7 @@ class _AddAppPageState extends State<AddAppPage> {
onPressed: gettingAppInfo
? null
: () {
HapticFeedback.mediumImpact();
HapticFeedback.selectionClick();
if (_formKey.currentState!.validate()) {
setState(() {
gettingAppInfo = true;

View File

@@ -111,6 +111,7 @@ class _AppPageState extends State<AppPage> {
child: const Text('No')),
TextButton(
onPressed: () {
HapticFeedback.selectionClick();
var updatedApp = app?.app;
if (updatedApp != null) {
updatedApp.installedVersion =
@@ -157,7 +158,6 @@ class _AppPageState extends State<AppPage> {
onPressed: app?.downloadProgress != null
? null
: () {
HapticFeedback.lightImpact();
showDialog(
context: context,
builder: (BuildContext ctx) {
@@ -168,7 +168,8 @@ class _AppPageState extends State<AppPage> {
actions: [
TextButton(
onPressed: () {
HapticFeedback.heavyImpact();
HapticFeedback
.selectionClick();
appsProvider
.removeApp(app!.app.id)
.then((_) {
@@ -181,7 +182,6 @@ class _AppPageState extends State<AppPage> {
child: const Text('Remove')),
TextButton(
onPressed: () {
HapticFeedback.lightImpact();
Navigator.of(context).pop();
},
child: const Text('Cancel'))

View File

@@ -45,7 +45,7 @@ class _HomePageState extends State<HomePage> {
NavigationDestination(icon: Icon(e.icon), label: e.title))
.toList(),
onDestinationSelected: (int index) {
HapticFeedback.lightImpact();
HapticFeedback.selectionClick();
setState(() {
if (index == 0) {
selectedIndexHistory.clear();

View File

@@ -57,7 +57,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
onPressed: appsProvider.apps.isEmpty || importInProgress
? null
: () {
HapticFeedback.lightImpact();
HapticFeedback.selectionClick();
appsProvider.exportApps().then((String path) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Exported to $path')),
@@ -72,7 +72,7 @@ class _ImportExportPageState extends State<ImportExportPage> {
onPressed: importInProgress
? null
: () {
HapticFeedback.lightImpact();
HapticFeedback.selectionClick();
FilePicker.platform.pickFiles().then((result) {
setState(() {
importInProgress = true;
@@ -291,7 +291,6 @@ class _ImportErrorDialogState extends State<ImportErrorDialog> {
actions: [
TextButton(
onPressed: () {
HapticFeedback.lightImpact();
Navigator.of(context).pop(null);
},
child: const Text('Okay'))

View File

@@ -192,7 +192,6 @@ class _SettingsPageState extends State<SettingsPage> {
}),
),
onPressed: () {
HapticFeedback.lightImpact();
launchUrlString(settingsProvider.sourceUrl,
mode: LaunchMode.externalApplication);
},

View File

@@ -339,13 +339,12 @@ class _APKPickerState extends State<APKPicker> {
actions: [
TextButton(
onPressed: () {
HapticFeedback.lightImpact();
Navigator.of(context).pop(null);
},
child: const Text('Cancel')),
TextButton(
onPressed: () {
HapticFeedback.heavyImpact();
HapticFeedback.selectionClick();
Navigator.of(context).pop(apkUrl);
},
child: const Text('Continue'))
@@ -376,13 +375,12 @@ class _APKOriginWarningDialogState extends State<APKOriginWarningDialog> {
actions: [
TextButton(
onPressed: () {
HapticFeedback.lightImpact();
Navigator.of(context).pop(null);
},
child: const Text('Cancel')),
TextButton(
onPressed: () {
HapticFeedback.heavyImpact();
HapticFeedback.selectionClick();
Navigator.of(context).pop(true);
},
child: const Text('Continue'))