This commit is contained in:
@@ -5,13 +5,17 @@ import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
part 'custom_error_widget.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomErrorWidget extends ErrorWidgetComponent
|
||||
with $CustomErrorWidgetCWMixin {
|
||||
const CustomErrorWidget({super.error, super.key});
|
||||
class CustomErrorWidget extends ErrorComponent with $CustomErrorWidgetCWMixin {
|
||||
const CustomErrorWidget({
|
||||
super.colors,
|
||||
super.message,
|
||||
super.details,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ColoredBox(
|
||||
color: Colors.red,
|
||||
child: Center(child: Text(error?.data ?? 'Error')),
|
||||
color: colors?.color ?? Colors.red,
|
||||
child: Center(child: Text(message?.data ?? 'Error')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,25 +6,38 @@ part of 'custom_error_widget.dart';
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
|
||||
class $CustomErrorWidgetCWProxyImpl implements $ErrorComponentCWProxy {
|
||||
const $CustomErrorWidgetCWProxyImpl(this._value);
|
||||
final CustomErrorWidget _value;
|
||||
@override
|
||||
CustomErrorWidget error(TextWrapper? error) => this(error: error);
|
||||
CustomErrorWidget colors(MultiColor? colors) => this(colors: colors);
|
||||
@override
|
||||
CustomErrorWidget message(TextWrapper? message) => this(message: message);
|
||||
@override
|
||||
CustomErrorWidget details(TextWrapper? details) => this(details: details);
|
||||
@override
|
||||
CustomErrorWidget themeResolver(
|
||||
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver) =>
|
||||
this(themeResolver: themeResolver);
|
||||
@override
|
||||
CustomErrorWidget key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomErrorWidget call({
|
||||
TextWrapper? error,
|
||||
MultiColor? colors,
|
||||
TextWrapper? message,
|
||||
TextWrapper? details,
|
||||
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomErrorWidget(
|
||||
error: error ?? _value.error,
|
||||
colors: colors ?? _value.colors,
|
||||
message: message ?? _value.message,
|
||||
details: details ?? _value.details,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomErrorWidgetCWMixin on Component {
|
||||
$ErrorWidgetComponentCWProxy get copyWith =>
|
||||
$ErrorComponentCWProxy get copyWith =>
|
||||
$CustomErrorWidgetCWProxyImpl(this as CustomErrorWidget);
|
||||
}
|
||||
|
||||
+12
-5
@@ -2,17 +2,24 @@ import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_component_copy_with_extension/wyatt_component_copy_with_extension.dart';
|
||||
import 'package:wyatt_ui_components/wyatt_ui_components.dart';
|
||||
|
||||
part 'custom_loading_widget.g.dart';
|
||||
part 'custom_loader_widget.g.dart';
|
||||
|
||||
@ComponentCopyWithExtension()
|
||||
class CustomLoadingWidget extends LoadingWidgetComponent
|
||||
with $CustomLoadingWidgetCWMixin {
|
||||
const CustomLoadingWidget({super.color, super.key});
|
||||
class CustomLoaderWidget extends LoaderComponent
|
||||
with $CustomLoaderWidgetCWMixin {
|
||||
const CustomLoaderWidget({
|
||||
super.colors,
|
||||
super.duration,
|
||||
super.flip,
|
||||
super.radius,
|
||||
super.stroke,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: color,
|
||||
color: colors?.color ?? Colors.blue,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_loader_widget.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomLoaderWidgetCWProxyImpl implements $LoaderComponentCWProxy {
|
||||
const $CustomLoaderWidgetCWProxyImpl(this._value);
|
||||
final CustomLoaderWidget _value;
|
||||
@override
|
||||
CustomLoaderWidget colors(MultiColor? colors) => this(colors: colors);
|
||||
@override
|
||||
CustomLoaderWidget radius(double? radius) => this(radius: radius);
|
||||
@override
|
||||
CustomLoaderWidget stroke(double? stroke) => this(stroke: stroke);
|
||||
@override
|
||||
CustomLoaderWidget duration(Duration? duration) => this(duration: duration);
|
||||
@override
|
||||
CustomLoaderWidget flip(bool? flip) => this(flip: flip);
|
||||
@override
|
||||
CustomLoaderWidget themeResolver(
|
||||
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver) =>
|
||||
this(themeResolver: themeResolver);
|
||||
@override
|
||||
CustomLoaderWidget key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomLoaderWidget call({
|
||||
MultiColor? colors,
|
||||
double? radius,
|
||||
double? stroke,
|
||||
Duration? duration,
|
||||
bool? flip,
|
||||
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomLoaderWidget(
|
||||
colors: colors ?? _value.colors,
|
||||
duration: duration ?? _value.duration,
|
||||
flip: flip ?? _value.flip,
|
||||
radius: radius ?? _value.radius,
|
||||
stroke: stroke ?? _value.stroke,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomLoaderWidgetCWMixin on Component {
|
||||
$LoaderComponentCWProxy get copyWith =>
|
||||
$CustomLoaderWidgetCWProxyImpl(this as CustomLoaderWidget);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'custom_loading_widget.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// ComponentCopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class $CustomLoadingWidgetCWProxyImpl
|
||||
implements $LoadingWidgetComponentCWProxy {
|
||||
const $CustomLoadingWidgetCWProxyImpl(this._value);
|
||||
final CustomLoadingWidget _value;
|
||||
@override
|
||||
CustomLoadingWidget color(Color? color) => this(color: color);
|
||||
@override
|
||||
CustomLoadingWidget key(Key? key) => this(key: key);
|
||||
@override
|
||||
CustomLoadingWidget call({
|
||||
Color? color,
|
||||
Key? key,
|
||||
}) =>
|
||||
CustomLoadingWidget(
|
||||
color: color ?? _value.color,
|
||||
key: key ?? _value.key,
|
||||
);
|
||||
}
|
||||
|
||||
mixin $CustomLoadingWidgetCWMixin on Component {
|
||||
$LoadingWidgetComponentCWProxy get copyWith =>
|
||||
$CustomLoadingWidgetCWProxyImpl(this as CustomLoadingWidget);
|
||||
}
|
||||
Reference in New Issue
Block a user