mirror of
https://github.com/allankoechke/Flutter-Shopping-UI-Kit.git
synced 2026-12-01 17:04:32 +00:00
59 lines
1.8 KiB
Dart
Executable File
59 lines
1.8 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
|
|
class SubmitButton extends StatefulWidget {
|
|
final String title;
|
|
final Function act;
|
|
SubmitButton({@required this.title, @required this.act});
|
|
|
|
@override
|
|
_SubmitButtonState createState() => _SubmitButtonState();
|
|
}
|
|
|
|
class _SubmitButtonState extends State<SubmitButton> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0),
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
alignment: Alignment.center,
|
|
child: new Row(
|
|
children: <Widget>[
|
|
new Expanded(
|
|
child: new FlatButton(
|
|
shape: new RoundedRectangleBorder(
|
|
borderRadius: new BorderRadius.circular(30.0),
|
|
),
|
|
color: Theme.of(context).primaryColor,
|
|
onPressed: widget.act,
|
|
child: new Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
vertical: 15.0,
|
|
horizontal: 10.0,
|
|
),
|
|
child: new Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: <Widget>[
|
|
new Expanded(
|
|
child: Text(
|
|
widget.title,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|