From dff53ece6c006af9b02d30aeb23ec009dce7e485 Mon Sep 17 00:00:00 2001 From: MinhDV Date: Mon, 30 Oct 2023 14:31:25 +0700 Subject: [PATCH] feat(newSearch): move style to file --- .../chat_adaptive_scaffold/chat_adaptive_scaffold.dart | 7 ++++--- .../chat_adaptive_scaffold_style.dart | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart diff --git a/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold.dart b/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold.dart index 20786a401..bcc069b8c 100644 --- a/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold.dart +++ b/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:fluffychat/pages/chat/chat.dart'; import 'package:fluffychat/pages/chat/events/message/message_style.dart'; +import 'package:fluffychat/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart'; import 'package:fluffychat/pages/chat_search/chat_search.dart'; import 'package:fluffychat/utils/extension/value_notifier_extension.dart'; import 'package:fluffychat/utils/responsive/responsive_utils.dart'; @@ -89,10 +90,10 @@ class ChatAdaptiveScaffoldController extends State { key: AppAdaptiveScaffold.breakpointWebAndDesktopKey, builder: (_) => Padding( padding: showRightPanel - ? const EdgeInsetsDirectional.only(end: 16) + ? ChatAdaptiveScaffoldStyle.webPaddingRight : EdgeInsets.zero, child: ClipRRect( - borderRadius: BorderRadius.circular(16), + borderRadius: ChatAdaptiveScaffoldStyle.borderRadius, child: body!, ), ), @@ -115,7 +116,7 @@ class ChatAdaptiveScaffoldController extends State { ): SlotLayout.from( key: AppAdaptiveScaffold.breakpointWebAndDesktopKey, builder: (_) => ClipRRect( - borderRadius: BorderRadius.circular(16), + borderRadius: ChatAdaptiveScaffoldStyle.borderRadius, child: ChatSearch( roomId: widget.roomId, onBack: toggleRightPanel, diff --git a/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart b/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart new file mode 100644 index 000000000..0b9773f02 --- /dev/null +++ b/lib/pages/chat_adaptive_scaffold/chat_adaptive_scaffold_style.dart @@ -0,0 +1,6 @@ +import 'package:flutter/material.dart'; + +class ChatAdaptiveScaffoldStyle { + static const webPaddingRight = EdgeInsetsDirectional.only(end: 16); + static final borderRadius = BorderRadius.circular(16); +}