Compare commits
5 Commits
8a6bb34808
...
cda23db609
Author | SHA1 | Date | |
---|---|---|---|
cda23db609
|
|||
61074bc5a3
|
|||
5feafa9255
|
|||
e604577c1f
|
|||
af0ddd1273
|
@@ -126,6 +126,7 @@ class TabsScreen extends HookConsumerWidget {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: ClipRRect(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
|
@@ -314,28 +314,22 @@ class AppScaffold extends HookConsumerWidget {
|
||||
|
||||
final noBackground = isNoBackground ?? isWideScreen(context);
|
||||
|
||||
final content = Column(
|
||||
children: [
|
||||
IgnorePointer(
|
||||
child: SizedBox(height: appBar != null ? appBarHeight + safeTop : 0),
|
||||
),
|
||||
if (body != null) Expanded(child: body!),
|
||||
],
|
||||
);
|
||||
|
||||
return Focus(
|
||||
final builtWidget = Focus(
|
||||
focusNode: focusNode,
|
||||
child: Scaffold(
|
||||
extendBody: extendBody ?? true,
|
||||
extendBodyBehindAppBar: true,
|
||||
backgroundColor:
|
||||
noBackground
|
||||
? Colors.transparent
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
body:
|
||||
noBackground
|
||||
? content
|
||||
: AppBackground(isRoot: true, child: content),
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
IgnorePointer(
|
||||
child: SizedBox(
|
||||
height: appBar != null ? appBarHeight + safeTop : 0,
|
||||
),
|
||||
),
|
||||
if (body != null) Expanded(child: body!),
|
||||
],
|
||||
),
|
||||
appBar: appBar,
|
||||
bottomNavigationBar: bottomNavigationBar,
|
||||
bottomSheet: bottomSheet,
|
||||
@@ -348,6 +342,10 @@ class AppScaffold extends HookConsumerWidget {
|
||||
onEndDrawerChanged: onEndDrawerChanged,
|
||||
),
|
||||
);
|
||||
|
||||
return noBackground
|
||||
? builtWidget
|
||||
: AppBackground(isRoot: true, child: builtWidget);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -550,11 +550,13 @@ class ChatInput extends HookConsumerWidget {
|
||||
final triggerIndex =
|
||||
atIndex > colonIndex ? atIndex : colonIndex;
|
||||
if (triggerIndex == -1) return [];
|
||||
final chopped = pattern.substring(triggerIndex);
|
||||
if (chopped.contains(' ')) return [];
|
||||
final service = ref.read(autocompleteServiceProvider);
|
||||
try {
|
||||
return await service.getSuggestions(
|
||||
chatRoom.id,
|
||||
pattern,
|
||||
chopped,
|
||||
);
|
||||
} catch (e) {
|
||||
return [];
|
||||
@@ -645,7 +647,7 @@ class ChatInput extends HookConsumerWidget {
|
||||
direction: VerticalDirection.up,
|
||||
hideOnEmpty: true,
|
||||
hideOnLoading: true,
|
||||
debounceDuration: const Duration(milliseconds: 500),
|
||||
debounceDuration: const Duration(milliseconds: 1000),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
|
@@ -23,12 +23,12 @@ class PostComposeDialog extends HookConsumerWidget {
|
||||
this.isBottomSheet = false,
|
||||
});
|
||||
|
||||
static Future<SnPost?> show(
|
||||
static Future<bool?> show(
|
||||
BuildContext context, {
|
||||
SnPost? originalPost,
|
||||
PostComposeInitialState? initialState,
|
||||
}) {
|
||||
return showDialog<SnPost>(
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
useRootNavigator: true,
|
||||
builder:
|
||||
|
@@ -149,9 +149,11 @@ class ComposeFormFields extends HookConsumerWidget {
|
||||
final triggerIndex =
|
||||
atIndex > colonIndex ? atIndex : colonIndex;
|
||||
if (triggerIndex == -1) return [];
|
||||
final chopped = pattern.substring(triggerIndex);
|
||||
if (chopped.contains(' ')) return [];
|
||||
final service = ref.read(autocompleteServiceProvider);
|
||||
try {
|
||||
return await service.getGeneralSuggestions(pattern);
|
||||
return await service.getGeneralSuggestions(chopped);
|
||||
} catch (e) {
|
||||
return [];
|
||||
}
|
||||
@@ -235,7 +237,7 @@ class ComposeFormFields extends HookConsumerWidget {
|
||||
direction: VerticalDirection.down,
|
||||
hideOnEmpty: true,
|
||||
hideOnLoading: true,
|
||||
debounceDuration: const Duration(milliseconds: 500),
|
||||
debounceDuration: const Duration(milliseconds: 1000),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@@ -68,21 +68,24 @@ class PostQuickReply extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
const kInputChipHeight = 54.0;
|
||||
|
||||
return publishers.when(
|
||||
data:
|
||||
(data) => Material(
|
||||
elevation: 2,
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 8),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
child: Container(
|
||||
constraints: BoxConstraints(minHeight: kInputChipHeight),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 6),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: ProfilePictureWidget(
|
||||
fileId: currentPublisher.value?.picture?.id,
|
||||
radius: 16,
|
||||
radius: (kInputChipHeight * 0.5) - 6,
|
||||
),
|
||||
onTap: () {
|
||||
showModalBottomSheet(
|
||||
@@ -106,11 +109,13 @@ class PostQuickReply extends HookConsumerWidget {
|
||||
isCollapsed: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 9,
|
||||
vertical: 14,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
style: TextStyle(fontSize: 14),
|
||||
maxLines: null,
|
||||
minLines: 1,
|
||||
maxLines: 5,
|
||||
onTapOutside:
|
||||
(_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
@@ -130,6 +135,10 @@ class PostQuickReply extends HookConsumerWidget {
|
||||
},
|
||||
icon: const Icon(Symbols.launch, size: 20),
|
||||
visualDensity: VisualDensity.compact,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: kInputChipHeight - 6,
|
||||
minHeight: kInputChipHeight - 6,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon:
|
||||
@@ -143,6 +152,10 @@ class PostQuickReply extends HookConsumerWidget {
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
onPressed: submitting.value ? null : performAction,
|
||||
visualDensity: VisualDensity.compact,
|
||||
constraints: BoxConstraints(
|
||||
maxHeight: kInputChipHeight - 6,
|
||||
minHeight: kInputChipHeight - 6,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user