feat(flutter): 增加 debug 服务地址编辑器
This commit is contained in:
1 parent
eab5d3e230
commit
c259b0b543
9 files changed
+298
-5
No files matched your search
@@ -18,6 +18,7 @@ import '../../core/theme/app_theme.dart';
|
||||
import '../../core/widgets/app_bottom_nav.dart';
|
||||
import '../../core/widgets/app_pull_to_refresh.dart';
|
||||
import '../../core/widgets/catalog_debug_info.dart';
|
||||
import '../../core/widgets/catalog_endpoint_editor.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../filter/filter_page.dart';
|
||||
@@ -258,7 +259,11 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
actionLabel: l10n.retry,
|
||||
onAction: () => unawaited(_retryCategories(categories)),
|
||||
footer: kDebugMode
|
||||
? CatalogDebugInfo(error: categories.debugError ?? error)
|
||||
? CatalogDebugInfo(
|
||||
error: categories.debugError ?? error,
|
||||
onEditEndpoint: () =>
|
||||
unawaited(_editCategoriesEndpoint(categories)),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
@@ -518,6 +523,10 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
return retryCatalogLoad(reload: categories.load);
|
||||
}
|
||||
|
||||
Future<void> _editCategoriesEndpoint(CategoryController categories) {
|
||||
return showCatalogEndpointEditor(context, reload: categories.load);
|
||||
}
|
||||
|
||||
void _act(DiscoverPageAction action) {
|
||||
logic.act(
|
||||
context,
|
||||
|
||||
Reference in new issue
Block a user