[1266] add debug page to check the mute flow
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugBanUser extends StatelessWidget {
|
||||
const DebugBanUser({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Ban User',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[banUser] userId: $userId');
|
||||
final result = await client.banUser(userId);
|
||||
debugPrint('[banUser] completed: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[banUser] failed: $e');
|
||||
showErrorDialog(context, e, 'Ban User');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugMuteUser extends StatelessWidget {
|
||||
const DebugMuteUser({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Mute User',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[muteUser] userId: $userId');
|
||||
final result = await client.muteUser(userId);
|
||||
debugPrint('[muteUser] completed: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[muteUser] failed: $e');
|
||||
showErrorDialog(context, e, 'Mute User');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugRemoveShadowBan extends StatelessWidget {
|
||||
const DebugRemoveShadowBan({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Remove Shadow Ban',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[removeShadowBan] userId: $userId');
|
||||
final result = await client.removeShadowBan(userId);
|
||||
debugPrint('[removeShadowBan] result: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[removeShadowBan] failed: $e');
|
||||
showErrorDialog(context, e, 'Remove Shadow Ban');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugShadowBan extends StatelessWidget {
|
||||
const DebugShadowBan({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Shadow Ban',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[shadowBan] userId: $userId');
|
||||
final result = await client.shadowBan(userId);
|
||||
debugPrint('[shadowBan] completed: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[shadowBan] failed: $e');
|
||||
showErrorDialog(context, e, 'Shadow Ban');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugUnbanUser extends StatelessWidget {
|
||||
const DebugUnbanUser({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Unban User',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[unbanUser] userId: $userId');
|
||||
final result = await client.unbanUser(userId);
|
||||
debugPrint('[unbanUser] completed: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[unbanUser] failed: $e');
|
||||
showErrorDialog(context, e, 'Unban User');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
|
||||
|
||||
import '../error_dialog.dart';
|
||||
|
||||
class DebugUnmuteUser extends StatelessWidget {
|
||||
const DebugUnmuteUser({
|
||||
super.key,
|
||||
required this.client,
|
||||
});
|
||||
|
||||
final StreamChatClient client;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: TextField(
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Unmute User',
|
||||
hintText: 'User Id',
|
||||
isDense: true,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
final userId = value.trim();
|
||||
try {
|
||||
debugPrint('[unmuteUser] userId: $userId');
|
||||
final result = await client.unmuteUser(userId);
|
||||
debugPrint('[unmuteUser] completed: $result');
|
||||
} catch (e) {
|
||||
debugPrint('[unmuteUser] failed: $e');
|
||||
showErrorDialog(context, e, 'Unmute User');
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user