feat: add haptic feedback to even more user interactions
This commit is contained in:
@@ -112,7 +112,10 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
padding: const EdgeInsets.only(bottom: 85),
|
||||
itemCount: filteredGroups.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return GestureDetector(
|
||||
return GroupTile(
|
||||
group: filteredGroups[index],
|
||||
isHighlighted:
|
||||
selectedGroupId == filteredGroups[index].id,
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (selectedGroupId != filteredGroups[index].id) {
|
||||
@@ -122,11 +125,6 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
}
|
||||
});
|
||||
},
|
||||
child: GroupTile(
|
||||
group: filteredGroups[index],
|
||||
isHighlighted:
|
||||
selectedGroupId == filteredGroups[index].id,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_popup/flutter_popup.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/common.dart';
|
||||
@@ -330,6 +331,12 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 0, vertical: 10),
|
||||
barrierColor: Colors.transparent,
|
||||
contentDecoration: CustomTheme.standardBoxDecoration,
|
||||
onBeforePopup: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
},
|
||||
onAfterPopup: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
},
|
||||
content: StatefulBuilder(
|
||||
builder: (context, setPopupState) => SizedBox(
|
||||
width: 280,
|
||||
@@ -339,7 +346,8 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
children: List.generate(
|
||||
_rulesets.length,
|
||||
(index) => GestureDetector(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
setState(() {
|
||||
selectedRuleset = _rulesets[index].$1;
|
||||
});
|
||||
@@ -413,6 +421,12 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 0, vertical: 10),
|
||||
barrierColor: Colors.transparent,
|
||||
contentDecoration: CustomTheme.standardBoxDecoration,
|
||||
onBeforePopup: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
},
|
||||
onAfterPopup: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
},
|
||||
content: StatefulBuilder(
|
||||
builder: (context, setPopupState) => SizedBox(
|
||||
width: 150,
|
||||
@@ -422,7 +436,8 @@ class _CreateGameViewState extends State<CreateGameView> {
|
||||
children: List.generate(
|
||||
_colors.length,
|
||||
(index) => GestureDetector(
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
setState(() {
|
||||
selectedColor = _colors[index].$1;
|
||||
});
|
||||
|
||||
@@ -172,7 +172,6 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
||||
) ??
|
||||
false,
|
||||
);
|
||||
|
||||
selectedGroup = await Navigator.of(context).push(
|
||||
adaptivePageRoute(
|
||||
builder: (context) => ChooseGroupView(
|
||||
|
||||
Reference in New Issue
Block a user