WIP: feat(ui): Migrate to new UI implementation

This commit is contained in:
2026-06-22 06:47:16 +04:00
parent 873aa8d7b5
commit bb4334f68d
109 changed files with 13499 additions and 1257 deletions
@@ -136,6 +136,7 @@ class HomeScreenBloc extends Bloc<HomeScreenEvent, HomeScreenState> {
errorMessage: null,
processedFiles: 0,
totalFiles: 0,
syncStage: null,
),
),
);
@@ -306,6 +307,7 @@ class HomeScreenBloc extends Bloc<HomeScreenEvent, HomeScreenState> {
remoteBuildHash: event.status.remoteBuildHash,
processedFiles: event.status.processedFiles,
totalFiles: event.status.totalFiles,
syncStage: event.status.stage,
),
),
);
@@ -330,6 +332,7 @@ class HomeScreenBloc extends Bloc<HomeScreenEvent, HomeScreenState> {
statusText: 'Обновление приостановлено.',
currentPath: null,
errorMessage: null,
syncStage: null,
),
),
);
@@ -344,6 +347,7 @@ class HomeScreenBloc extends Bloc<HomeScreenEvent, HomeScreenState> {
statusText: 'Не удалось завершить обновление клиента.',
currentPath: null,
errorMessage: _formatError(event.error),
syncStage: null,
),
),
);
@@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:moonwell_launcher/features/downloader/domain/entities/download_progress.dart';
import 'package:moonwell_launcher/features/launcher/domain/entities/client_sync_status.dart';
import 'package:moonwell_launcher/features/launcher/domain/entities/launcher_news_item.dart';
enum HomeScreenPhase {
@@ -31,6 +32,7 @@ final class HomeScreenModel {
final List<LauncherNewsItem> newsItems;
final bool isLoadingNews;
final String? newsErrorMessage;
final ClientSyncStage? syncStage;
const HomeScreenModel({
required this.progress,
@@ -48,6 +50,7 @@ final class HomeScreenModel {
required this.newsItems,
required this.isLoadingNews,
required this.newsErrorMessage,
required this.syncStage,
});
const HomeScreenModel.initial()
@@ -65,7 +68,8 @@ final class HomeScreenModel {
totalFiles = 0,
newsItems = const <LauncherNewsItem>[],
isLoadingNews = true,
newsErrorMessage = null;
newsErrorMessage = null,
syncStage = null;
bool get isBusy =>
phase == HomeScreenPhase.authenticating ||
@@ -91,6 +95,7 @@ final class HomeScreenModel {
List<LauncherNewsItem>? newsItems,
bool? isLoadingNews,
Object? newsErrorMessage = _sentinel,
Object? syncStage = _sentinel,
}) {
return HomeScreenModel(
progress: progress ?? this.progress,
@@ -120,6 +125,9 @@ final class HomeScreenModel {
newsErrorMessage: newsErrorMessage == _sentinel
? this.newsErrorMessage
: newsErrorMessage as String?,
syncStage: syncStage == _sentinel
? this.syncStage
: syncStage as ClientSyncStage?,
);
}
}