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

51 lines
1.2 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/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) {
2024-01-30 17:24:28 +06:30
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: color,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
onPressed: callBack,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
iconData == null
? Container()
: Icon(
iconData,
color: Colors.white,
),
SizedBox(
width: 15,
2020-10-13 07:50:25 +06:30
),
2024-01-30 17:24:28 +06:30
LocalText(
context,
textKey!,
color: Colors.white,
fontSize: 16,
),
],
));
2020-10-13 07:50:25 +06:30
}
}