2020-01-12 07:49:46 +01:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:git_touch/models/theme.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
class MutationButton extends StatelessWidget {
|
|
|
|
final String text;
|
|
|
|
final VoidCallback onPressed;
|
|
|
|
|
|
|
|
MutationButton({
|
|
|
|
@required this.text,
|
|
|
|
@required this.onPressed,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final theme = Provider.of<ThemeModel>(context);
|
|
|
|
return CupertinoButton(
|
|
|
|
onPressed: onPressed,
|
|
|
|
minSize: 0,
|
|
|
|
color: theme.palette.primary,
|
|
|
|
padding: EdgeInsets.symmetric(
|
2020-01-14 06:33:02 +01:00
|
|
|
horizontal: 14,
|
|
|
|
vertical: 5,
|
2020-01-12 07:49:46 +01:00
|
|
|
),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
child: Text(
|
|
|
|
text,
|
2020-01-14 06:33:02 +01:00
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 18,
|
|
|
|
color: theme.palette.background,
|
|
|
|
),
|
2020-01-12 07:49:46 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|