CR fixes
This commit is contained in:
parent
8703246c65
commit
725807c75b
|
@ -1,5 +1,3 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:lemmy_api_client/v3.dart';
|
||||
|
@ -163,16 +161,17 @@ class _CommentMoreMenuPopup extends HookWidget {
|
|||
? const CircularProgressIndicator.adaptive()
|
||||
: const Icon(Icons.flag),
|
||||
title: const Text('Report'),
|
||||
onTap: () {
|
||||
if (store.reportingState.isLoading) return;
|
||||
Navigator.of(context).pop();
|
||||
loggedInAction((token) async {
|
||||
final reason = await ReportDialog.show(context);
|
||||
if (reason != null) {
|
||||
unawaited(store.report(token, reason));
|
||||
}
|
||||
})();
|
||||
},
|
||||
onTap: store.reportingState.isLoading
|
||||
? null
|
||||
: () {
|
||||
Navigator.of(context).pop();
|
||||
loggedInAction((token) async {
|
||||
final reason = await ReportDialog.show(context);
|
||||
if (reason != null) {
|
||||
await store.report(token, reason);
|
||||
}
|
||||
})();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
@ -129,16 +127,17 @@ class PostMoreMenu extends HookWidget {
|
|||
? const CircularProgressIndicator.adaptive()
|
||||
: const Icon(Icons.flag),
|
||||
title: const Text('Report'),
|
||||
onTap: () {
|
||||
if (store.reportingState.isLoading) return;
|
||||
Navigator.of(context).pop();
|
||||
loggedInAction((token) async {
|
||||
final reason = await ReportDialog.show(context);
|
||||
if (reason != null) {
|
||||
unawaited(store.report(token, reason));
|
||||
}
|
||||
})();
|
||||
},
|
||||
onTap: store.reportingState.isLoading
|
||||
? null
|
||||
: () {
|
||||
Navigator.of(context).pop();
|
||||
loggedInAction((token) async {
|
||||
final reason = await ReportDialog.show(context);
|
||||
if (reason != null) {
|
||||
await store.report(token, reason);
|
||||
}
|
||||
})();
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.info_outline),
|
||||
|
|
|
@ -7,6 +7,7 @@ class ReportDialog extends HookWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = useListenable(useTextEditingController());
|
||||
|
||||
return AlertDialog(
|
||||
title: const Text('Report'),
|
||||
content: TextField(
|
||||
|
|
Loading…
Reference in New Issue