ui_components/feat/make-data-fields-nullable #93
| @ -50,7 +50,7 @@ class Home extends StatelessWidget { | ||||
|   Widget build(BuildContext context) => Scaffold( | ||||
|         appBar: PreferredSize( | ||||
|           preferredSize: const Size.fromHeight(60), | ||||
|           child: context.components.appBar.configure(title: 'Example title'), | ||||
|           child: context.components.appBar?.configure(title: 'Example title'), | ||||
|         ), | ||||
|         body: Column( | ||||
|           children: [ | ||||
|  | ||||
| @ -19,5 +19,5 @@ import 'package:flutter/material.dart'; | ||||
| abstract class Component extends StatelessWidget { | ||||
|   const Component({super.key}); | ||||
| 
 | ||||
|   Component configure(); | ||||
|   Component? configure(); | ||||
| } | ||||
|  | ||||
| @ -29,7 +29,7 @@ abstract class AppBarComponent extends Component { | ||||
|   }); | ||||
| 
 | ||||
|   @override | ||||
|   AppBarComponent configure({ | ||||
|   AppBarComponent? configure({ | ||||
|     String? title, | ||||
|     Widget? leading, | ||||
|     List<Widget>? actions, | ||||
| @ -46,7 +46,7 @@ abstract class BottomNavigationBarComponent extends Component { | ||||
|   }); | ||||
| 
 | ||||
|   @override | ||||
|   BottomNavigationBarComponent configure({ | ||||
|   BottomNavigationBarComponent? configure({ | ||||
|     void Function(BuildContext, int)? onTap, | ||||
|     int currentIndex = 0, | ||||
|   }); | ||||
| @ -57,7 +57,7 @@ abstract class ErrorWidgetComponent extends Component { | ||||
|   const ErrorWidgetComponent({required this.error, super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   ErrorWidgetComponent configure({String? error}); | ||||
|   ErrorWidgetComponent? configure({String? error}); | ||||
| } | ||||
| 
 | ||||
| abstract class LoadingWidgetComponent extends Component { | ||||
| @ -65,5 +65,5 @@ abstract class LoadingWidgetComponent extends Component { | ||||
|   const LoadingWidgetComponent({required this.color, super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   LoadingWidgetComponent configure({Color? color}); | ||||
|   LoadingWidgetComponent? configure({Color? color}); | ||||
| } | ||||
|  | ||||
| @ -17,15 +17,15 @@ | ||||
| import 'package:wyatt_ui_components/src/domain/entities/components.dart'; | ||||
| 
 | ||||
| class ComponentThemeData { | ||||
|   final AppBarComponent appBar; | ||||
|   final BottomNavigationBarComponent bottomNavigationBar; | ||||
|   final ErrorWidgetComponent errorWidget; | ||||
|   final LoadingWidgetComponent loadingWidget; | ||||
|   final AppBarComponent? appBar; | ||||
|   final BottomNavigationBarComponent? bottomNavigationBar; | ||||
|   final ErrorWidgetComponent? errorWidget; | ||||
|   final LoadingWidgetComponent? loadingWidget; | ||||
| 
 | ||||
|   const ComponentThemeData.raw({ | ||||
|     required this.appBar, | ||||
|     required this.bottomNavigationBar, | ||||
|     required this.errorWidget, | ||||
|     required this.loadingWidget, | ||||
|     this.appBar, | ||||
|     this.bottomNavigationBar, | ||||
|     this.errorWidget, | ||||
|     this.loadingWidget, | ||||
|   }); | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user