diff --git a/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.dart b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.dart new file mode 100644 index 00000000..9998ad2e --- /dev/null +++ b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:mirai/mirai.dart'; +import 'package:mirai/src/utils/color_utils.dart'; + +part 'mirai_dialog_theme.freezed.dart'; +part 'mirai_dialog_theme.g.dart'; + +@freezed +class MiraiDialogTheme with _$MiraiDialogTheme { + const factory MiraiDialogTheme({ + String? backgroundColor, + double? elevation, + String? shadowColor, + String? surfaceTintColor, + MiraiBorder? shape, + MiraiAlignmentGeometry? alignment, + MiraiTextStyle? titleTextStyle, + MiraiTextStyle? contentTextStyle, + MiraiEdgeInsets? actionsPadding, + String? iconColor, + }) = _MiraiDialogTheme; + + factory MiraiDialogTheme.fromJson(Map json) => + _$MiraiDialogThemeFromJson(json); +} + +extension MiraiDialogThemeParser on MiraiDialogTheme { + DialogTheme? get parse { + return DialogTheme( + backgroundColor: backgroundColor.toColor, + elevation: elevation, + shadowColor: shadowColor.toColor, + surfaceTintColor: surfaceTintColor.toColor, + shape: shape?.parse, + alignment: alignment?.parse, + titleTextStyle: titleTextStyle?.parse, + contentTextStyle: contentTextStyle?.parse, + actionsPadding: actionsPadding.parse, + iconColor: iconColor.toColor, + ); + } +} diff --git a/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.freezed.dart b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.freezed.dart new file mode 100644 index 00000000..d213887f --- /dev/null +++ b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.freezed.dart @@ -0,0 +1,432 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'mirai_dialog_theme.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +MiraiDialogTheme _$MiraiDialogThemeFromJson(Map json) { + return _MiraiDialogTheme.fromJson(json); +} + +/// @nodoc +mixin _$MiraiDialogTheme { + String? get backgroundColor => throw _privateConstructorUsedError; + double? get elevation => throw _privateConstructorUsedError; + String? get shadowColor => throw _privateConstructorUsedError; + String? get surfaceTintColor => throw _privateConstructorUsedError; + MiraiBorder? get shape => throw _privateConstructorUsedError; + MiraiAlignmentGeometry? get alignment => throw _privateConstructorUsedError; + MiraiTextStyle? get titleTextStyle => throw _privateConstructorUsedError; + MiraiTextStyle? get contentTextStyle => throw _privateConstructorUsedError; + MiraiEdgeInsets? get actionsPadding => throw _privateConstructorUsedError; + String? get iconColor => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $MiraiDialogThemeCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $MiraiDialogThemeCopyWith<$Res> { + factory $MiraiDialogThemeCopyWith( + MiraiDialogTheme value, $Res Function(MiraiDialogTheme) then) = + _$MiraiDialogThemeCopyWithImpl<$Res, MiraiDialogTheme>; + @useResult + $Res call( + {String? backgroundColor, + double? elevation, + String? shadowColor, + String? surfaceTintColor, + MiraiBorder? shape, + MiraiAlignmentGeometry? alignment, + MiraiTextStyle? titleTextStyle, + MiraiTextStyle? contentTextStyle, + MiraiEdgeInsets? actionsPadding, + String? iconColor}); + + $MiraiBorderCopyWith<$Res>? get shape; + $MiraiAlignmentGeometryCopyWith<$Res>? get alignment; + $MiraiTextStyleCopyWith<$Res>? get titleTextStyle; + $MiraiTextStyleCopyWith<$Res>? get contentTextStyle; + $MiraiEdgeInsetsCopyWith<$Res>? get actionsPadding; +} + +/// @nodoc +class _$MiraiDialogThemeCopyWithImpl<$Res, $Val extends MiraiDialogTheme> + implements $MiraiDialogThemeCopyWith<$Res> { + _$MiraiDialogThemeCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? backgroundColor = freezed, + Object? elevation = freezed, + Object? shadowColor = freezed, + Object? surfaceTintColor = freezed, + Object? shape = freezed, + Object? alignment = freezed, + Object? titleTextStyle = freezed, + Object? contentTextStyle = freezed, + Object? actionsPadding = freezed, + Object? iconColor = freezed, + }) { + return _then(_value.copyWith( + backgroundColor: freezed == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as String?, + elevation: freezed == elevation + ? _value.elevation + : elevation // ignore: cast_nullable_to_non_nullable + as double?, + shadowColor: freezed == shadowColor + ? _value.shadowColor + : shadowColor // ignore: cast_nullable_to_non_nullable + as String?, + surfaceTintColor: freezed == surfaceTintColor + ? _value.surfaceTintColor + : surfaceTintColor // ignore: cast_nullable_to_non_nullable + as String?, + shape: freezed == shape + ? _value.shape + : shape // ignore: cast_nullable_to_non_nullable + as MiraiBorder?, + alignment: freezed == alignment + ? _value.alignment + : alignment // ignore: cast_nullable_to_non_nullable + as MiraiAlignmentGeometry?, + titleTextStyle: freezed == titleTextStyle + ? _value.titleTextStyle + : titleTextStyle // ignore: cast_nullable_to_non_nullable + as MiraiTextStyle?, + contentTextStyle: freezed == contentTextStyle + ? _value.contentTextStyle + : contentTextStyle // ignore: cast_nullable_to_non_nullable + as MiraiTextStyle?, + actionsPadding: freezed == actionsPadding + ? _value.actionsPadding + : actionsPadding // ignore: cast_nullable_to_non_nullable + as MiraiEdgeInsets?, + iconColor: freezed == iconColor + ? _value.iconColor + : iconColor // ignore: cast_nullable_to_non_nullable + as String?, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $MiraiBorderCopyWith<$Res>? get shape { + if (_value.shape == null) { + return null; + } + + return $MiraiBorderCopyWith<$Res>(_value.shape!, (value) { + return _then(_value.copyWith(shape: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $MiraiAlignmentGeometryCopyWith<$Res>? get alignment { + if (_value.alignment == null) { + return null; + } + + return $MiraiAlignmentGeometryCopyWith<$Res>(_value.alignment!, (value) { + return _then(_value.copyWith(alignment: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $MiraiTextStyleCopyWith<$Res>? get titleTextStyle { + if (_value.titleTextStyle == null) { + return null; + } + + return $MiraiTextStyleCopyWith<$Res>(_value.titleTextStyle!, (value) { + return _then(_value.copyWith(titleTextStyle: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $MiraiTextStyleCopyWith<$Res>? get contentTextStyle { + if (_value.contentTextStyle == null) { + return null; + } + + return $MiraiTextStyleCopyWith<$Res>(_value.contentTextStyle!, (value) { + return _then(_value.copyWith(contentTextStyle: value) as $Val); + }); + } + + @override + @pragma('vm:prefer-inline') + $MiraiEdgeInsetsCopyWith<$Res>? get actionsPadding { + if (_value.actionsPadding == null) { + return null; + } + + return $MiraiEdgeInsetsCopyWith<$Res>(_value.actionsPadding!, (value) { + return _then(_value.copyWith(actionsPadding: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$_MiraiDialogThemeCopyWith<$Res> + implements $MiraiDialogThemeCopyWith<$Res> { + factory _$$_MiraiDialogThemeCopyWith( + _$_MiraiDialogTheme value, $Res Function(_$_MiraiDialogTheme) then) = + __$$_MiraiDialogThemeCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String? backgroundColor, + double? elevation, + String? shadowColor, + String? surfaceTintColor, + MiraiBorder? shape, + MiraiAlignmentGeometry? alignment, + MiraiTextStyle? titleTextStyle, + MiraiTextStyle? contentTextStyle, + MiraiEdgeInsets? actionsPadding, + String? iconColor}); + + @override + $MiraiBorderCopyWith<$Res>? get shape; + @override + $MiraiAlignmentGeometryCopyWith<$Res>? get alignment; + @override + $MiraiTextStyleCopyWith<$Res>? get titleTextStyle; + @override + $MiraiTextStyleCopyWith<$Res>? get contentTextStyle; + @override + $MiraiEdgeInsetsCopyWith<$Res>? get actionsPadding; +} + +/// @nodoc +class __$$_MiraiDialogThemeCopyWithImpl<$Res> + extends _$MiraiDialogThemeCopyWithImpl<$Res, _$_MiraiDialogTheme> + implements _$$_MiraiDialogThemeCopyWith<$Res> { + __$$_MiraiDialogThemeCopyWithImpl( + _$_MiraiDialogTheme _value, $Res Function(_$_MiraiDialogTheme) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? backgroundColor = freezed, + Object? elevation = freezed, + Object? shadowColor = freezed, + Object? surfaceTintColor = freezed, + Object? shape = freezed, + Object? alignment = freezed, + Object? titleTextStyle = freezed, + Object? contentTextStyle = freezed, + Object? actionsPadding = freezed, + Object? iconColor = freezed, + }) { + return _then(_$_MiraiDialogTheme( + backgroundColor: freezed == backgroundColor + ? _value.backgroundColor + : backgroundColor // ignore: cast_nullable_to_non_nullable + as String?, + elevation: freezed == elevation + ? _value.elevation + : elevation // ignore: cast_nullable_to_non_nullable + as double?, + shadowColor: freezed == shadowColor + ? _value.shadowColor + : shadowColor // ignore: cast_nullable_to_non_nullable + as String?, + surfaceTintColor: freezed == surfaceTintColor + ? _value.surfaceTintColor + : surfaceTintColor // ignore: cast_nullable_to_non_nullable + as String?, + shape: freezed == shape + ? _value.shape + : shape // ignore: cast_nullable_to_non_nullable + as MiraiBorder?, + alignment: freezed == alignment + ? _value.alignment + : alignment // ignore: cast_nullable_to_non_nullable + as MiraiAlignmentGeometry?, + titleTextStyle: freezed == titleTextStyle + ? _value.titleTextStyle + : titleTextStyle // ignore: cast_nullable_to_non_nullable + as MiraiTextStyle?, + contentTextStyle: freezed == contentTextStyle + ? _value.contentTextStyle + : contentTextStyle // ignore: cast_nullable_to_non_nullable + as MiraiTextStyle?, + actionsPadding: freezed == actionsPadding + ? _value.actionsPadding + : actionsPadding // ignore: cast_nullable_to_non_nullable + as MiraiEdgeInsets?, + iconColor: freezed == iconColor + ? _value.iconColor + : iconColor // ignore: cast_nullable_to_non_nullable + as String?, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$_MiraiDialogTheme implements _MiraiDialogTheme { + const _$_MiraiDialogTheme( + {this.backgroundColor, + this.elevation, + this.shadowColor, + this.surfaceTintColor, + this.shape, + this.alignment, + this.titleTextStyle, + this.contentTextStyle, + this.actionsPadding, + this.iconColor}); + + factory _$_MiraiDialogTheme.fromJson(Map json) => + _$$_MiraiDialogThemeFromJson(json); + + @override + final String? backgroundColor; + @override + final double? elevation; + @override + final String? shadowColor; + @override + final String? surfaceTintColor; + @override + final MiraiBorder? shape; + @override + final MiraiAlignmentGeometry? alignment; + @override + final MiraiTextStyle? titleTextStyle; + @override + final MiraiTextStyle? contentTextStyle; + @override + final MiraiEdgeInsets? actionsPadding; + @override + final String? iconColor; + + @override + String toString() { + return 'MiraiDialogTheme(backgroundColor: $backgroundColor, elevation: $elevation, shadowColor: $shadowColor, surfaceTintColor: $surfaceTintColor, shape: $shape, alignment: $alignment, titleTextStyle: $titleTextStyle, contentTextStyle: $contentTextStyle, actionsPadding: $actionsPadding, iconColor: $iconColor)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$_MiraiDialogTheme && + (identical(other.backgroundColor, backgroundColor) || + other.backgroundColor == backgroundColor) && + (identical(other.elevation, elevation) || + other.elevation == elevation) && + (identical(other.shadowColor, shadowColor) || + other.shadowColor == shadowColor) && + (identical(other.surfaceTintColor, surfaceTintColor) || + other.surfaceTintColor == surfaceTintColor) && + (identical(other.shape, shape) || other.shape == shape) && + (identical(other.alignment, alignment) || + other.alignment == alignment) && + (identical(other.titleTextStyle, titleTextStyle) || + other.titleTextStyle == titleTextStyle) && + (identical(other.contentTextStyle, contentTextStyle) || + other.contentTextStyle == contentTextStyle) && + (identical(other.actionsPadding, actionsPadding) || + other.actionsPadding == actionsPadding) && + (identical(other.iconColor, iconColor) || + other.iconColor == iconColor)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash( + runtimeType, + backgroundColor, + elevation, + shadowColor, + surfaceTintColor, + shape, + alignment, + titleTextStyle, + contentTextStyle, + actionsPadding, + iconColor); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$_MiraiDialogThemeCopyWith<_$_MiraiDialogTheme> get copyWith => + __$$_MiraiDialogThemeCopyWithImpl<_$_MiraiDialogTheme>(this, _$identity); + + @override + Map toJson() { + return _$$_MiraiDialogThemeToJson( + this, + ); + } +} + +abstract class _MiraiDialogTheme implements MiraiDialogTheme { + const factory _MiraiDialogTheme( + {final String? backgroundColor, + final double? elevation, + final String? shadowColor, + final String? surfaceTintColor, + final MiraiBorder? shape, + final MiraiAlignmentGeometry? alignment, + final MiraiTextStyle? titleTextStyle, + final MiraiTextStyle? contentTextStyle, + final MiraiEdgeInsets? actionsPadding, + final String? iconColor}) = _$_MiraiDialogTheme; + + factory _MiraiDialogTheme.fromJson(Map json) = + _$_MiraiDialogTheme.fromJson; + + @override + String? get backgroundColor; + @override + double? get elevation; + @override + String? get shadowColor; + @override + String? get surfaceTintColor; + @override + MiraiBorder? get shape; + @override + MiraiAlignmentGeometry? get alignment; + @override + MiraiTextStyle? get titleTextStyle; + @override + MiraiTextStyle? get contentTextStyle; + @override + MiraiEdgeInsets? get actionsPadding; + @override + String? get iconColor; + @override + @JsonKey(ignore: true) + _$$_MiraiDialogThemeCopyWith<_$_MiraiDialogTheme> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.g.dart b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.g.dart new file mode 100644 index 00000000..e53a8512 --- /dev/null +++ b/packages/mirai/lib/src/parsers/mirai_dialog_theme/mirai_dialog_theme.g.dart @@ -0,0 +1,49 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'mirai_dialog_theme.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$_MiraiDialogTheme _$$_MiraiDialogThemeFromJson(Map json) => + _$_MiraiDialogTheme( + backgroundColor: json['backgroundColor'] as String?, + elevation: (json['elevation'] as num?)?.toDouble(), + shadowColor: json['shadowColor'] as String?, + surfaceTintColor: json['surfaceTintColor'] as String?, + shape: json['shape'] == null + ? null + : MiraiBorder.fromJson(json['shape'] as Map), + alignment: json['alignment'] == null + ? null + : MiraiAlignmentGeometry.fromJson( + json['alignment'] as Map), + titleTextStyle: json['titleTextStyle'] == null + ? null + : MiraiTextStyle.fromJson( + json['titleTextStyle'] as Map), + contentTextStyle: json['contentTextStyle'] == null + ? null + : MiraiTextStyle.fromJson( + json['contentTextStyle'] as Map), + actionsPadding: json['actionsPadding'] == null + ? null + : MiraiEdgeInsets.fromJson( + json['actionsPadding'] as Map), + iconColor: json['iconColor'] as String?, + ); + +Map _$$_MiraiDialogThemeToJson(_$_MiraiDialogTheme instance) => + { + 'backgroundColor': instance.backgroundColor, + 'elevation': instance.elevation, + 'shadowColor': instance.shadowColor, + 'surfaceTintColor': instance.surfaceTintColor, + 'shape': instance.shape, + 'alignment': instance.alignment, + 'titleTextStyle': instance.titleTextStyle, + 'contentTextStyle': instance.contentTextStyle, + 'actionsPadding': instance.actionsPadding, + 'iconColor': instance.iconColor, + }; diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart index 22a02feb..029aa4a3 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart @@ -7,6 +7,7 @@ import 'package:mirai/src/parsers/mirai_bottom_sheet_theme/mirai_bottom_sheet_th import 'package:mirai/src/parsers/mirai_button_style/mirai_button_style.dart'; import 'package:mirai/src/parsers/mirai_card_theme_data/mirai_card_theme_data.dart'; import 'package:mirai/src/parsers/mirai_color_scheme/mirai_color_scheme.dart'; +import 'package:mirai/src/parsers/mirai_dialog_theme/mirai_dialog_theme.dart'; import 'package:mirai/src/parsers/mirai_floating_action_button_theme_data/mirai_floating_action_button_theme_data.dart'; import 'package:mirai/src/parsers/mirai_icon_theme_data/mirai_icon_theme_data.dart'; import 'package:mirai/src/parsers/mirai_material_color/mirai_material_color.dart'; @@ -48,6 +49,7 @@ class MiraiTheme with _$MiraiTheme { MiraiButtonStyle? iconButtonTheme, MiraiIconThemeData? iconTheme, MiraiIconThemeData? primaryIconTheme, + MiraiDialogTheme? dialogTheme, MiraiFloatingActionButtonThemeData? floatingActionButtonTheme, MiraiButtonStyle? textButtonTheme, MiraiBottomAppBarTheme? bottomAppBarTheme, @@ -94,6 +96,7 @@ extension MiraiThemeParser on MiraiTheme { iconButtonTheme: IconButtonThemeData(style: iconButtonTheme?.parseIcon), iconTheme: iconTheme?.parse, primaryIconTheme: primaryIconTheme?.parse, + dialogTheme: dialogTheme?.parse, floatingActionButtonTheme: floatingActionButtonTheme?.parse, textButtonTheme: TextButtonThemeData(style: textButtonTheme?.parseText), bottomAppBarTheme: bottomAppBarTheme?.parse, diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart index c22c203c..1d356617 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart @@ -53,6 +53,7 @@ mixin _$MiraiTheme { MiraiIconThemeData? get iconTheme => throw _privateConstructorUsedError; MiraiIconThemeData? get primaryIconTheme => throw _privateConstructorUsedError; + MiraiDialogTheme? get dialogTheme => throw _privateConstructorUsedError; MiraiFloatingActionButtonThemeData? get floatingActionButtonTheme => throw _privateConstructorUsedError; MiraiButtonStyle? get textButtonTheme => throw _privateConstructorUsedError; @@ -107,6 +108,7 @@ abstract class $MiraiThemeCopyWith<$Res> { MiraiButtonStyle? iconButtonTheme, MiraiIconThemeData? iconTheme, MiraiIconThemeData? primaryIconTheme, + MiraiDialogTheme? dialogTheme, MiraiFloatingActionButtonThemeData? floatingActionButtonTheme, MiraiButtonStyle? textButtonTheme, MiraiBottomAppBarTheme? bottomAppBarTheme, @@ -122,6 +124,7 @@ abstract class $MiraiThemeCopyWith<$Res> { $MiraiButtonStyleCopyWith<$Res>? get iconButtonTheme; $MiraiIconThemeDataCopyWith<$Res>? get iconTheme; $MiraiIconThemeDataCopyWith<$Res>? get primaryIconTheme; + $MiraiDialogThemeCopyWith<$Res>? get dialogTheme; $MiraiFloatingActionButtonThemeDataCopyWith<$Res>? get floatingActionButtonTheme; $MiraiButtonStyleCopyWith<$Res>? get textButtonTheme; @@ -174,6 +177,7 @@ class _$MiraiThemeCopyWithImpl<$Res, $Val extends MiraiTheme> Object? iconButtonTheme = freezed, Object? iconTheme = freezed, Object? primaryIconTheme = freezed, + Object? dialogTheme = freezed, Object? floatingActionButtonTheme = freezed, Object? textButtonTheme = freezed, Object? bottomAppBarTheme = freezed, @@ -302,6 +306,10 @@ class _$MiraiThemeCopyWithImpl<$Res, $Val extends MiraiTheme> ? _value.primaryIconTheme : primaryIconTheme // ignore: cast_nullable_to_non_nullable as MiraiIconThemeData?, + dialogTheme: freezed == dialogTheme + ? _value.dialogTheme + : dialogTheme // ignore: cast_nullable_to_non_nullable + as MiraiDialogTheme?, floatingActionButtonTheme: freezed == floatingActionButtonTheme ? _value.floatingActionButtonTheme : floatingActionButtonTheme // ignore: cast_nullable_to_non_nullable @@ -427,6 +435,18 @@ class _$MiraiThemeCopyWithImpl<$Res, $Val extends MiraiTheme> }); } + @override + @pragma('vm:prefer-inline') + $MiraiDialogThemeCopyWith<$Res>? get dialogTheme { + if (_value.dialogTheme == null) { + return null; + } + + return $MiraiDialogThemeCopyWith<$Res>(_value.dialogTheme!, (value) { + return _then(_value.copyWith(dialogTheme: value) as $Val); + }); + } + @override @pragma('vm:prefer-inline') $MiraiFloatingActionButtonThemeDataCopyWith<$Res>? @@ -544,6 +564,7 @@ abstract class _$$_MiraiThemeCopyWith<$Res> MiraiButtonStyle? iconButtonTheme, MiraiIconThemeData? iconTheme, MiraiIconThemeData? primaryIconTheme, + MiraiDialogTheme? dialogTheme, MiraiFloatingActionButtonThemeData? floatingActionButtonTheme, MiraiButtonStyle? textButtonTheme, MiraiBottomAppBarTheme? bottomAppBarTheme, @@ -568,6 +589,8 @@ abstract class _$$_MiraiThemeCopyWith<$Res> @override $MiraiIconThemeDataCopyWith<$Res>? get primaryIconTheme; @override + $MiraiDialogThemeCopyWith<$Res>? get dialogTheme; + @override $MiraiFloatingActionButtonThemeDataCopyWith<$Res>? get floatingActionButtonTheme; @override @@ -623,6 +646,7 @@ class __$$_MiraiThemeCopyWithImpl<$Res> Object? iconButtonTheme = freezed, Object? iconTheme = freezed, Object? primaryIconTheme = freezed, + Object? dialogTheme = freezed, Object? floatingActionButtonTheme = freezed, Object? textButtonTheme = freezed, Object? bottomAppBarTheme = freezed, @@ -751,6 +775,10 @@ class __$$_MiraiThemeCopyWithImpl<$Res> ? _value.primaryIconTheme : primaryIconTheme // ignore: cast_nullable_to_non_nullable as MiraiIconThemeData?, + dialogTheme: freezed == dialogTheme + ? _value.dialogTheme + : dialogTheme // ignore: cast_nullable_to_non_nullable + as MiraiDialogTheme?, floatingActionButtonTheme: freezed == floatingActionButtonTheme ? _value.floatingActionButtonTheme : floatingActionButtonTheme // ignore: cast_nullable_to_non_nullable @@ -813,6 +841,7 @@ class _$_MiraiTheme implements _MiraiTheme { this.iconButtonTheme, this.iconTheme, this.primaryIconTheme, + this.dialogTheme, this.floatingActionButtonTheme, this.textButtonTheme, this.bottomAppBarTheme, @@ -884,6 +913,8 @@ class _$_MiraiTheme implements _MiraiTheme { @override final MiraiIconThemeData? primaryIconTheme; @override + final MiraiDialogTheme? dialogTheme; + @override final MiraiFloatingActionButtonThemeData? floatingActionButtonTheme; @override final MiraiButtonStyle? textButtonTheme; @@ -898,7 +929,7 @@ class _$_MiraiTheme implements _MiraiTheme { @override String toString() { - return 'MiraiTheme(applyElevationOverlayColor: $applyElevationOverlayColor, useMaterial3: $useMaterial3, brightness: $brightness, canvasColor: $canvasColor, cardColor: $cardColor, colorScheme: $colorScheme, colorSchemeSeed: $colorSchemeSeed, dialogBackgroundColor: $dialogBackgroundColor, disabledColor: $disabledColor, dividerColor: $dividerColor, focusColor: $focusColor, highlightColor: $highlightColor, hintColor: $hintColor, hoverColor: $hoverColor, indicatorColor: $indicatorColor, primaryColor: $primaryColor, primaryColorDark: $primaryColorDark, primaryColorLight: $primaryColorLight, primarySwatch: $primarySwatch, scaffoldBackgroundColor: $scaffoldBackgroundColor, secondaryHeaderColor: $secondaryHeaderColor, shadowColor: $shadowColor, splashColor: $splashColor, unselectedWidgetColor: $unselectedWidgetColor, appBarTheme: $appBarTheme, elevatedButtonTheme: $elevatedButtonTheme, outlinedButtonTheme: $outlinedButtonTheme, iconButtonTheme: $iconButtonTheme, iconTheme: $iconTheme, primaryIconTheme: $primaryIconTheme, floatingActionButtonTheme: $floatingActionButtonTheme, textButtonTheme: $textButtonTheme, bottomAppBarTheme: $bottomAppBarTheme, bottomNavigationBarTheme: $bottomNavigationBarTheme, bottomSheetTheme: $bottomSheetTheme, cardTheme: $cardTheme)'; + return 'MiraiTheme(applyElevationOverlayColor: $applyElevationOverlayColor, useMaterial3: $useMaterial3, brightness: $brightness, canvasColor: $canvasColor, cardColor: $cardColor, colorScheme: $colorScheme, colorSchemeSeed: $colorSchemeSeed, dialogBackgroundColor: $dialogBackgroundColor, disabledColor: $disabledColor, dividerColor: $dividerColor, focusColor: $focusColor, highlightColor: $highlightColor, hintColor: $hintColor, hoverColor: $hoverColor, indicatorColor: $indicatorColor, primaryColor: $primaryColor, primaryColorDark: $primaryColorDark, primaryColorLight: $primaryColorLight, primarySwatch: $primarySwatch, scaffoldBackgroundColor: $scaffoldBackgroundColor, secondaryHeaderColor: $secondaryHeaderColor, shadowColor: $shadowColor, splashColor: $splashColor, unselectedWidgetColor: $unselectedWidgetColor, appBarTheme: $appBarTheme, elevatedButtonTheme: $elevatedButtonTheme, outlinedButtonTheme: $outlinedButtonTheme, iconButtonTheme: $iconButtonTheme, iconTheme: $iconTheme, primaryIconTheme: $primaryIconTheme, dialogTheme: $dialogTheme, floatingActionButtonTheme: $floatingActionButtonTheme, textButtonTheme: $textButtonTheme, bottomAppBarTheme: $bottomAppBarTheme, bottomNavigationBarTheme: $bottomNavigationBarTheme, bottomSheetTheme: $bottomSheetTheme, cardTheme: $cardTheme)'; } @override @@ -967,8 +998,9 @@ class _$_MiraiTheme implements _MiraiTheme { other.iconTheme == iconTheme) && (identical(other.primaryIconTheme, primaryIconTheme) || other.primaryIconTheme == primaryIconTheme) && - (identical(other.floatingActionButtonTheme, floatingActionButtonTheme) || - other.floatingActionButtonTheme == floatingActionButtonTheme) && + (identical(other.dialogTheme, dialogTheme) || + other.dialogTheme == dialogTheme) && + (identical(other.floatingActionButtonTheme, floatingActionButtonTheme) || other.floatingActionButtonTheme == floatingActionButtonTheme) && (identical(other.textButtonTheme, textButtonTheme) || other.textButtonTheme == textButtonTheme) && (identical(other.bottomAppBarTheme, bottomAppBarTheme) || other.bottomAppBarTheme == bottomAppBarTheme) && (identical(other.bottomNavigationBarTheme, bottomNavigationBarTheme) || other.bottomNavigationBarTheme == bottomNavigationBarTheme) && @@ -1010,6 +1042,7 @@ class _$_MiraiTheme implements _MiraiTheme { iconButtonTheme, iconTheme, primaryIconTheme, + dialogTheme, floatingActionButtonTheme, textButtonTheme, bottomAppBarTheme, @@ -1064,6 +1097,7 @@ abstract class _MiraiTheme implements MiraiTheme { final MiraiButtonStyle? iconButtonTheme, final MiraiIconThemeData? iconTheme, final MiraiIconThemeData? primaryIconTheme, + final MiraiDialogTheme? dialogTheme, final MiraiFloatingActionButtonThemeData? floatingActionButtonTheme, final MiraiButtonStyle? textButtonTheme, final MiraiBottomAppBarTheme? bottomAppBarTheme, @@ -1135,6 +1169,8 @@ abstract class _MiraiTheme implements MiraiTheme { @override MiraiIconThemeData? get primaryIconTheme; @override + MiraiDialogTheme? get dialogTheme; + @override MiraiFloatingActionButtonThemeData? get floatingActionButtonTheme; @override MiraiButtonStyle? get textButtonTheme; diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart index cfc228af..cdacfb06 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart @@ -62,6 +62,10 @@ _$_MiraiTheme _$$_MiraiThemeFromJson(Map json) => ? null : MiraiIconThemeData.fromJson( json['primaryIconTheme'] as Map), + dialogTheme: json['dialogTheme'] == null + ? null + : MiraiDialogTheme.fromJson( + json['dialogTheme'] as Map), floatingActionButtonTheme: json['floatingActionButtonTheme'] == null ? null : MiraiFloatingActionButtonThemeData.fromJson( @@ -120,6 +124,7 @@ Map _$$_MiraiThemeToJson(_$_MiraiTheme instance) => 'iconButtonTheme': instance.iconButtonTheme, 'iconTheme': instance.iconTheme, 'primaryIconTheme': instance.primaryIconTheme, + 'dialogTheme': instance.dialogTheme, 'floatingActionButtonTheme': instance.floatingActionButtonTheme, 'textButtonTheme': instance.textButtonTheme, 'bottomAppBarTheme': instance.bottomAppBarTheme, diff --git a/packages/mirai/lib/src/parsers/parsers.dart b/packages/mirai/lib/src/parsers/parsers.dart index 960f2dbf..994fac18 100644 --- a/packages/mirai/lib/src/parsers/parsers.dart +++ b/packages/mirai/lib/src/parsers/parsers.dart @@ -20,6 +20,7 @@ export 'package:mirai/src/parsers/mirai_column/mirai_column.dart'; export 'package:mirai/src/parsers/mirai_container/mirai_container.dart'; export 'package:mirai/src/parsers/mirai_container_image/mirai_container_image.dart'; export 'package:mirai/src/parsers/mirai_default_tab_controller/mirai_default_tab_controller.dart'; +export 'package:mirai/src/parsers/mirai_dialog_theme/mirai_dialog_theme.dart'; export 'package:mirai/src/parsers/mirai_edge_insets/mirai_edge_insets.dart'; export 'package:mirai/src/parsers/mirai_elevated_button/mirai_elevated_button.dart'; export 'package:mirai/src/parsers/mirai_floating_action_button/mirai_floating_action_button.dart';