Onstart sync progressbar: init

This commit is contained in:
HDDen
2026-05-23 21:06:52 +03:00
parent 6d258154a0
commit ed0e6b6554
10 changed files with 282 additions and 80 deletions
+9 -3
View File
@@ -23,6 +23,7 @@ import '../widgets/list_filter_widget.dart';
import '../widgets/empty_state.dart';
import '../widgets/qr_code_display.dart';
import '../widgets/quick_switch_bar.dart';
import '../widgets/sync_progress_overlay.dart';
import '../widgets/unread_badge.dart';
import '../helpers/snack_bar_builder.dart';
import 'channel_chat_screen.dart';
@@ -103,6 +104,7 @@ class _ChannelsScreenState extends State<ChannelsScreen>
title: AppBarTitle(context.l10n.channels_title),
centerTitle: true,
automaticallyImplyLeading: false,
bottom: const SyncProgressAppBarBottom(),
actions: [
PopupMenuButton(
itemBuilder: (context) => [
@@ -152,12 +154,16 @@ class _ChannelsScreenState extends State<ChannelsScreen>
await context.read<MeshCoreConnector>().getChannels(force: true);
},
child: () {
if (connector.isLoadingChannels) {
final channels = connector.channels;
final waitingForInitialChannels =
!connector.hasLoadedChannels && !connector.isLoadingChannels;
final waitingForFirstChannel =
connector.isLoadingChannels && channels.isEmpty;
if (waitingForInitialChannels || waitingForFirstChannel) {
return const Center(child: CircularProgressIndicator());
}
final channels = connector.channels;
if (channels.isEmpty) {
return ListView(
children: [