wyatt-packages/packages/wyatt_ui_components
Hugo Pointcheval 10117ab39b
chore(release): publish packages
- wyatt_analysis@2.4.2
 - wyatt_architecture@0.2.0
 - wyatt_authentication_bloc@0.5.0
 - wyatt_bloc_helper@2.0.1
 - wyatt_bloc_layout@0.0.2
 - wyatt_component_copy_with_extension@2.0.0
 - wyatt_component_copy_with_gen@2.0.0
 - wyatt_crud_bloc@0.1.1
 - wyatt_form_bloc@0.2.0+3
 - wyatt_http_client@2.0.0
 - wyatt_i18n@2.0.0
 - wyatt_type_utils@0.0.5
 - wyatt_ui_components@0.1.0
 - wyatt_ui_kit@2.0.0
 - wyatt_ui_layout@0.0.2
2023-04-14 00:12:52 +02:00
..
2023-04-14 00:12:52 +02:00
2023-04-14 00:08:14 +02:00
2022-12-07 15:44:05 -05:00
2023-04-13 23:29:26 +02:00
2023-02-17 14:48:23 +01:00
2023-04-14 00:12:52 +02:00
2023-04-14 00:12:52 +02:00

Wyatt UI Components

Style: Wyatt Analysis SDK: Flutter

Wyatt UI Components for Flutter. This package defines all the components used in Wyatt Studio with their set of properties. But there is no implementation of the components. You have to create your own or check out Wyatt UI Kit package.

Usage

Configuration

First create all your custom components in domain/entities folder. For exemple :

├── domain
│ ├── entities
│ │ ├── custom_app_bar.dart
│ │ ├── custom_bottom_navigation_bar.dart
│ │ └── ...
│ └── ...
└── ...

Run flutter pub run build_runner build to generate your components.

Then, add your components to ComponentThemeData class.

Provider

In you main file, before calling router, call ComponentTheme widget and give your app as child. For example :

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) => ComponentTheme(
        componentThemeWidget: AppThemeComponent.components,
        child: MaterialApp(
          title: 'Wyatt Ui Layout Example',
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: const ..,
        ),
      );
}

Call

Then you're ready to call all your components from everywhere in your app using :

context.components,

For example :

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: context.components.appBar,
    body: ...
  )

If you need specific settings, or pass parameters to your component, call copyWith.call method.

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: context.components.appBar.copyWith.call({title: 'New Title !'}),
    body: ...
  )

Development

Common to this, and Wyatt UI Kit packages.

Add a new component :

Wyatt UI Components side

  1. Create a new file in lib/src/domain/entities folder.
  2. Add your component class.
  3. Add your component class to ComponentThemeData abstract class.
  4. Run flutter pub run build_runner build to generate your component proxy properties.

Wyatt UI Kit side

  1. Create a new file in lib/src/components folder.
  2. Add your component class, styles, (and logic if needed)
  3. Run flutter pub run build_runner build to generate your component copy with method.
  4. Add a theme extension to your component class in lib/src/domain/
  5. Add your component class wyattComponentThemeData static property in lib/src/features/wyatt_component_theme_data.dart