From 8eca4506a769f58e2cb0261a7538d44bfa122cb8 Mon Sep 17 00:00:00 2001 From: LazySoul Date: Tue, 11 Feb 2025 15:13:20 +0900 Subject: [PATCH 1/3] =?UTF-8?q?wippyHeader=20icon=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/main.dart | 6 ++ example/pubspec.lock | 2 +- example/pubspec.yaml | 2 +- example/pubspec_overrides.yaml | 2 +- lib/src/header/wippy_header.dart | 8 +++ lib/src/header/wippy_header_title.dart | 3 + .../header/wippy_header_title.freezed.dart | 58 ++++++++++++++++--- pubspec.yaml | 2 +- 8 files changed, 72 insertions(+), 11 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 51a12e5..46580cb 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -256,6 +256,12 @@ class DesignSystemSamplePage extends StatelessWidget { title: WippyHeaderTitle(text: "Page Title"), actions: WippyHeaderActions.singleIconAction(iconAsset: IconPath.iconMessage16), ), + ), + const WippyHeader( + uiState: WippyHeaderUiState( + title: WippyHeaderTitle(text: "Page Title", iconAsset: IconPath.iconMessage16, iconColor: wippyBlue500), + actions: WippyHeaderActions.singleIconAction(iconAsset: IconPath.iconMessage16), + ), ) ]; } diff --git a/example/pubspec.lock b/example/pubspec.lock index fc5c658..2be92a8 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -598,7 +598,7 @@ packages: path: ".." relative: true source: path - version: "0.0.23" + version: "0.0.24" rxdart: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 6778200..1195e39 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: sdk: flutter flutter_bloc: ^8.1.6 cupertino_icons: ^1.0.8 - quantum_dots: ^0.0.23 + quantum_dots: ^0.0.24 dev_dependencies: flutter_test: diff --git a/example/pubspec_overrides.yaml b/example/pubspec_overrides.yaml index 8451f6d..3414a23 100644 --- a/example/pubspec_overrides.yaml +++ b/example/pubspec_overrides.yaml @@ -2,4 +2,4 @@ dependency_overrides: quantum_dots: path: ../ - version: 0.0.23 + version: 0.0.24 diff --git a/lib/src/header/wippy_header.dart b/lib/src/header/wippy_header.dart index 6d59594..67c65ed 100644 --- a/lib/src/header/wippy_header.dart +++ b/lib/src/header/wippy_header.dart @@ -93,6 +93,14 @@ class WippyHeader extends StatelessWidget implements PreferredSizeWidget { maxLines: 1, overflow: TextOverflow.ellipsis, ), + if (title.iconAsset != null) ...[ + const SizedBox(width: 2), + SizedIcon( + size: 16, + asset: title.iconAsset!, + colorFilter: ColorFilter.mode(title.iconColor ?? wippyGray900, BlendMode.srcIn), + ), + ] ], )), IgnorePointer( diff --git a/lib/src/header/wippy_header_title.dart b/lib/src/header/wippy_header_title.dart index 105cc4b..c14243c 100644 --- a/lib/src/header/wippy_header_title.dart +++ b/lib/src/header/wippy_header_title.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'wippy_header_title.freezed.dart'; @@ -10,5 +11,7 @@ class WippyHeaderTitle with _$WippyHeaderTitle { @Default(null) String? profileImageUrl, @Default(null) String? errorPlaceHolder, @Default(null) String? placeHolder, + @Default(null) String? iconAsset, + @Default(null) Color? iconColor, }) = _WippyHeaderTitle; } diff --git a/lib/src/header/wippy_header_title.freezed.dart b/lib/src/header/wippy_header_title.freezed.dart index f3a1d10..3d5eb57 100644 --- a/lib/src/header/wippy_header_title.freezed.dart +++ b/lib/src/header/wippy_header_title.freezed.dart @@ -22,6 +22,8 @@ mixin _$WippyHeaderTitle { String? get profileImageUrl => throw _privateConstructorUsedError; String? get errorPlaceHolder => throw _privateConstructorUsedError; String? get placeHolder => throw _privateConstructorUsedError; + String? get iconAsset => throw _privateConstructorUsedError; + Color? get iconColor => throw _privateConstructorUsedError; /// Create a copy of WippyHeaderTitle /// with the given fields replaced by the non-null parameter values. @@ -41,7 +43,9 @@ abstract class $WippyHeaderTitleCopyWith<$Res> { void Function()? onPressedProfileImage, String? profileImageUrl, String? errorPlaceHolder, - String? placeHolder}); + String? placeHolder, + String? iconAsset, + Color? iconColor}); } /// @nodoc @@ -64,6 +68,8 @@ class _$WippyHeaderTitleCopyWithImpl<$Res, $Val extends WippyHeaderTitle> Object? profileImageUrl = freezed, Object? errorPlaceHolder = freezed, Object? placeHolder = freezed, + Object? iconAsset = freezed, + Object? iconColor = freezed, }) { return _then(_value.copyWith( text: null == text @@ -86,6 +92,14 @@ class _$WippyHeaderTitleCopyWithImpl<$Res, $Val extends WippyHeaderTitle> ? _value.placeHolder : placeHolder // ignore: cast_nullable_to_non_nullable as String?, + iconAsset: freezed == iconAsset + ? _value.iconAsset + : iconAsset // ignore: cast_nullable_to_non_nullable + as String?, + iconColor: freezed == iconColor + ? _value.iconColor + : iconColor // ignore: cast_nullable_to_non_nullable + as Color?, ) as $Val); } } @@ -103,7 +117,9 @@ abstract class _$$WippyHeaderTitleImplCopyWith<$Res> void Function()? onPressedProfileImage, String? profileImageUrl, String? errorPlaceHolder, - String? placeHolder}); + String? placeHolder, + String? iconAsset, + Color? iconColor}); } /// @nodoc @@ -124,6 +140,8 @@ class __$$WippyHeaderTitleImplCopyWithImpl<$Res> Object? profileImageUrl = freezed, Object? errorPlaceHolder = freezed, Object? placeHolder = freezed, + Object? iconAsset = freezed, + Object? iconColor = freezed, }) { return _then(_$WippyHeaderTitleImpl( text: null == text @@ -146,6 +164,14 @@ class __$$WippyHeaderTitleImplCopyWithImpl<$Res> ? _value.placeHolder : placeHolder // ignore: cast_nullable_to_non_nullable as String?, + iconAsset: freezed == iconAsset + ? _value.iconAsset + : iconAsset // ignore: cast_nullable_to_non_nullable + as String?, + iconColor: freezed == iconColor + ? _value.iconColor + : iconColor // ignore: cast_nullable_to_non_nullable + as Color?, )); } } @@ -158,7 +184,9 @@ class _$WippyHeaderTitleImpl implements _WippyHeaderTitle { this.onPressedProfileImage = null, this.profileImageUrl = null, this.errorPlaceHolder = null, - this.placeHolder = null}); + this.placeHolder = null, + this.iconAsset = null, + this.iconColor = null}); @override final String text; @@ -174,10 +202,16 @@ class _$WippyHeaderTitleImpl implements _WippyHeaderTitle { @override @JsonKey() final String? placeHolder; + @override + @JsonKey() + final String? iconAsset; + @override + @JsonKey() + final Color? iconColor; @override String toString() { - return 'WippyHeaderTitle(text: $text, onPressedProfileImage: $onPressedProfileImage, profileImageUrl: $profileImageUrl, errorPlaceHolder: $errorPlaceHolder, placeHolder: $placeHolder)'; + return 'WippyHeaderTitle(text: $text, onPressedProfileImage: $onPressedProfileImage, profileImageUrl: $profileImageUrl, errorPlaceHolder: $errorPlaceHolder, placeHolder: $placeHolder, iconAsset: $iconAsset, iconColor: $iconColor)'; } @override @@ -193,12 +227,16 @@ class _$WippyHeaderTitleImpl implements _WippyHeaderTitle { (identical(other.errorPlaceHolder, errorPlaceHolder) || other.errorPlaceHolder == errorPlaceHolder) && (identical(other.placeHolder, placeHolder) || - other.placeHolder == placeHolder)); + other.placeHolder == placeHolder) && + (identical(other.iconAsset, iconAsset) || + other.iconAsset == iconAsset) && + (identical(other.iconColor, iconColor) || + other.iconColor == iconColor)); } @override int get hashCode => Object.hash(runtimeType, text, onPressedProfileImage, - profileImageUrl, errorPlaceHolder, placeHolder); + profileImageUrl, errorPlaceHolder, placeHolder, iconAsset, iconColor); /// Create a copy of WippyHeaderTitle /// with the given fields replaced by the non-null parameter values. @@ -216,7 +254,9 @@ abstract class _WippyHeaderTitle implements WippyHeaderTitle { final void Function()? onPressedProfileImage, final String? profileImageUrl, final String? errorPlaceHolder, - final String? placeHolder}) = _$WippyHeaderTitleImpl; + final String? placeHolder, + final String? iconAsset, + final Color? iconColor}) = _$WippyHeaderTitleImpl; @override String get text; @@ -228,6 +268,10 @@ abstract class _WippyHeaderTitle implements WippyHeaderTitle { String? get errorPlaceHolder; @override String? get placeHolder; + @override + String? get iconAsset; + @override + Color? get iconColor; /// Create a copy of WippyHeaderTitle /// with the given fields replaced by the non-null parameter values. diff --git a/pubspec.yaml b/pubspec.yaml index 0498271..f7e8ce2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: quantum_dots description: the design system for wippy global product -version: 0.0.23 +version: 0.0.24 homepage: https://github.com/nrise/Quantum-Dots topics: - animations From 3e449cc9e0fc0bdb530a2b8ad9e3a16f978e5d95 Mon Sep 17 00:00:00 2001 From: LazySoul Date: Tue, 11 Feb 2025 15:19:42 +0900 Subject: [PATCH 2/3] version up --- example/pubspec.lock | 2 +- example/pubspec.yaml | 2 +- example/pubspec_overrides.yaml | 2 +- pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 1e3d57d..38b831f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -598,7 +598,7 @@ packages: path: ".." relative: true source: path - version: "0.0.25" + version: "0.0.26" rxdart: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 8e11e1b..2196fbb 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: sdk: flutter flutter_bloc: ^8.1.6 cupertino_icons: ^1.0.8 - quantum_dots: ^0.0.25 + quantum_dots: ^0.0.26 dev_dependencies: flutter_test: diff --git a/example/pubspec_overrides.yaml b/example/pubspec_overrides.yaml index bb65d43..ccfe4e7 100644 --- a/example/pubspec_overrides.yaml +++ b/example/pubspec_overrides.yaml @@ -2,4 +2,4 @@ dependency_overrides: quantum_dots: path: ../ - version: 0.0.25 + version: 0.0.26 diff --git a/pubspec.yaml b/pubspec.yaml index 5d77d49..4a5917b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: quantum_dots description: the design system for wippy global product -version: 0.0.25 +version: 0.0.26 homepage: https://github.com/nrise/Quantum-Dots topics: - animations From e5938b1089082b575a0cfe49791c54a7d5bd596d Mon Sep 17 00:00:00 2001 From: LazySoul Date: Tue, 11 Feb 2025 15:21:36 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=98=A4=ED=83=80=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/pubspec.lock | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 38b831f..94baf1c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -832,8 +832,7 @@ packages: dependency: transitive description: name: web_socket - sha256: "3c12d96c0c - 9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted version: "0.1.6"