forked from baron/baron-sso
uf 액션 토스트 공통화 및 SnackBar 제거
This commit is contained in:
@@ -15,6 +15,7 @@ import '../../../../core/services/http_client.dart';
|
||||
import '../../../../core/i18n/locale_utils.dart';
|
||||
import '../../../../core/widgets/language_selector.dart';
|
||||
import '../../../../core/ui/layout_breakpoints.dart';
|
||||
import '../../../../core/ui/toast_service.dart';
|
||||
import '../../profile/domain/notifiers/profile_notifier.dart';
|
||||
import '../domain/dashboard_providers.dart';
|
||||
import '../domain/models.dart' hide LinkedRp;
|
||||
@@ -104,14 +105,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
try {
|
||||
await ref.read(linkedRpsProvider.notifier).revokeRp(clientId);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.dashboard.revoke.success',
|
||||
params: {'app': appName},
|
||||
),
|
||||
),
|
||||
ToastService.success(
|
||||
tr(
|
||||
'msg.userfront.dashboard.revoke.success',
|
||||
params: {'app': appName},
|
||||
),
|
||||
);
|
||||
setState(() {
|
||||
@@ -121,15 +118,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr(
|
||||
'msg.userfront.dashboard.revoke.error',
|
||||
params: {'error': '$e'},
|
||||
),
|
||||
),
|
||||
),
|
||||
ToastService.error(
|
||||
tr('msg.userfront.dashboard.revoke.error', params: {'error': '$e'}),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
@@ -547,12 +537,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
: () async {
|
||||
await Clipboard.setData(ClipboardData(text: approvedSessionId));
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr('msg.userfront.dashboard.session_id_copied'),
|
||||
),
|
||||
),
|
||||
ToastService.info(
|
||||
tr('msg.userfront.dashboard.session_id_copied'),
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -626,12 +612,8 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
: () async {
|
||||
await Clipboard.setData(ClipboardData(text: approvedSessionId));
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
tr('msg.userfront.dashboard.session_id_copied'),
|
||||
),
|
||||
),
|
||||
ToastService.info(
|
||||
tr('msg.userfront.dashboard.session_id_copied'),
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -1280,7 +1262,6 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
final messenger = ScaffoldMessenger.of(context);
|
||||
final itemUrl = item.url;
|
||||
if (itemUrl != null && itemUrl.isNotEmpty) {
|
||||
final uri = Uri.parse(itemUrl);
|
||||
@@ -1290,18 +1271,10 @@ class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
||||
await launchUrl(uri);
|
||||
return;
|
||||
}
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(tr('msg.userfront.dashboard.link_open_error')),
|
||||
),
|
||||
);
|
||||
ToastService.error(tr('msg.userfront.dashboard.link_open_error'));
|
||||
} else {
|
||||
if (!mounted) return;
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(tr('msg.userfront.dashboard.link_missing')),
|
||||
),
|
||||
);
|
||||
ToastService.info(tr('msg.userfront.dashboard.link_missing'));
|
||||
}
|
||||
},
|
||||
child: opaqueCard,
|
||||
|
||||
Reference in New Issue
Block a user