master #81

Closed
malo wants to merge 322 commits from master into feat/bloc_layout/new-package
4 changed files with 14 additions and 14 deletions
Showing only changes of commit 81a7ca5a1f - Show all commits

View File

@ -50,7 +50,7 @@ class Home extends StatelessWidget {
Widget build(BuildContext context) => Scaffold( Widget build(BuildContext context) => Scaffold(
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: const Size.fromHeight(60), preferredSize: const Size.fromHeight(60),
child: context.components.appBar.configure(title: 'Example title'), child: context.components.appBar?.configure(title: 'Example title'),
), ),
body: Column( body: Column(
children: [ children: [

View File

@ -19,5 +19,5 @@ import 'package:flutter/material.dart';
abstract class Component extends StatelessWidget { abstract class Component extends StatelessWidget {
const Component({super.key}); const Component({super.key});
Component configure(); Component? configure();
} }

View File

@ -29,7 +29,7 @@ abstract class AppBarComponent extends Component {
}); });
@override @override
AppBarComponent configure({ AppBarComponent? configure({
String? title, String? title,
Widget? leading, Widget? leading,
List<Widget>? actions, List<Widget>? actions,
@ -46,7 +46,7 @@ abstract class BottomNavigationBarComponent extends Component {
}); });
@override @override
BottomNavigationBarComponent configure({ BottomNavigationBarComponent? configure({
void Function(BuildContext, int)? onTap, void Function(BuildContext, int)? onTap,
int currentIndex = 0, int currentIndex = 0,
}); });
@ -57,7 +57,7 @@ abstract class ErrorWidgetComponent extends Component {
const ErrorWidgetComponent({required this.error, super.key}); const ErrorWidgetComponent({required this.error, super.key});
@override @override
ErrorWidgetComponent configure({String? error}); ErrorWidgetComponent? configure({String? error});
} }
abstract class LoadingWidgetComponent extends Component { abstract class LoadingWidgetComponent extends Component {
@ -65,5 +65,5 @@ abstract class LoadingWidgetComponent extends Component {
const LoadingWidgetComponent({required this.color, super.key}); const LoadingWidgetComponent({required this.color, super.key});
@override @override
LoadingWidgetComponent configure({Color? color}); LoadingWidgetComponent? configure({Color? color});
} }

View File

@ -17,15 +17,15 @@
import 'package:wyatt_ui_components/src/domain/entities/components.dart'; import 'package:wyatt_ui_components/src/domain/entities/components.dart';
class ComponentThemeData { class ComponentThemeData {
final AppBarComponent appBar; final AppBarComponent? appBar;
final BottomNavigationBarComponent bottomNavigationBar; final BottomNavigationBarComponent? bottomNavigationBar;
final ErrorWidgetComponent errorWidget; final ErrorWidgetComponent? errorWidget;
final LoadingWidgetComponent loadingWidget; final LoadingWidgetComponent? loadingWidget;
const ComponentThemeData.raw({ const ComponentThemeData.raw({
required this.appBar, this.appBar,
required this.bottomNavigationBar, this.bottomNavigationBar,
required this.errorWidget, this.errorWidget,
required this.loadingWidget, this.loadingWidget,
}); });
} }