🐛 Dozens of bug fixes
This commit is contained in:
@@ -297,6 +297,8 @@ class EditAppScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
|
showLoadingModal(context);
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
await client.post(
|
await client.post(
|
||||||
'/develop/developers/$publisherName/projects/$projectId/apps',
|
'/develop/developers/$publisherName/projects/$projectId/apps',
|
||||||
@@ -308,6 +310,12 @@ class EditAppScreen extends HookConsumerWidget {
|
|||||||
data: data,
|
data: data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
showErrorAlert(err);
|
||||||
|
return;
|
||||||
|
} finally {
|
||||||
|
if (context.mounted) hideLoadingModal(context);
|
||||||
|
}
|
||||||
ref.invalidate(customAppsProvider(publisherName, projectId));
|
ref.invalidate(customAppsProvider(publisherName, projectId));
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
@@ -116,33 +116,89 @@ class SliverArticlesList extends ConsumerWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ArticlesScreen extends ConsumerWidget {
|
@riverpod
|
||||||
final String? feedId;
|
Future<List<SnWebFeed>> subscribedFeeds(Ref ref) async {
|
||||||
final String? publisherId;
|
final client = ref.watch(apiClientProvider);
|
||||||
final String? title;
|
final response = await client.get('/sphere/feeds/subscribed');
|
||||||
|
final data = response.data as List<dynamic>;
|
||||||
|
return data.map((json) => SnWebFeed.fromJson(json)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
const ArticlesScreen({super.key, this.feedId, this.publisherId, this.title});
|
class ArticlesScreen extends ConsumerWidget {
|
||||||
|
const ArticlesScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
return AppScaffold(
|
final subscribedFeedsAsync = ref.watch(subscribedFeedsProvider);
|
||||||
appBar: AppBar(title: Text(title ?? 'Articles')),
|
|
||||||
body: Center(
|
return subscribedFeedsAsync.when(
|
||||||
|
data: (feeds) {
|
||||||
|
return DefaultTabController(
|
||||||
|
length: feeds.length + 1,
|
||||||
|
child: AppScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text('Articles'),
|
||||||
|
bottom: TabBar(
|
||||||
|
isScrollable: true,
|
||||||
|
tabs: [
|
||||||
|
const Tab(text: 'All'),
|
||||||
|
...feeds.map((feed) => Tab(text: feed.title)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: TabBarView(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 560),
|
constraints: const BoxConstraints(maxWidth: 560),
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: const EdgeInsets.only(top: 8, left: 8, right: 8),
|
padding: const EdgeInsets.only(
|
||||||
sliver: SliverArticlesList(
|
top: 8,
|
||||||
feedId: feedId,
|
left: 8,
|
||||||
publisherId: publisherId,
|
right: 8,
|
||||||
),
|
),
|
||||||
|
sliver: SliverArticlesList(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
...feeds.map((feed) {
|
||||||
|
return Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 560),
|
||||||
|
child: CustomScrollView(
|
||||||
|
slivers: [
|
||||||
|
SliverPadding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 8,
|
||||||
|
left: 8,
|
||||||
|
right: 8,
|
||||||
|
),
|
||||||
|
sliver: SliverArticlesList(feedId: feed.id),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
loading:
|
||||||
|
() => AppScaffold(
|
||||||
|
appBar: AppBar(title: const Text('Articles')),
|
||||||
|
body: const Center(child: CircularProgressIndicator()),
|
||||||
|
),
|
||||||
|
error:
|
||||||
|
(err, stack) => AppScaffold(
|
||||||
|
appBar: AppBar(title: const Text('Articles')),
|
||||||
|
body: Center(child: Text('Error: $err')),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,25 @@ part of 'articles.dart';
|
|||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
|
String _$subscribedFeedsHash() => r'cd2f5d7d4ea49ad00dc731f8fc2ed65450a3f0e4';
|
||||||
|
|
||||||
|
/// See also [subscribedFeeds].
|
||||||
|
@ProviderFor(subscribedFeeds)
|
||||||
|
final subscribedFeedsProvider =
|
||||||
|
AutoDisposeFutureProvider<List<SnWebFeed>>.internal(
|
||||||
|
subscribedFeeds,
|
||||||
|
name: r'subscribedFeedsProvider',
|
||||||
|
debugGetCreateSourceHash:
|
||||||
|
const bool.fromEnvironment('dart.vm.product')
|
||||||
|
? null
|
||||||
|
: _$subscribedFeedsHash,
|
||||||
|
dependencies: null,
|
||||||
|
allTransitiveDependencies: null,
|
||||||
|
);
|
||||||
|
|
||||||
|
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||||
|
// ignore: unused_element
|
||||||
|
typedef SubscribedFeedsRef = AutoDisposeFutureProviderRef<List<SnWebFeed>>;
|
||||||
String _$articlesListNotifierHash() =>
|
String _$articlesListNotifierHash() =>
|
||||||
r'579741af4d90c7c81f2e2697e57c4895b7a9dabc';
|
r'579741af4d90c7c81f2e2697e57c4895b7a9dabc';
|
||||||
|
|
||||||
|
@@ -291,7 +291,7 @@ class _MarketplaceWebFeedSubscriptionProviderElement
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _$marketplaceWebFeedContentNotifierHash() =>
|
String _$marketplaceWebFeedContentNotifierHash() =>
|
||||||
r'eff0eee14a244a2597756a61ad5957ae397c9bf5';
|
r'25688082884cb824eeff300888ba38c9748295dc';
|
||||||
|
|
||||||
abstract class _$MarketplaceWebFeedContentNotifier
|
abstract class _$MarketplaceWebFeedContentNotifier
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnWebArticle>> {
|
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnWebArticle>> {
|
||||||
|
@@ -399,7 +399,7 @@ class _RealmChatRoomsProviderElement
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _$realmMemberListNotifierHash() =>
|
String _$realmMemberListNotifierHash() =>
|
||||||
r'2f88f803b2e61e7287ed8a43025173e56ff6ca3b';
|
r'db1fd8a6741dfb3d5bb921d5d965f0cfdc0e7bcc';
|
||||||
|
|
||||||
abstract class _$RealmMemberListNotifier
|
abstract class _$RealmMemberListNotifier
|
||||||
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnRealmMember>> {
|
extends BuildlessAutoDisposeAsyncNotifier<CursorPagingData<SnRealmMember>> {
|
||||||
|
1169
swagger.json
1169
swagger.json
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user