Update flat button

This commit is contained in:
Hillel Coren 2021-04-21 22:09:15 +03:00
parent 4dd1750224
commit 5b762c0955
1 changed files with 20 additions and 18 deletions

View File

@ -20,14 +20,8 @@ class AppTextButton extends StatelessWidget {
final store = StoreProvider.of<AppState>(context); final store = StoreProvider.of<AppState>(context);
final state = store.state; final state = store.state;
return TextButton( final ButtonStyle flatButtonStyle = TextButton.styleFrom(
onPressed: onPressed, primary: onPressed == null
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Text(
label,
style: TextStyle(
color: onPressed == null
? null ? null
: color != null : color != null
? color ? color
@ -35,10 +29,18 @@ class AppTextButton extends StatelessWidget {
? state.headerTextColor ? state.headerTextColor
: state.prefState.enableDarkMode : state.prefState.enableDarkMode
? Colors.white ? Colors.white
: Colors.black, : Colors.black87,
), minimumSize: Size(88, 36),
), padding: EdgeInsets.symmetric(horizontal: 16),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(2)),
), ),
); );
return TextButton(
style: flatButtonStyle,
onPressed: onPressed,
child: Text(label),
);
} }
} }