refactor(ui_layout): update exemple (close #116)
continuous-integration/drone/push Build is failing
continuous-integration/drone/push Build is failing
This commit was merged in pull request #120.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
class CustomAppBar extends AppBarComponent {
|
||||
part 'custom_app_bar.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
|
||||
const CustomAppBar({
|
||||
super.title,
|
||||
super.key,
|
||||
@@ -11,14 +15,4 @@ class CustomAppBar extends AppBarComponent {
|
||||
Widget build(BuildContext context) => AppBar(
|
||||
title: Text(title ?? ''),
|
||||
);
|
||||
|
||||
@override
|
||||
AppBarComponent? configure({
|
||||
String? title,
|
||||
Widget? leading,
|
||||
List<Widget>? actions,
|
||||
}) =>
|
||||
CustomAppBar(
|
||||
title: title ?? this.title,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_app_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
||||
const $CustomAppBarCWProxyImpl(this._value);
|
||||
final CustomAppBar _value;
|
||||
@override
|
||||
CustomAppBar title(String? title) => this(title: title);
|
||||
@override
|
||||
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
||||
@override
|
||||
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
|
||||
@override
|
||||
CustomAppBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomAppBar call({
|
||||
String? title,
|
||||
Widget? leading,
|
||||
List<Widget>? actions,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomAppBar(
|
||||
title: title ?? _value.title,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomAppBarCWMixin on Component {
|
||||
$AppBarComponentCWProxy get copyWith =>
|
||||
$CustomAppBarCWProxyImpl(this as CustomAppBar);
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
|
||||
class CustomBottomNavigationBar extends BottomNavigationBarComponent {
|
||||
part 'custom_bottom_navigation_bar.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomBottomNavigationBar extends BottomNavigationBarComponent
|
||||
with $CustomBottomNavigationBarCWMixin {
|
||||
const CustomBottomNavigationBar({
|
||||
super.currentIndex,
|
||||
super.onTap,
|
||||
@@ -27,14 +32,4 @@ class CustomBottomNavigationBar extends BottomNavigationBarComponent {
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@override
|
||||
CustomBottomNavigationBar? configure({
|
||||
void Function(BuildContext, int)? onTap,
|
||||
int currentIndex = 0,
|
||||
}) =>
|
||||
CustomBottomNavigationBar(
|
||||
onTap: onTap ?? this.onTap,
|
||||
currentIndex: currentIndex,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_bottom_navigation_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomBottomNavigationBarCWProxyImpl
|
||||
implements $BottomNavigationBarComponentCWProxy {
|
||||
const $CustomBottomNavigationBarCWProxyImpl(this._value);
|
||||
final CustomBottomNavigationBar _value;
|
||||
@override
|
||||
CustomBottomNavigationBar onTap(void Function(BuildContext, int)? onTap) =>
|
||||
this(onTap: onTap);
|
||||
@override
|
||||
CustomBottomNavigationBar currentIndex(int? currentIndex) =>
|
||||
this(currentIndex: currentIndex);
|
||||
@override
|
||||
CustomBottomNavigationBar key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomBottomNavigationBar call({
|
||||
void Function(BuildContext, int)? onTap,
|
||||
int? currentIndex,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomBottomNavigationBar(
|
||||
currentIndex: currentIndex ?? _value.currentIndex,
|
||||
onTap: onTap ?? _value.onTap,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomBottomNavigationBarCWMixin on Component {
|
||||
$BottomNavigationBarComponentCWProxy get copyWith =>
|
||||
$CustomBottomNavigationBarCWProxyImpl(this as CustomBottomNavigationBar);
|
||||
}
|
||||
Reference in New Issue
Block a user