Update flat button
This commit is contained in:
parent
4dd1750224
commit
5b762c0955
|
|
@ -20,25 +20,27 @@ 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(
|
? null
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
: color != null
|
||||||
child: Text(
|
? color
|
||||||
label,
|
: isInHeader
|
||||||
style: TextStyle(
|
? state.headerTextColor
|
||||||
color: onPressed == null
|
: state.prefState.enableDarkMode
|
||||||
? null
|
? Colors.white
|
||||||
: color != null
|
: Colors.black87,
|
||||||
? color
|
minimumSize: Size(88, 36),
|
||||||
: isInHeader
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||||
? state.headerTextColor
|
shape: const RoundedRectangleBorder(
|
||||||
: state.prefState.enableDarkMode
|
borderRadius: BorderRadius.all(Radius.circular(2)),
|
||||||
? Colors.white
|
|
||||||
: Colors.black,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return TextButton(
|
||||||
|
style: flatButtonStyle,
|
||||||
|
onPressed: onPressed,
|
||||||
|
child: Text(label),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue