mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 04:13:43 +08:00
class rename
This commit is contained in:
parent
2b1a9d67a0
commit
c69fbc0876
@ -4,13 +4,13 @@ import 'package:starcitizen_doctor/base/ui.dart';
|
|||||||
import 'package:starcitizen_doctor/base/ui_model.dart';
|
import 'package:starcitizen_doctor/base/ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
||||||
|
|
||||||
import 'downloads_ui_model.dart';
|
import 'downloader_ui_model.dart';
|
||||||
|
|
||||||
class DownloadsUI extends BaseUI<DownloadsUIModel> {
|
class DownloaderUI extends BaseUI<DownloaderUIModel> {
|
||||||
final DateFormat formatter = DateFormat('yyyy-MM-dd HH:mm:ss');
|
final DateFormat formatter = DateFormat('yyyy-MM-dd HH:mm:ss');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget? buildBody(BuildContext context, DownloadsUIModel model) {
|
Widget? buildBody(BuildContext context, DownloaderUIModel model) {
|
||||||
return makeDefaultPage(context, model,
|
return makeDefaultPage(context, model,
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -58,7 +58,7 @@ class DownloadsUI extends BaseUI<DownloadsUIModel> {
|
|||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final (task, type, isFirstType) = model.getTaskAndType(index);
|
final (task, type, isFirstType) = model.getTaskAndType(index);
|
||||||
final nt = DownloadsUIModel.getTaskTypeAndName(task);
|
final nt = DownloaderUIModel.getTaskTypeAndName(task);
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -243,5 +243,5 @@ class DownloadsUI extends BaseUI<DownloadsUIModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String getUITitle(BuildContext context, DownloadsUIModel model) => "下载管理";
|
String getUITitle(BuildContext context, DownloaderUIModel model) => "下载管理";
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ import 'package:starcitizen_doctor/base/ui_model.dart';
|
|||||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
||||||
|
|
||||||
class DownloadsUIModel extends BaseUIModel {
|
class DownloaderUIModel extends BaseUIModel {
|
||||||
List<Aria2Task> tasks = [];
|
List<Aria2Task> tasks = [];
|
||||||
List<Aria2Task> waitingTasks = [];
|
List<Aria2Task> waitingTasks = [];
|
||||||
List<Aria2Task> stoppedTasks = [];
|
List<Aria2Task> stoppedTasks = [];
|
@ -7,8 +7,8 @@ import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
|||||||
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
||||||
import 'package:starcitizen_doctor/global_ui_model.dart';
|
import 'package:starcitizen_doctor/global_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/ui/about/about_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/about/about_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/ui/home/downloads/downloads_ui.dart';
|
import 'package:starcitizen_doctor/ui/home/downloader/downloader_ui.dart';
|
||||||
import 'package:starcitizen_doctor/ui/home/downloads/downloads_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/home/downloader/downloader_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/ui/home/home_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/home/home_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/ui/settings/settings_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/settings/settings_ui_model.dart';
|
||||||
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
|
import 'package:starcitizen_doctor/ui/tools/tools_ui_model.dart';
|
||||||
@ -102,8 +102,8 @@ class IndexUIModel extends BaseUIModel {
|
|||||||
|
|
||||||
Future<void> goDownloader() async {
|
Future<void> goDownloader() async {
|
||||||
await BaseUIContainer(
|
await BaseUIContainer(
|
||||||
uiCreate: () => DownloadsUI(),
|
uiCreate: () => DownloaderUI(),
|
||||||
modelCreate: () => DownloadsUIModel()).push(context!);
|
modelCreate: () => DownloaderUIModel()).push(context!);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _listenAria2c() async {
|
void _listenAria2c() async {
|
||||||
|
@ -11,11 +11,11 @@ import 'package:starcitizen_doctor/common/helper/log_helper.dart';
|
|||||||
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
import 'package:starcitizen_doctor/common/helper/system_helper.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
import 'package:starcitizen_doctor/common/io/aria2c.dart';
|
||||||
import 'package:starcitizen_doctor/common/io/rs_http.dart';
|
import 'package:starcitizen_doctor/common/io/rs_http.dart';
|
||||||
import 'package:starcitizen_doctor/ui/home/downloads/downloads_ui.dart';
|
import 'package:starcitizen_doctor/ui/home/downloader/downloader_ui.dart';
|
||||||
|
import 'package:starcitizen_doctor/ui/home/downloader/downloader_ui_model.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
import 'package:xml/xml.dart';
|
import 'package:xml/xml.dart';
|
||||||
|
|
||||||
import '../home/downloads/downloads_ui_model.dart';
|
|
||||||
|
|
||||||
class ToolsUIModel extends BaseUIModel {
|
class ToolsUIModel extends BaseUIModel {
|
||||||
bool _working = false;
|
bool _working = false;
|
||||||
@ -370,7 +370,7 @@ class ToolsUIModel extends BaseUIModel {
|
|||||||
...await aria2c.tellActive(),
|
...await aria2c.tellActive(),
|
||||||
...await aria2c.tellWaiting(0, 100000)
|
...await aria2c.tellWaiting(0, 100000)
|
||||||
]) {
|
]) {
|
||||||
final t = DownloadsUIModel.getTaskTypeAndName(value);
|
final t = DownloaderUIModel.getTaskTypeAndName(value);
|
||||||
if (t.key == "torrent" && t.value.contains("Data.p4k")) {
|
if (t.key == "torrent" && t.value.contains("Data.p4k")) {
|
||||||
showToast(context!, "已经有一个p4k下载任务正在进行中,请前往下载管理器查看!");
|
showToast(context!, "已经有一个p4k下载任务正在进行中,请前往下载管理器查看!");
|
||||||
working = false;
|
working = false;
|
||||||
@ -422,8 +422,8 @@ class ToolsUIModel extends BaseUIModel {
|
|||||||
AnalyticsApi.touch("p4k_download");
|
AnalyticsApi.touch("p4k_download");
|
||||||
|
|
||||||
BaseUIContainer(
|
BaseUIContainer(
|
||||||
uiCreate: () => DownloadsUI(),
|
uiCreate: () => DownloaderUI(),
|
||||||
modelCreate: () => DownloadsUIModel()).push(context!);
|
modelCreate: () => DownloaderUIModel()).push(context!);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
working = false;
|
working = false;
|
||||||
showToast(context!, "初始化失败!: $e");
|
showToast(context!, "初始化失败!: $e");
|
||||||
|
Loading…
Reference in New Issue
Block a user