feat: ui improvement

flutter 3.7 compatibility
responsive view
beautiful progress bar
select file in treeview
downlading and downloaded page
This commit is contained in:
wuke2022 authored and liwei committed 2023-02-16 11:34:42 +08:00
1 parent a875a9258e
commit 9b1ed15fea
28 files changed
+932 -439

No files matched your search

+7 -2
View File
@@ -7,6 +7,7 @@ class Resource {
String name;
int size;
bool range;
String rootDir;
List<FileInfo> files;
String hash;
@@ -14,6 +15,7 @@ class Resource {
{required this.name,
required this.size,
required this.range,
required this.rootDir,
required this.files,
required this.hash});
@@ -25,17 +27,20 @@ class Resource {
@JsonSerializable()
class FileInfo {
String name;
// String rootDir;
String path;
String name;
int size;
FileInfo({
required this.name,
// required this.rootDir,
required this.path,
required this.name,
required this.size,
});
factory FileInfo.fromJson(Map<String, dynamic> json) =>
_$FileInfoFromJson(json);
Map<String, dynamic> toJson() => _$FileInfoToJson(this);
}
+4 -2
View File
@@ -10,6 +10,7 @@ Resource _$ResourceFromJson(Map<String, dynamic> json) => Resource(
name: json['name'] as String,
size: json['size'] as int,
range: json['range'] as bool,
rootDir: json['rootDir'] as String,
files: (json['files'] as List<dynamic>)
.map((e) => FileInfo.fromJson(e as Map<String, dynamic>))
.toList(),
@@ -20,18 +21,19 @@ Map<String, dynamic> _$ResourceToJson(Resource instance) => <String, dynamic>{
'name': instance.name,
'size': instance.size,
'range': instance.range,
'rootDir': instance.rootDir,
'files': instance.files.map((e) => e.toJson()).toList(),
'hash': instance.hash,
};
FileInfo _$FileInfoFromJson(Map<String, dynamic> json) => FileInfo(
name: json['name'] as String,
path: json['path'] as String,
name: json['name'] as String,
size: json['size'] as int,
);
Map<String, dynamic> _$FileInfoToJson(FileInfo instance) => <String, dynamic>{
'name': instance.name,
'path': instance.path,
'name': instance.name,
'size': instance.size,
};