You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.0 KiB
Dart
35 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../app_style/sizing.dart';
|
|
|
|
class ASmallButton extends StatelessWidget {
|
|
final String text;
|
|
final TextStyle? style;
|
|
final Color? color;
|
|
final EdgeInsets? padding;
|
|
final VoidCallback? onPressed;
|
|
|
|
const ASmallButton({Key? key, required this.text, this.style ,this.onPressed,this.padding, this.color}) : super(key: key);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
padding: padding,
|
|
primary: color ?? Theme.of(context).primaryColor,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8)
|
|
),
|
|
),
|
|
child: Text(
|
|
text??"",
|
|
style: style ?? Theme.of(context).textTheme.bodyText1?.copyWith(
|
|
color: color == Colors.white
|
|
? Theme.of(context).primaryColor : Colors.white
|
|
),
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
),
|
|
onPressed: onPressed
|
|
);
|
|
}
|
|
}
|