197 lines
7.3 KiB
Dart

// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
const _color1 = Color(0xFF3C97FB);
const _color2 = Color(0xFF446DF4);
const _color3 = Color.fromARGB(255, 26, 132, 247);
const _color4 = Color.fromARGB(255, 19, 68, 228);
const _colors = [_color1, _color2];
const _colorsDarken = [_color2, _color3];
const _disabled = Color(0xFF6B7280);
const _background = Color(0xFF16191D);
const _disabledBackground = Color(0xFF16191D + 0x66FFFFFF);
const _disabledColors = [Color(0xFF60656A), Color(0xFF383C40)];
class Buttons extends StatelessWidget {
const Buttons({super.key});
@override
Widget build(BuildContext context) => Column(
children: [
Text(
'Buttons',
style: Theme.of(context).textTheme.titleLarge,
),
const Gap(20),
const FlatButton(
label: TextWrapper('Voir notre savoir faire'),
normalStyle: FlatButtonStyle(
foregroundColors: MultiColor(_colors),
backgroundColors: MultiColor.single(Colors.transparent),
borderColors: MultiColor(_colors),
stroke: 3,
),
hoveredStyle: FlatButtonStyle(
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor(_colors),
borderColors: MultiColor(_colors),
stroke: 3,
),
tappedStyle: FlatButtonStyle(
foregroundColors: MultiColor.single(Colors.white),
backgroundColors: MultiColor(_colorsDarken),
borderColors: MultiColor(_colorsDarken),
stroke: 3,
),
prefix: Icon(
Icons.arrow_forward_rounded,
),
suffix: Icon(
Icons.arrow_forward_rounded,
),
),
const Gap(20),
FlatButton(
label: TextWrapper(
'Voir notre savoir faire',
style:
context.textTheme.titleLarge?.copyWith(color: Colors.white),
),
normalStyle: const FlatButtonStyle(
backgroundColors: MultiColor(_colors),
),
prefix: const Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
),
suffix: const Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
),
),
const Gap(20),
ColoredBox(
color: _background,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
const Gap(20),
FlatButton(
label: TextWrapper(
'Démarrer mon projet',
style: context.textTheme.titleLarge
?.copyWith(color: _disabled),
),
normalStyle: const FlatButtonStyle(
borderColors: MultiColor(_disabledColors),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 1,
),
),
const Gap(20),
FlatButton(
label: TextWrapper(
'Démarrer mon projet',
style: context.textTheme.titleLarge
?.copyWith(color: Colors.white),
),
normalStyle: const FlatButtonStyle(
backgroundColors: MultiColor(_colors),
),
),
const Gap(20),
],
),
const Gap(20),
Column(
children: [
const Gap(20),
FlatButton(
label: TextWrapper(
'Aller voir nos réalisations',
style: context.textTheme.titleLarge
?.copyWith(color: Colors.white),
),
normalStyle: const FlatButtonStyle(
borderColors: MultiColor(_colors),
backgroundColors:
MultiColor.single(_disabledBackground),
stroke: 3,
),
suffix: const Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
),
),
const Gap(20),
FlatButton(
label: TextWrapper(
'Aller voir nos réalisations',
style: context.textTheme.titleLarge
?.copyWith(color: Colors.white),
),
normalStyle: const FlatButtonStyle(
backgroundColors: MultiColor(_colors),
),
suffix: const Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
),
),
const Gap(20),
],
),
],
),
),
),
const Gap(20),
FlatButton(
onPressed: () => print('pressed'),
label: TextWrapper(
'Démarrer mon projet',
style:
context.textTheme.titleLarge?.copyWith(color: Colors.white),
),
disabledStyle: const FlatButtonStyle(
backgroundColors: MultiColor.single(Colors.blue),
),
normalStyle: const FlatButtonStyle(
backgroundColors: MultiColor(_colors),
),
hoveredStyle: const FlatButtonStyle(
backgroundColors: MultiColor.single(Colors.green),
),
focusedStyle: const FlatButtonStyle(
backgroundColors: MultiColor.single(Colors.yellow),
),
tappedStyle: const FlatButtonStyle(
backgroundColors: MultiColor.single(Colors.red),
),
),
],
);
}