diff --git a/CHANGELOG.md b/CHANGELOG.md index 17494f1..6f7fbc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,29 @@ -# 0.0.13 +### 0.0.14 + +- WdsSliverHeader.logo에 외부 로고 탭 콜백 추가 + +### 0.0.13 + - WdsSlider > start, end clamp 함수 추가 ### 0.0.12 + - WdsOption > WdsOptionVaraint.normal 추가 -- WdsButton > widget.child > Text.rich 대응 로직 추가 +- WdsButton > widget.child > Text.rich 대응 로직 추가 ### 0.0.11 + - 메세지 UI (WdsToast, WdsSnackbar, WdsSectionMessage) 공통 컨트롤러 도입 - WdsHeader.search > widthFactor 수정 - WdsChip > leading 형변환 (WdsIcon > Widget) ### 0.0.10 + - WdsTextArea > 최소 높이 60px / 최대 높이 320px 대응될 수 있게끔 개선 -- WdsTextArea > 'label' 파라미터 String에서 Text로 형변환 +- WdsTextArea > 'label' 파라미터 String에서 Text로 형변환 ### 0.0.9 + - WdsToolTip > 'message'에서 'label'로 변경 - WdsToolTip > 'message' 파라미터 String에서 Text로 형변환 - WdsChip > outline 'backgroundColor' > WdsColors.white로 변경 diff --git a/packages/components/lib/src/header/wds_sliver_header.dart b/packages/components/lib/src/header/wds_sliver_header.dart index 2dd60f5..b66e3d0 100644 --- a/packages/components/lib/src/header/wds_sliver_header.dart +++ b/packages/components/lib/src/header/wds_sliver_header.dart @@ -16,6 +16,7 @@ class WdsSliverHeader extends StatelessWidget { required this.hasCenterTitle, required this.isLogo, required this.isSearch, + required this.onLogoTap, required this.pinned, required this.floating, required this.safeArea, @@ -25,6 +26,7 @@ class WdsSliverHeader extends StatelessWidget { /// Creates a logo header. WdsSliverHeader.logo({ List actions = const [], + VoidCallback? onLogoTap, bool pinned = true, bool floating = false, bool safeArea = true, @@ -36,6 +38,7 @@ class WdsSliverHeader extends StatelessWidget { hasCenterTitle: false, isLogo: true, isSearch: false, + onLogoTap: onLogoTap, pinned: pinned, floating: floating, safeArea: safeArea, @@ -58,6 +61,7 @@ class WdsSliverHeader extends StatelessWidget { hasCenterTitle: true, isLogo: false, isSearch: false, + onLogoTap: null, pinned: pinned, floating: floating, safeArea: safeArea, @@ -82,6 +86,7 @@ class WdsSliverHeader extends StatelessWidget { hasCenterTitle: true, isLogo: false, isSearch: true, + onLogoTap: null, pinned: pinned, floating: floating, safeArea: safeArea, @@ -95,6 +100,7 @@ class WdsSliverHeader extends StatelessWidget { final bool hasCenterTitle; final bool isLogo; final bool isSearch; + final VoidCallback? onLogoTap; /// Whether the header should remain visible at the start of the scroll view. final bool pinned; @@ -121,6 +127,7 @@ class WdsSliverHeader extends StatelessWidget { hasCenterTitle: hasCenterTitle, isLogo: isLogo, isSearch: isSearch, + onLogoTap: onLogoTap, statusBarHeight: statusBarHeight, ), ); @@ -135,6 +142,7 @@ class _WdsSliverHeaderDelegate extends SliverPersistentHeaderDelegate { required this.hasCenterTitle, required this.isLogo, required this.isSearch, + required this.onLogoTap, required this.statusBarHeight, }); @@ -144,6 +152,7 @@ class _WdsSliverHeaderDelegate extends SliverPersistentHeaderDelegate { final bool hasCenterTitle; final bool isLogo; final bool isSearch; + final VoidCallback? onLogoTap; final double statusBarHeight; @override @@ -200,6 +209,14 @@ class _WdsSliverHeaderDelegate extends SliverPersistentHeaderDelegate { .toList(), ); + final Widget logoTitleWidget = onLogoTap == null + ? titleWidget + : GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: onLogoTap, + child: titleWidget, + ); + final Widget headerContent = SizedBox( height: WdsHeader.fixedSize.height, child: Padding( @@ -225,7 +242,7 @@ class _WdsSliverHeaderDelegate extends SliverPersistentHeaderDelegate { ), (false, true) => Padding( padding: const EdgeInsets.only(left: 8), - child: titleWidget, + child: logoTitleWidget, ), (false, false) => titleWidget, }, @@ -256,6 +273,7 @@ class _WdsSliverHeaderDelegate extends SliverPersistentHeaderDelegate { hasCenterTitle != oldDelegate.hasCenterTitle || isLogo != oldDelegate.isLogo || isSearch != oldDelegate.isSearch || + onLogoTap != oldDelegate.onLogoTap || statusBarHeight != oldDelegate.statusBarHeight; } } diff --git a/packages/components/pubspec.yaml b/packages/components/pubspec.yaml index af05930..61a7087 100644 --- a/packages/components/pubspec.yaml +++ b/packages/components/pubspec.yaml @@ -1,5 +1,5 @@ name: wds_components -version: 0.1.3 +version: 0.0.14 publish_to: none description: WINC Design System components package environment: diff --git a/pubspec.yaml b/pubspec.yaml index 180b4df..a85d615 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: wds -version: 0.0.13 +version: 0.0.14 publish_to: none description: WINC Design System environment: