mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
fix: Improve dPad navigation buttons (#605)
This commit is contained in:
parent
e9f32f522b
commit
493f40645c
3 changed files with 91 additions and 61 deletions
|
|
@ -3,23 +3,37 @@ import 'package:flutter/material.dart';
|
|||
class AdaptiveFab {
|
||||
final BuildContext context;
|
||||
final String title;
|
||||
final String? heroTag;
|
||||
final Widget child;
|
||||
final Function() onPressed;
|
||||
final Color? backgroundColor;
|
||||
final Key? key;
|
||||
AdaptiveFab({
|
||||
required this.context,
|
||||
this.title = '',
|
||||
this.heroTag,
|
||||
required this.child,
|
||||
required this.onPressed,
|
||||
this.key,
|
||||
this.backgroundColor,
|
||||
});
|
||||
|
||||
FloatingActionButton get normal {
|
||||
return FloatingActionButton(
|
||||
key: key,
|
||||
onPressed: onPressed,
|
||||
tooltip: title,
|
||||
child: child,
|
||||
Widget get normal {
|
||||
return Hero(
|
||||
tag: heroTag ?? UniqueKey(),
|
||||
child: IconButton.filledTonal(
|
||||
iconSize: 26,
|
||||
key: key,
|
||||
tooltip: title,
|
||||
onPressed: onPressed,
|
||||
style: IconButton.styleFrom(
|
||||
backgroundColor: backgroundColor,
|
||||
),
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +48,7 @@ class AdaptiveFab {
|
|||
onPressed: onPressed,
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.all(16),
|
||||
backgroundColor: backgroundColor,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 16,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue