1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-19 03:33:42 +01:00

improvement: action tap effect

This commit is contained in:
Rongjian Zhang 2020-01-04 22:47:48 +08:00
parent ffa3ef79d9
commit 68e031ebe5
2 changed files with 9 additions and 4 deletions

View File

@ -48,9 +48,11 @@ class ActionButton extends StatelessWidget {
final theme = Provider.of<ThemeModel>(context); final theme = Provider.of<ThemeModel>(context);
switch (theme.theme) { switch (theme.theme) {
case AppThemeType.cupertino: case AppThemeType.cupertino:
return GestureDetector( return CupertinoButton(
minSize: 0,
child: Icon(iconData, size: 22), child: Icon(iconData, size: 22),
onTap: () async { padding: EdgeInsets.zero,
onPressed: () async {
var value = await showCupertinoModalPopup<int>( var value = await showCupertinoModalPopup<int>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {

View File

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:git_touch/models/theme.dart'; import 'package:git_touch/models/theme.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -11,9 +12,11 @@ class ActionEntry extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
switch (Provider.of<ThemeModel>(context).theme) { switch (Provider.of<ThemeModel>(context).theme) {
case AppThemeType.cupertino: case AppThemeType.cupertino:
return GestureDetector( return CupertinoButton(
minSize: 0,
child: Icon(iconData, size: 22), child: Icon(iconData, size: 22),
onTap: onTap, padding: EdgeInsets.zero,
onPressed: onTap,
); );
default: default:
return IconButton( return IconButton(