diff --git a/lib/widget/share_album_dialog.dart b/lib/widget/share_album_dialog.dart index 5bc4acfa..73483a13 100644 --- a/lib/widget/share_album_dialog.dart +++ b/lib/widget/share_album_dialog.dart @@ -39,13 +39,18 @@ class _ShareAlbumDialogState extends State { @override build(BuildContext context) { - return BlocBuilder( + return BlocListener( bloc: _shareeBloc, - builder: (_, shareeState) => - BlocBuilder( - bloc: _shareBloc, - builder: (context, shareState) => - _buildContent(context, shareeState, shareState), + listener: (context, shareeState) => + _onListShareeBlocStateChanged(context, shareeState), + child: BlocBuilder( + bloc: _shareeBloc, + builder: (_, shareeState) => + BlocBuilder( + bloc: _shareBloc, + builder: (context, shareState) => + _buildContent(context, shareeState, shareState), + ), ), ); } @@ -122,6 +127,16 @@ class _ShareAlbumDialogState extends State { ); } + void _onListShareeBlocStateChanged( + BuildContext context, ListShareeBlocState state) { + if (state is ListShareeBlocFailure) { + SnackBarManager().showSnackBar(SnackBar( + content: Text(exception_util.toUserString(state.exception, context)), + duration: k.snackBarDurationNormal, + )); + } + } + void _onShareePressed( BuildContext context, Sharee sharee, Share? share) async { final shareRepo = ShareRepo(ShareRemoteDataSource());