feat(ui_kit): implement file selection button with invalid cubit and dotted package

This commit is contained in:
2023-02-14 11:55:34 +01:00
parent d49a4cad31
commit 4695cf0618
9 changed files with 670 additions and 104 deletions
@@ -30,6 +30,7 @@ const _background = Color(0xFF16191D);
const _disabledBackground = Color(0xFF16191D + 0x66FFFFFF);
const _disabledColors = [Color(0xFF60656A), Color(0xFF383C40)];
const _selectedColors = [Color(0xFF50CE99), Color(0xFF339572)];
const _invalidColor = Color(0xFFFB5E3C);
class Buttons extends StatelessWidget {
const Buttons({super.key});
@@ -325,6 +326,47 @@ class Buttons extends StatelessWidget {
),
],
),
const Gap(20),
FileSelectionButton(
leading: const DecoratedBox(
decoration: BoxDecoration(
color: _disabled,
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Padding(
padding: EdgeInsets.all(8),
child: Icon(
Icons.file_upload_outlined,
color: Colors.white,
),
),
),
title: TextWrapper(
'Ajouter un fichier',
style: Theme.of(context)
.textTheme
.titleLarge
?.copyWith(color: _disabled),
),
subTitle: TextWrapper.text('Taille max: 20 Mo'),
normalStyle: const FileSelectionButtonStyle(
backgroundColors: MultiColor.single(_disabledBackground),
foregroundColors: MultiColor.single(_disabled),
borderColors: MultiColor.single(_disabled),
),
hoveredStyle: const FileSelectionButtonStyle(
backgroundColors: MultiColor.single(_disabledBackground),
foregroundColors: MultiColor.single(_disabled),
borderColors: MultiColor.single(Colors.white),
),
invalidStyle: const FileSelectionButtonStyle(
backgroundColors: MultiColor.single(_disabledBackground),
foregroundColors: MultiColor.single(_invalidColor),
borderColors: MultiColor.single(_invalidColor),
),
)
],
),
),