feat(ui_kit): implement simple icon button and use dimension style

This commit is contained in:
2023-02-14 11:55:34 +01:00
parent 4f1a064298
commit e4d904eb8d
8 changed files with 487 additions and 58 deletions
@@ -170,7 +170,6 @@ class Buttons extends StatelessWidget {
),
const Gap(20),
FlatButton(
onPressed: (state) => print('pressed, from $state'),
label: TextWrapper(
'Démarrer mon projet',
style:
@@ -196,63 +195,136 @@ class Buttons extends StatelessWidget {
ColoredBox(
color: _background,
child: Center(
child: Column(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
const Gap(20),
SymbolButton(
icon: const Icon(
Icons.android,
size: 25,
),
label: const TextWrapper('Texte'),
normalStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 1,
),
hoveredStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_background),
stroke: 1,
),
selectedStyle: const SymbolButtonStyle(
borderColors: MultiColor(_selectedColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 1,
),
)
..bloc.onClickUpIn()
..bloc.freeze(),
const Gap(20),
SymbolButton(
icon: const Icon(
Icons.android,
size: 25,
),
label: const TextWrapper('Texte'),
normalStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 1,
),
hoveredStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_background),
stroke: 1,
),
selectedStyle: const SymbolButtonStyle(
borderColors: MultiColor(_selectedColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 1,
),
)..bloc.freeze(),
const Gap(20),
],
),
const Gap(20),
SymbolButton(
icon: const Icon(
Icons.android,
size: 25,
),
label: const TextWrapper('Texte'),
normalStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_disabledBackground),
stroke: 1,
),
hoveredStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_background),
stroke: 1,
),
selectedStyle: const SymbolButtonStyle(
borderColors: MultiColor(_selectedColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_disabledBackground),
stroke: 1,
),
)
..bloc.onClickUpIn()
..bloc.freeze(),
const Gap(20),
SymbolButton(
icon: const Icon(
Icons.android,
size: 25,
),
label: const TextWrapper('Texte'),
normalStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_disabledBackground),
stroke: 1,
),
hoveredStyle: const SymbolButtonStyle(
borderColors: MultiColor(_disabledColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_background),
stroke: 1,
),
selectedStyle: const SymbolButtonStyle(
borderColors: MultiColor(_selectedColors),
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor.single(_disabledBackground),
stroke: 1,
),
)..bloc.freeze(),
Row(
children: [
SimpleIconButton(
icon: const Icon(
Icons.storm_outlined,
size: 17,
),
normalStyle: const SimpleIconButtonStyle(
backgroundColors: MultiColor.single(_disabled),
),
hoveredStyle: SimpleIconButtonStyle(
backgroundColors:
MultiColor.single(_disabledColors.last),
),
),
const Gap(10),
SimpleIconButton(
icon: const Icon(
Icons.sunny,
size: 17,
),
normalStyle: const SimpleIconButtonStyle(
backgroundColors: MultiColor.single(_disabled),
),
hoveredStyle: SimpleIconButtonStyle(
backgroundColors:
MultiColor.single(_disabledColors.last),
),
),
const Gap(10),
SimpleIconButton(
icon: const Icon(
Icons.wechat,
size: 17,
),
normalStyle: const SimpleIconButtonStyle(
backgroundColors: MultiColor.single(_disabled),
),
hoveredStyle: SimpleIconButtonStyle(
backgroundColors:
MultiColor.single(_disabledColors.last),
),
)
],
),
const Gap(20),
Row(
children: [
SymbolButton(
icon: const FlutterLogo(
size: 50,
),
normalStyle: const SymbolButtonStyle(
dimension: 73,
backgroundColors: MultiColor.single(Colors.white),
),
hoveredStyle: SymbolButtonStyle(
dimension: 73,
backgroundColors: MultiColor.single(Colors.grey[300]),
),
),
],
),
],
),
),