git-touch-android-ios-app/lib/widgets/mutation_button.dart

26 lines
611 B
Dart
Raw Permalink Normal View History

2022-09-18 07:02:06 +02:00
import 'package:antd_mobile/antd_mobile.dart';
2020-01-12 07:49:46 +01:00
import 'package:flutter/cupertino.dart';
class MutationButton extends StatelessWidget {
2022-09-06 18:28:12 +02:00
const MutationButton({
2022-09-18 07:02:06 +02:00
super.key,
this.active = false,
2021-05-16 09:16:35 +02:00
required this.text,
2022-09-18 07:02:06 +02:00
required this.onTap,
2020-01-12 07:49:46 +01:00
});
2022-09-21 18:28:21 +02:00
final bool active;
final String text;
final VoidCallback onTap;
2020-01-12 07:49:46 +01:00
@override
Widget build(BuildContext context) {
2022-09-18 07:02:06 +02:00
return AntButton(
2022-09-24 09:36:22 +02:00
color: AntTheme.of(context).colorPrimary,
2022-09-18 07:02:06 +02:00
fill: active ? AntButtonFill.solid : AntButtonFill.outline,
shape: AntButtonShape.rounded,
onClick: onTap,
child: Text(text),
2020-01-12 07:49:46 +01:00
);
}
}