refactor(ui_kit): Refactored code using the UI components package, due to breaking changes

This commit is contained in:
Malo Léon 2023-08-28 14:19:36 +02:00
parent 18f34bc95c
commit 244dc38089
3 changed files with 71 additions and 72 deletions

View File

@ -30,13 +30,13 @@ class PortfolioCards extends StatelessWidget {
'quis elit ut amet velit. Incididunt fugiat proident '
'proident deserunt tempor Lorem cillum qui do '),
ctas: [
context.components.flatButtonComponent.call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
context.components.flatButtonComponent().call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
],
assets: [
Image.asset(
@ -65,13 +65,13 @@ class PortfolioCards extends StatelessWidget {
'quis elit ut amet velit. Incididunt fugiat proident '
'proident deserunt tempor Lorem cillum qui do '),
ctas: [
context.components.flatButtonComponent.call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
context.components.flatButtonComponent().call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
],
assets: [
Image.asset(
@ -100,13 +100,13 @@ class PortfolioCards extends StatelessWidget {
'quis elit ut amet velit. Incididunt fugiat proident '
'proident deserunt tempor Lorem cillum qui do '),
ctas: [
context.components.flatButtonComponent.call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
context.components.flatButtonComponent().call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
],
assets: [
Image.asset(
@ -145,13 +145,13 @@ class PortfolioCards extends StatelessWidget {
'quis elit ut amet velit. Incididunt fugiat proident '
'proident deserunt tempor Lorem cillum qui do '),
ctas: [
context.components.flatButtonComponent.call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
context.components.flatButtonComponent().call(
label: const TextWrapper('En savoir plus'),
suffix: const Icon(
Icons.arrow_forward_ios,
size: 15,
),
),
],
assets: [
Image.asset(

View File

@ -73,20 +73,20 @@ class PricingCards extends StatelessWidget {
),
),
],
cta: context.components.flatButtonComponent.call(
label: const TextWrapper(
'Contactez-nous',
style: TextStyle(color: Colors.white),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.blueBtnGradient),
borderColors:
const MultiColor(Constants.blueBtnGradient),
cta: context.components.flatButtonComponent().call(
label: const TextWrapper(
'Contactez-nous',
style: TextStyle(color: Colors.white),
),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.blueBtnGradient),
borderColors:
const MultiColor(Constants.blueBtnGradient),
),
),
),
const Gap(20),
PricingCard(
@ -130,20 +130,20 @@ class PricingCards extends StatelessWidget {
),
),
],
cta: context.components.flatButtonComponent.call(
label: const TextWrapper(
'Contactez-nous',
style: TextStyle(color: Colors.white),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.purpleGradient),
borderColors:
const MultiColor(Constants.purpleGradient),
cta: context.components.flatButtonComponent().call(
label: const TextWrapper(
'Contactez-nous',
style: TextStyle(color: Colors.white),
),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.purpleGradient),
borderColors:
const MultiColor(Constants.purpleGradient),
),
),
),
],
),

View File

@ -22,23 +22,22 @@ import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
/// {@endtemplate}
abstract class WyattComponentThemeData {
/// {@macro wyatt_component_theme_data}
static const ComponentThemeData wyattComponentThemeData =
ComponentThemeData.raw(
topAppBar: TopAppBar(),
topNavigationBar: TopNavigationBar(),
// bottomNavigationBar: ,
// error: ,
loader: Loader(),
richTextBuilder: RichTextBuilder(),
textInput: TextInput(),
fileSelectionButton: FileSelectionButton(),
flatButton: FlatButton(),
simpleIconButton: SimpleIconButton(),
symbolButton: SymbolButton(),
informationCard: InformationCard(),
portfolioCard: PortfolioCard(),
quoteCard: QuoteCard(),
skillCard: SkillCard(),
pricingCard: PricingCard(),
static ComponentThemeData wyattComponentThemeData = ComponentThemeData.raw(
topAppBars: const TopAppBar().registry(),
topNavigationBars: const TopNavigationBar().registry(),
// bottomNavigationBars: ,
// errors: ,
loaders: const Loader().registry(),
richTextBuilders: const RichTextBuilder().registry(),
textInputs: const TextInput().registry(),
fileSelectionButtons: const FileSelectionButton().registry(),
flatButtons: const FlatButton().registry(),
simpleIconButtons: const SimpleIconButton().registry(),
symbolButtons: const SymbolButton().registry(),
informationCards: const InformationCard().registry(),
portfolioCards: const PortfolioCard().registry(),
quoteCards: const QuoteCard().registry(),
skillCards: const SkillCard().registry(),
pricingCards: const PricingCard().registry(),
);
}