feat(ui_layout): update example & move configure function (#69)
This commit was merged in pull request #70.
This commit is contained in:
@@ -2,4 +2,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
abstract class Component extends StatelessWidget {
|
||||
const Component({super.key});
|
||||
|
||||
Component configure();
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ abstract class AppBarComponent extends Component {
|
||||
final String? title;
|
||||
const AppBarComponent({this.title, super.key});
|
||||
|
||||
@override
|
||||
AppBarComponent configure({String? title});
|
||||
}
|
||||
|
||||
@@ -33,17 +34,25 @@ abstract class BottomNavigationBarComponent extends Component {
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
BottomNavigationBarComponent configure({
|
||||
void Function(BuildContext, int)? onTap,
|
||||
int currentIndex = 0,
|
||||
});
|
||||
}
|
||||
|
||||
abstract class ErrorWidget extends Component {
|
||||
final String error;
|
||||
const ErrorWidget({required this.error, super.key});
|
||||
abstract class ErrorWidgetComponent extends Component {
|
||||
final String? error;
|
||||
const ErrorWidgetComponent({required this.error, super.key});
|
||||
|
||||
@override
|
||||
ErrorWidgetComponent configure({String? error});
|
||||
}
|
||||
|
||||
abstract class LoadingWidget extends Component {
|
||||
const LoadingWidget({super.key});
|
||||
abstract class LoadingWidgetComponent extends Component {
|
||||
final Color? color;
|
||||
const LoadingWidgetComponent({required this.color, super.key});
|
||||
|
||||
@override
|
||||
LoadingWidgetComponent configure({Color? color});
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import 'package:wyatt_ui_components/src/domain/entities/components.dart';
|
||||
class ComponentThemeData {
|
||||
final AppBarComponent appBar;
|
||||
final BottomNavigationBarComponent bottomNavigationBar;
|
||||
final ErrorWidget errorWidget;
|
||||
final LoadingWidget loadingWidget;
|
||||
final ErrorWidgetComponent errorWidget;
|
||||
final LoadingWidgetComponent loadingWidget;
|
||||
|
||||
const ComponentThemeData.raw({
|
||||
required this.appBar,
|
||||
|
||||
Reference in New Issue
Block a user