mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
46
lib/screens/shared/flat_button.dart
Normal file
46
lib/screens/shared/flat_button.dart
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import 'package:fladder/theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class FlatButton extends ConsumerWidget {
|
||||
final Widget? child;
|
||||
final Function()? onTap;
|
||||
final Function()? onLongPress;
|
||||
final Function()? onDoubleTap;
|
||||
final Function(TapDownDetails details)? onSecondaryTapDown;
|
||||
final BorderRadius? borderRadiusGeometry;
|
||||
final Color? splashColor;
|
||||
final double elevation;
|
||||
final Clip clipBehavior;
|
||||
const FlatButton(
|
||||
{this.child,
|
||||
this.onTap,
|
||||
this.onLongPress,
|
||||
this.onDoubleTap,
|
||||
this.onSecondaryTapDown,
|
||||
this.borderRadiusGeometry,
|
||||
this.splashColor,
|
||||
this.elevation = 0,
|
||||
this.clipBehavior = Clip.none,
|
||||
super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
clipBehavior: clipBehavior,
|
||||
borderRadius: borderRadiusGeometry ?? FladderTheme.defaultShape.borderRadius,
|
||||
elevation: 0,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onLongPress: onLongPress,
|
||||
onDoubleTap: onDoubleTap,
|
||||
onSecondaryTapDown: onSecondaryTapDown,
|
||||
borderRadius: borderRadiusGeometry ?? BorderRadius.circular(10),
|
||||
splashColor: splashColor ?? Theme.of(context).colorScheme.primary.withOpacity(0.5),
|
||||
splashFactory: InkSparkle.splashFactory,
|
||||
child: child ?? Container(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue