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

View File

@ -73,20 +73,20 @@ class PricingCards extends StatelessWidget {
), ),
), ),
], ],
cta: context.components.flatButtonComponent.call( cta: context.components.flatButtonComponent().call(
label: const TextWrapper( label: const TextWrapper(
'Contactez-nous', 'Contactez-nous',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.blueBtnGradient),
borderColors:
const MultiColor(Constants.blueBtnGradient),
), ),
), normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.blueBtnGradient),
borderColors:
const MultiColor(Constants.blueBtnGradient),
),
),
), ),
const Gap(20), const Gap(20),
PricingCard( PricingCard(
@ -130,20 +130,20 @@ class PricingCards extends StatelessWidget {
), ),
), ),
], ],
cta: context.components.flatButtonComponent.call( cta: context.components.flatButtonComponent().call(
label: const TextWrapper( label: const TextWrapper(
'Contactez-nous', 'Contactez-nous',
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
),
normalStyle: FlatButtonThemeExtensionImpl.dark(
theme: Theme.of(context),
).normalStyle?.copyWith(
backgroundColors:
const MultiColor(Constants.purpleGradient),
borderColors:
const MultiColor(Constants.purpleGradient),
), ),
), 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} /// {@endtemplate}
abstract class WyattComponentThemeData { abstract class WyattComponentThemeData {
/// {@macro wyatt_component_theme_data} /// {@macro wyatt_component_theme_data}
static const ComponentThemeData wyattComponentThemeData = static ComponentThemeData wyattComponentThemeData = ComponentThemeData.raw(
ComponentThemeData.raw( topAppBars: const TopAppBar().registry(),
topAppBar: TopAppBar(), topNavigationBars: const TopNavigationBar().registry(),
topNavigationBar: TopNavigationBar(), // bottomNavigationBars: ,
// bottomNavigationBar: , // errors: ,
// error: , loaders: const Loader().registry(),
loader: Loader(), richTextBuilders: const RichTextBuilder().registry(),
richTextBuilder: RichTextBuilder(), textInputs: const TextInput().registry(),
textInput: TextInput(), fileSelectionButtons: const FileSelectionButton().registry(),
fileSelectionButton: FileSelectionButton(), flatButtons: const FlatButton().registry(),
flatButton: FlatButton(), simpleIconButtons: const SimpleIconButton().registry(),
simpleIconButton: SimpleIconButton(), symbolButtons: const SymbolButton().registry(),
symbolButton: SymbolButton(), informationCards: const InformationCard().registry(),
informationCard: InformationCard(), portfolioCards: const PortfolioCard().registry(),
portfolioCard: PortfolioCard(), quoteCards: const QuoteCard().registry(),
quoteCard: QuoteCard(), skillCards: const SkillCard().registry(),
skillCard: SkillCard(), pricingCards: const PricingCard().registry(),
pricingCard: PricingCard(),
); );
} }