opt: reply error widget

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-11 18:38:19 +08:00
parent ba192a0356
commit 9b8b9bd1ab
6 changed files with 36 additions and 81 deletions

View File

@@ -1,4 +1,5 @@
import 'package:PiliPlus/common/widgets/http_error.dart';
import 'package:PiliPlus/utils/global_data.dart';
import 'package:flutter/material.dart';
Widget get loadingWidget => Center(child: CircularProgressIndicator());
@@ -17,3 +18,19 @@ Widget scrollErrorWidget({errMsg, callback}) => CustomScrollView(
)
],
);
Widget grpcReplyErrorWidget(context, onReload) => FilledButton.tonal(
onPressed: () {
GlobalData().grpcReply = false;
onReload();
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith((states) {
return Theme.of(context).colorScheme.primary.withAlpha(20);
}),
),
child: Text(
'暂时关闭gRPC加载评论',
style: TextStyle(color: Theme.of(context).colorScheme.primary),
),
);