1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import 'package:flutter/material.dart';
- import 'package:liftmanager/res/resources.dart';
- class MyButton extends StatelessWidget {
- const MyButton({
- Key key,
- this.text: "",
- this.textColor,
- this.borderColor,
- this.borderWidth = 0,
- @required this.onPressed,
- this.colors,
- this.height = 44,
- this.fontSize = Dimens.font_sp18,
- this.backColor = Colours.blue_app_main
- }) : super(key: key);
- final String text;
- final VoidCallback onPressed;
- final List<Color> colors;
- final Color textColor;
- final Color borderColor;
- final Color backColor;
- final double borderWidth;
- final double height;
- final double fontSize;
- @override
- Widget build(BuildContext context) {
- // bool isDark = ThemeUtils.isDark(context);
- return FlatButton(
- onPressed: onPressed,
- child: Column(
- children: <Widget>[
- Container(
- height: this.height,
- // width: double.infinity,
- padding: EdgeInsets.only(left: 10, right: 10),
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color:backColor,
- borderRadius: BorderRadius.circular(this.height / 2),
- // gradient: LinearGradient(
- // colors:
- // this.colors ?? [Color(0xFF00D4FF), Color(0xFF007CFF)]),
- border: Border.all(
- color: this.borderColor ?? Colors.transparent,
- width: this.borderWidth)),
- child: Text(text,
- style: TextStyle(
- fontSize: this.fontSize,
- color: this.textColor ?? Colors.white,
- )),
- ),
- ],
- ),
- );
- }
- }
|