m3e loading indicator

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-17 22:02:26 +08:00
parent d1497115da
commit 9b1ae39922
21 changed files with 275 additions and 19 deletions

View File

@@ -188,7 +188,7 @@ class _SelectTopicPanelState
LoadingState<List<TopicItem>?> loadingState,
) {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success<List<TopicItem>?>(:final response) =>
response != null && response.isNotEmpty
? ListView.builder(

View File

@@ -50,7 +50,7 @@ class _EmotePanelState extends State<EmotePanel>
Get.currentRoute.startsWith('/whisperDetail') ? 8 : 2,
);
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? Column(

View File

@@ -3,7 +3,7 @@ import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
import 'package:PiliPlus/common/widgets/flutter/refresh_indicator.dart';
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart'
show circularLoading;
show m3eLoading;
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/models_new/fav/fav_topic/topic_item.dart';
import 'package:PiliPlus/pages/fav/topic/controller.dart';
@@ -68,7 +68,7 @@ class _FavTopicPageState extends State<FavTopicPage>
Loading() => const SliverToBoxAdapter(
child: SizedBox(
height: 125,
child: circularLoading,
child: m3eLoading,
),
),
Success(:final response) =>

View File

@@ -107,7 +107,7 @@ class _CreateFavPageState extends State<CreateFavPage> {
? _buildBody(theme)
: _errMsg?.isNotEmpty == true
? scrollErrorWidget(errMsg: _errMsg, onReload: _getFolderInfo)
: circularLoading
: m3eLoading
: _buildBody(theme),
);
}

View File

@@ -41,7 +41,7 @@ class _FavPanelState extends State<FavPanel> {
Widget get _buildBody {
late final list = widget.ctr.favFolderData.value.list!;
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success() => ListView.builder(
controller: widget.scrollController,
itemCount: list.length,

View File

@@ -109,7 +109,7 @@ class _FollowPageState extends State<FollowPage> {
Widget _buildBody(LoadingState loadingState) {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success() => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View File

@@ -68,7 +68,7 @@ class _GroupPanelState extends State<GroupPanel> {
Widget get _buildBody {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) => ListView.builder(
controller: widget.scrollController,
itemCount: response.length,

View File

@@ -57,7 +57,7 @@ class _LiveEmotePanelState extends State<LiveEmotePanel>
2,
);
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? Column(

View File

@@ -102,7 +102,7 @@ class _LoginPageState extends State<LoginPage> {
Loading() => const SizedBox(
height: 200,
width: 200,
child: circularLoading,
child: m3eLoading,
),
Success(:final response) => Container(
width: 200,

View File

@@ -68,7 +68,7 @@ class _MemberPageState extends State<MemberPage> {
color: theme.surface,
child: Obx(
() => switch (_userController.loadingState.value) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) => ExtendedNestedScrollView(
key: _userController.key,
onlyOneScrollInBody: true,

View File

@@ -73,7 +73,7 @@ class _MemberHomeState extends State<MemberHome>
final isOwner = setting != null;
final color = Theme.of(context).colorScheme.outline;
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(response: final res) =>
res != null
? CustomScrollView(

View File

@@ -127,7 +127,7 @@ class _EditProfilePageState extends State<EditProfilePage> {
);
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) => ListView(
padding: EdgeInsets.only(
bottom: MediaQuery.viewPaddingOf(context).bottom + 25,

View File

@@ -83,7 +83,7 @@ class _PgcPageState extends State<PgcPage> with AutomaticKeepAliveClientMixin {
ThemeData theme,
LoadingState<List<TimelineResult>?> loadingState,
) => switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? Builder(
@@ -397,7 +397,7 @@ class _PgcPageState extends State<PgcPage> with AutomaticKeepAliveClientMixin {
Widget _buildFollowBody(LoadingState<List<FavPgcItemModel>?> loadingState) {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? ListView.builder(

View File

@@ -58,7 +58,7 @@ class _PgcIndexPageState extends State<PgcIndexPage>
) {
final padding = MediaQuery.viewPaddingOf(context);
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) => Builder(
builder: (context) {
int count =

View File

@@ -81,7 +81,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
Widget _buildUserPage(ThemeData theme, LoadingState userState) {
return switch (userState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) => Column(
children: [
_buildUserInfo(theme, response),

View File

@@ -37,7 +37,7 @@ class _WhisperBlockPageState extends State<WhisperBlockPage> {
LoadingState<List<KeywordBlockingItem>?> loadingState,
) {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? Column(

View File

@@ -151,7 +151,7 @@ class _WhisperDetailPageState
Widget _buildBody(LoadingState<List<Msg>?> loadingState) {
return switch (loadingState) {
Loading() => circularLoading,
Loading() => m3eLoading,
Success(:final response) =>
response != null && response.isNotEmpty
? ChatListView.separated(