fixup! Update Scribe mobile custom prompt bar UI
Fix Scribe Bar hint color in mobile Fix Scribe Bar spacing allocation in mobile USe borderRadius instead of ClipRRect
This commit is contained in:
@@ -205,6 +205,9 @@ abstract final class AIScribeSizes {
|
||||
static const EdgeInsetsGeometry searchBarPadding =
|
||||
EdgeInsetsDirectional.symmetric(horizontal: 16);
|
||||
|
||||
static const EdgeInsetsGeometry searchBarMobilePadding =
|
||||
EdgeInsetsDirectional.all(16);
|
||||
|
||||
static const EdgeInsetsGeometry suggestionContentPadding =
|
||||
EdgeInsetsDirectional.all(16);
|
||||
|
||||
|
||||
+12
-15
@@ -153,16 +153,18 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomBarContent(BuildContext context) {
|
||||
Widget _buildBottomBar(BuildContext context) {
|
||||
if (!widget.showCustomPromptBar) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return AIScribeBar(
|
||||
onCustomPrompt: _onCustomPromptSubmit,
|
||||
imagePaths: widget.imagePaths,
|
||||
borderRadius: AIScribeSizes.bottomBarRadius,
|
||||
hintStyle: AIScribeTextStyles.searchBar,
|
||||
return Padding(
|
||||
padding: AIScribeSizes.searchBarMobilePadding,
|
||||
child: AIScribeBar(
|
||||
onCustomPrompt: _onCustomPromptSubmit,
|
||||
imagePaths: widget.imagePaths,
|
||||
borderRadius: AIScribeSizes.bottomBarRadius,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -185,8 +187,7 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
|
||||
final hasContent = widget.content?.isNotEmpty ?? false;
|
||||
|
||||
final bottomBarPadding = MediaQuery.of(context).viewInsets.bottom + 16.0;
|
||||
final bottomBarInset = bottomBarPadding + (widget.showCustomPromptBar ? AIScribeSizes.searchBarMaxHeight : 0.0);
|
||||
final bottomBarPadding = MediaQuery.of(context).viewInsets.bottom;
|
||||
|
||||
return PointerInterceptor(
|
||||
child: Container(
|
||||
@@ -198,7 +199,7 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: bottomBarInset),
|
||||
padding: EdgeInsets.only(bottom: bottomBarPadding),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -221,18 +222,14 @@ class _AiScribeMobileActionsBottomSheetState
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildBottomBar(context)
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: bottomBarPadding,
|
||||
left: 16.0,
|
||||
right: 16.0,
|
||||
child: _buildBottomBarContent(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,14 +10,12 @@ class AIScribeBar extends StatefulWidget {
|
||||
final OnCustomPromptCallback onCustomPrompt;
|
||||
final ImagePaths imagePaths;
|
||||
final double? borderRadius;
|
||||
final TextStyle? hintStyle;
|
||||
|
||||
const AIScribeBar({
|
||||
super.key,
|
||||
required this.onCustomPrompt,
|
||||
required this.imagePaths,
|
||||
this.borderRadius,
|
||||
this.hintStyle,
|
||||
this.borderRadius
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -75,59 +73,57 @@ class _AIScribeBarState extends State<AIScribeBar> {
|
||||
borderRadius: borderRadius,
|
||||
gradient: AIScribeColors.barGradient,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: borderRadius,
|
||||
child: Container(
|
||||
width: AIScribeSizes.searchBarWidth,
|
||||
padding: AIScribeSizes.searchBarPadding,
|
||||
decoration: const BoxDecoration(
|
||||
color: AIScribeColors.background,
|
||||
),
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: AIScribeSizes.searchBarMaxHeight,
|
||||
minHeight: AIScribeSizes.searchBarMinHeight,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: KeyboardListener(
|
||||
focusNode: _keyboardListenerFocusNode,
|
||||
onKeyEvent: _handleKeyboardEvent,
|
||||
child: TextField(
|
||||
controller: _controller,
|
||||
focusNode: _textFieldFocusNode,
|
||||
decoration: InputDecoration(
|
||||
hintText: ScribeLocalizations.of(context).customPromptAction,
|
||||
hintStyle: widget.hintStyle ?? AIScribeTextStyles.searchBarHint,
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
isDense: true,
|
||||
),
|
||||
style: AIScribeTextStyles.searchBar,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.multiline,
|
||||
cursorHeight: 16,
|
||||
child: Container(
|
||||
width: AIScribeSizes.searchBarWidth,
|
||||
padding: AIScribeSizes.searchBarPadding,
|
||||
decoration: BoxDecoration(
|
||||
color: AIScribeColors.background,
|
||||
borderRadius: borderRadius,
|
||||
),
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: AIScribeSizes.searchBarMaxHeight,
|
||||
minHeight: AIScribeSizes.searchBarMinHeight,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: KeyboardListener(
|
||||
focusNode: _keyboardListenerFocusNode,
|
||||
onKeyEvent: _handleKeyboardEvent,
|
||||
child: TextField(
|
||||
controller: _controller,
|
||||
focusNode: _textFieldFocusNode,
|
||||
decoration: InputDecoration(
|
||||
hintText: ScribeLocalizations.of(context).customPromptAction,
|
||||
hintStyle: AIScribeTextStyles.searchBarHint,
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
isDense: true,
|
||||
),
|
||||
style: AIScribeTextStyles.searchBar,
|
||||
maxLines: null,
|
||||
keyboardType: TextInputType.multiline,
|
||||
cursorHeight: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: AIScribeSizes.fieldSpacing),
|
||||
ValueListenableBuilder<bool>(
|
||||
valueListenable: _isButtonEnabled,
|
||||
builder: (_, isEnabled, __) {
|
||||
return TMailButtonWidget.fromIcon(
|
||||
icon: widget.imagePaths.icSend,
|
||||
iconSize: AIScribeSizes.sendIcon,
|
||||
padding: AIScribeSizes.sendIconPadding,
|
||||
iconColor: AIScribeColors.background,
|
||||
backgroundColor: isEnabled
|
||||
? AIScribeColors.sendPromptBackground
|
||||
: AIScribeColors.sendPromptBackgroundDisabled,
|
||||
onTapActionCallback: isEnabled ? _onSendPressed : null,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: AIScribeSizes.fieldSpacing),
|
||||
ValueListenableBuilder<bool>(
|
||||
valueListenable: _isButtonEnabled,
|
||||
builder: (_, isEnabled, __) {
|
||||
return TMailButtonWidget.fromIcon(
|
||||
icon: widget.imagePaths.icSend,
|
||||
iconSize: AIScribeSizes.sendIcon,
|
||||
padding: AIScribeSizes.sendIconPadding,
|
||||
iconColor: AIScribeColors.background,
|
||||
backgroundColor: isEnabled
|
||||
? AIScribeColors.sendPromptBackground
|
||||
: AIScribeColors.sendPromptBackgroundDisabled,
|
||||
onTapActionCallback: isEnabled ? _onSendPressed : null,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user