🐛 Fix and optimize something
This commit is contained in:
@ -74,8 +74,18 @@ class _ReactionListState extends State<ReactionList> {
|
||||
);
|
||||
if (res.statusCode == 201) {
|
||||
widget.onReact(symbol, 1);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Your reaction has been added onto this post."),
|
||||
),
|
||||
);
|
||||
} else if (res.statusCode == 204) {
|
||||
widget.onReact(symbol, -1);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text("Your reaction has been removed from this post."),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
var message = utf8.decode(res.bodyBytes);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@ -105,10 +115,7 @@ class _ReactionListState extends State<ReactionList> {
|
||||
),
|
||||
child: Text(
|
||||
'Reactions',
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.headlineSmall,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
FutureBuilder(
|
||||
@ -119,7 +126,7 @@ class _ReactionListState extends State<ReactionList> {
|
||||
icon: const Icon(Icons.add_reaction),
|
||||
label: const Text("REACT"),
|
||||
onPressed:
|
||||
isSubmitting ? null : () => viewReactMenu(context),
|
||||
isSubmitting ? null : () => viewReactMenu(context),
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
@ -141,17 +148,16 @@ class _ReactionListState extends State<ReactionList> {
|
||||
onTap: isSubmitting
|
||||
? null
|
||||
: () {
|
||||
doReact(
|
||||
element.key,
|
||||
ReactionList.emojis[element.key]!['attitude'],
|
||||
);
|
||||
},
|
||||
doReact(
|
||||
element.key,
|
||||
ReactionList.emojis[element.key]!['attitude'],
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
"${ReactionList.emojis[element.key]!['icon']} x${element
|
||||
.value.toString()}",
|
||||
"${ReactionList.emojis[element.key]!['icon']} x${element.value.toString()}",
|
||||
),
|
||||
subtitle: Text(
|
||||
":${element.key}:",
|
||||
|
Reference in New Issue
Block a user