8000 refactor: tweak spacing in PlayPage by poppingmoon · Pull Request #670 · poppingmoon/aria · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: tweak spacing in PlayPage #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/view/dialog/icon_select_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class IconSelectDialog extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final showEmojiPicker = useState(false);

return AlertDialog(
title: Row(
children: [
Expand Down Expand Up @@ -52,19 +53,18 @@ class IconSelectDialog extends HookConsumerWidget {
}
},
)
: SingleChildScrollView(
child: Wrap(
children: tabIconData
.map(
(icon) => IconButton(
onPressed: () => context.pop(
MaterialIcon(codePoint: icon.codePoint),
),
icon: Icon(icon),
: GridView.extent(
maxCrossAxisExtent: 52.0,
children: tabIconData
.map(
(icon) => IconButton(
onPressed: () => context.pop(
MaterialIcon(codePoint: icon.codePoint),
),
)
.toList(),
),
icon: Icon(icon),
),
)
.toList(),
),
),
);
Expand Down
276 changes: 181 additions & 95 deletions lib/view/page/emoji_page.dart
< 1E79 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,31 @@ class EmojiPage extends ConsumerWidget {
onRefresh: () =>
ref.refresh(emojiResponseProvider(account, name).future),
child: switch (emoji) {
AsyncValue(valueOrNull: final emoji?) => SingleChildScrollView(
AsyncValue(valueOrNull: final emoji?) => ListView(
physics: const AlwaysScrollableScrollPhysics(),
child: Center(
child: Container(
margin: const EdgeInsets.all(8.0),
width: maxContentWidth,
child: Card.filled(
color: colors.panel,
child: Column(
children: [
Padding(
children: [
const SizedBox(height: 8.0),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
height: 8.0,
decoration: BoxDecoration(
color: colors.panel,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(8.0),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: InkWell(
onTap: () => showImageDialog(
Expand All @@ -61,106 +75,178 @@ class EmojiPage extends ConsumerWidget {
child: ImageWidget(url: emoji.url.toString()),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.name,
text: name,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.tags,
child: emoji.aliases.isNotEmpty
? Wrap(
spacing: 4.0,
runSpacing: 4.0,
children: emoji.aliases
.map(
(alias) => ActionChip(
label: Text(alias),
onPressed: () =>
copyToClipboard(context, alias),
shape: StadiumBorder(
side: BorderSide(
color: Theme.of(
context,
).colorScheme.outlineVariant,
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(label: t.misskey.name, text: name),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.tags,
child: emoji.aliases.isNotEmpty
? Wrap(
spacing: 4.0,
runSpacing: 4.0,
children: emoji.aliases
.map(
(alias) => ActionChip(
label: Text(alias),
onPressed: () =>
copyToClipboard(context, alias),
shape: StadiumBorder(
side: BorderSide(
color: colors.divider,
),
),
)
.toList(),
)
: Text(t.misskey.none),
),
),
)
.toList(),
)
: Text(t.misskey.none),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.category,
text: emoji.category,
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.category,
text: emoji.category,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.sensitive,
text: emoji.isSensitive
? t.misskey.yes
: t.misskey.no,
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.sensitive,
text: emoji.isSensitive ? t.misskey.yes : t.misskey.no,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.localOnly,
text: emoji.localOnly ? t.misskey.yes : t.misskey.no,
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.localOnly,
text: emoji.localOnly ? t.misskey.yes : t.misskey.no,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.license,
child: emoji.license != null
? InkWell(
onLongPress: () =>
copyToClipboard(context, emoji.license!),
child: Mfm(
account: account,
text: emoji.license,
),
)
: null,
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.license,
child: emoji.license != null
? InkWell(
onLongPress: () =>
copyToClipboard(context, emoji.license!),
child: Mfm(
account: account,
text: emoji.license,
),
)
: null,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.emojiUrl,
child: UrlWidget(
url: emoji.url.toString(),
onTap: () => launchUrl(ref, emoji.url!),
style: TextStyle(color: colors.link),
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: Material(
color: colors.panel,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: KeyValueWidget(
label: t.misskey.emojiUrl,
child: UrlWidget(
url: emoji.url.toString(),
onTap: () => launchUrl(ref, emoji.url!),
style: TextStyle(color: colors.link),
),
),
],
),
),
),
),
),
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
height: 8.0,
decoration: BoxDecoration(
color: colors.panel,
borderRadius: const BorderRadius.vertical(
bottom: Radius.circular(8.0),
),
),
),
),
const SizedBox(height: 8.0),
],
),
AsyncValue(:final error?, :final stackTrace) => SingleChildScrollView(
AsyncValue(:final error?, :final stackTrace) => ListView(
physics: const AlwaysScrollableScrollPhysics(),
child: Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: ErrorMessage(error: error, stackTrace: stackTrace),
children: [
Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0),
width: maxContentWidth,
child: ErrorMessage(error: error, stackTrace: stackTrace),
),
),
),
],
),
_ => const Center(child: CircularProgressIndicator()),
},
Expand Down
Loading
Loading
0