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.
51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
|
3 years ago
|
import 'package:test_sa/views/app_style/colors.dart';
|
||
|
|
import 'package:test_sa/views/app_style/sizing.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
class AOutLinedButton extends StatelessWidget {
|
||
|
|
final String text;
|
||
|
|
final Color color;
|
||
|
|
final EdgeInsets padding;
|
||
|
|
final TextStyle textStyle;
|
||
|
|
final VoidCallback onPressed;
|
||
|
|
|
||
|
|
const AOutLinedButton({
|
||
|
|
Key key,
|
||
|
|
this.color = AColors.primaryColor,
|
||
|
|
this.text,
|
||
|
|
this.padding,
|
||
|
|
this.onPressed,
|
||
|
|
this.textStyle
|
||
|
|
}) : super(key: key);
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return OutlinedButton(
|
||
|
|
style: ElevatedButton.styleFrom(
|
||
|
|
padding: padding ?? EdgeInsets.symmetric(vertical: 12),
|
||
|
|
textStyle: textStyle
|
||
|
|
?? Theme.of(context).textTheme.subtitle2.copyWith(
|
||
|
|
fontSize: 18
|
||
|
|
),
|
||
|
|
shape: RoundedRectangleBorder(
|
||
|
|
borderRadius: BorderRadius.circular(
|
||
|
|
AppStyle.getBorderRadius(context)
|
||
|
|
)
|
||
|
|
),
|
||
|
|
),
|
||
|
|
onPressed: onPressed,
|
||
|
|
child: Row(
|
||
|
|
children: [
|
||
|
|
Expanded(
|
||
|
|
child: Text(
|
||
|
|
text??"",
|
||
|
|
|
||
|
|
textAlign: TextAlign.center,
|
||
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|