52 lines
1.3 KiB
Dart
52 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:tanami_app/core/styles/app_color.dart';
|
|
import 'package:tanami_app/shared/components/text_widget.dart';
|
|
|
|
class ButtonWidget {
|
|
Widget textBtn({
|
|
required Widget text,
|
|
Color? clr,
|
|
required VoidCallback function,
|
|
}) {
|
|
return InkWell(
|
|
onTap: function,
|
|
child: Container(
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: ShapeDecoration(
|
|
shape: RoundedRectangleBorder(
|
|
side: const BorderSide(width: 1, color: AppColor.txtBorderColor),
|
|
borderRadius: BorderRadius.circular(30),
|
|
),
|
|
),
|
|
margin: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 10,
|
|
),
|
|
width: 1.sw,
|
|
height: 56.h,
|
|
child: Center(child: text),
|
|
),
|
|
);
|
|
}
|
|
|
|
//Elevated Button
|
|
Widget elevatedBtn({
|
|
required String text,
|
|
required Color clr,
|
|
Color? txtClr,
|
|
required VoidCallback function,
|
|
}) {
|
|
return ElevatedButton(
|
|
onPressed: function,
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: clr,
|
|
),
|
|
child: TextWidget().text14W700(
|
|
text,
|
|
clr: txtClr ?? AppColor.plainWhite,
|
|
),
|
|
);
|
|
}
|
|
}
|