| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import 'package:fast/constants.dart';
- import 'package:fast/utils/size_fit.dart';
- import 'package:flutter/material.dart';
- // ignore: must_be_immutable
- class FastBtn extends StatelessWidget {
- String title;
- bool disable;
- double width, height;
- Widget? imgWidget;
- // Color disableColor = const Color(0xFF363F4D);
- // ignore: prefer_typing_uninitialized_variables
- var callback;
- FastBtn(
- {Key? key,
- required this.title,
- required this.disable,
- required this.width,
- required this.height,
- required this.callback,
- Widget? img})
- : super(key: key){
- if (img!=null){
- imgWidget = img;
- }
- }
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- callback();
- },
- child: Opacity(opacity: disable?0.4:1.0,child: Container(
- width: width,
- height: height,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: kThemeColor,
- borderRadius: BorderRadius.all(Radius.circular(height / 2.0))),
- child: imgWidget ?? Text(
- title,
- style: TextStyle(
- color: kBgColor,
- fontSize: 16.px,
- decoration: TextDecoration.none,
- fontWeight: FontWeight.w900),
- ),
- ),),
- );
- }
- }
|