-
Notifications
You must be signed in to change notification settings - Fork 35
widgets:w_button_raised_flat.dart
Nhan Cao edited this page Jun 8, 2023
·
1 revision
import 'package:flutter/material.dart';
class WButtonRaisedFlat extends StatelessWidget {
const WButtonRaisedFlat({
Key? key,
this.onPressed,
this.child,
this.color,
this.splashColor,
}) : super(key: key);
final Function()? onPressed;
final Widget? child;
final Color? color;
final Color? splashColor;
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onPressed,
child: child,
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all<Color>(color ?? Colors.transparent),
overlayColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
final Color sColor = splashColor ?? Colors.grey.withAlpha(150);
if (states.contains(MaterialState.hovered)) {
return sColor;
}
if (states.contains(MaterialState.pressed)) {
return sColor;
}
return null; // Defer to the widget's default.
}),
elevation: MaterialStateProperty.all(0),
padding: MaterialStateProperty.all(EdgeInsets.zero),
),
);
}
}
-
widgets
- o_toast.dart
- w_behide_keyboard.dart
- w_border_shadow.dart
- w_bottom_action_sheet.dart
- w_button_circle.dart
- w_button_inkwell.dart
- w_button_raised_flat.dart
- w_button_rounded.dart
- w_card_rounded.dart
- w_card_shadow.dart
- w_dialog_alert.dart
- w_dialog_delete.dart
- w_divider_line.dart
- w_keyboard_detector.dart
- w_marquee.dart
- w_picker_date.dart
- w_picker_time.dart
- w_picker_value.dart
- w_syspadding.dart
- w_text_shadow.dart