mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 15:02:33 +01:00
fix: Ignore list
This commit is contained in:
parent
5e6226714e
commit
0458064c44
@ -7,15 +7,17 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||||||
import '../components/matrix.dart';
|
import '../components/matrix.dart';
|
||||||
|
|
||||||
class SettingsIgnoreList extends StatelessWidget {
|
class SettingsIgnoreList extends StatelessWidget {
|
||||||
final controller = TextEditingController();
|
final TextEditingController _controller = TextEditingController();
|
||||||
|
|
||||||
void _ignoreUser(BuildContext context) {
|
void _ignoreUser(BuildContext context) {
|
||||||
if (controller.text.isEmpty) return;
|
if (_controller.text.isEmpty) return;
|
||||||
|
final userId = '@${_controller.text}';
|
||||||
|
|
||||||
showFutureLoadingDialog(
|
showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => Matrix.of(context).client.ignoreUser('@${controller.text}'),
|
future: () => Matrix.of(context).client.ignoreUser(userId),
|
||||||
);
|
);
|
||||||
controller.clear();
|
_controller.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -34,7 +36,7 @@ class SettingsIgnoreList extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
TextField(
|
||||||
controller: controller,
|
controller: _controller,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
textInputAction: TextInputAction.done,
|
textInputAction: TextInputAction.done,
|
||||||
onSubmitted: (_) => _ignoreUser(context),
|
onSubmitted: (_) => _ignoreUser(context),
|
||||||
|
Loading…
Reference in New Issue
Block a user