Files
fcs/lib/pages/widgets/local_button.dart

63 lines
1.6 KiB
Dart
Raw Normal View History

2020-10-13 07:50:25 +06:30
import 'package:fcs/helpers/theme.dart';
import 'package:fcs/pages/widgets/local_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'callbacks.dart';
class LocalButton extends StatelessWidget {
2021-09-10 14:25:37 +06:30
final CallBack? callBack;
final IconData? iconData;
final String? textKey;
final Color? color;
2020-10-13 07:50:25 +06:30
2020-10-17 01:40:24 +06:30
const LocalButton(
2021-09-10 14:25:37 +06:30
{Key? key,
2020-10-17 01:40:24 +06:30
this.callBack,
this.iconData,
this.textKey,
this.color = primaryColor})
2020-10-13 07:50:25 +06:30
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Container(
height: 45.0,
decoration: BoxDecoration(
2020-10-17 01:40:24 +06:30
color: color,
2020-10-13 07:50:25 +06:30
shape: BoxShape.rectangle,
),
child: ButtonTheme(
minWidth: 900.0,
height: 100.0,
2024-01-09 13:11:22 +06:30
child: TextButton(
2021-09-10 14:25:37 +06:30
onPressed: callBack == null ? null : () => callBack!(),
2020-10-13 07:50:25 +06:30
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
iconData == null
? Container()
: Icon(
iconData,
color: Colors.white,
),
SizedBox(
width: 15,
),
LocalText(
context,
2021-09-10 14:25:37 +06:30
textKey!,
2020-10-13 07:50:25 +06:30
color: Colors.white,
fontSize: 16,
),
],
),
),
),
),
);
}
}