pikapika/lib/screens/components/FitButton.dart

31 lines
779 B
Dart
Raw Normal View History

2021-09-29 23:57:09 +00:00
import 'package:flutter/material.dart';
class FitButton extends StatelessWidget {
final void Function() onPressed;
final String text;
const FitButton({Key? key, required this.onPressed, required this.text})
: super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return SizedBox(
width: constraints.maxWidth,
height: constraints.maxHeight,
child: Container(
2022-03-17 03:31:25 +00:00
padding: const EdgeInsets.all(10),
2021-09-29 23:57:09 +00:00
child: MaterialButton(
onPressed: onPressed,
2022-03-17 03:31:25 +00:00
child: Center(
child: Text(text),
2021-09-29 23:57:09 +00:00
),
),
),
);
},
);
}
}