-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
573 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.0.5 | ||
v1.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
v0.0.5 | ||
v1.0.0 | ||
|
||
- [x] 安卓可以在设置中开启音量键翻页 | ||
- [x] 下载缓存漫画, 多线程 | ||
- [x] 发电 | ||
- [x] 一次推送了大量代码, 如有BUG请及时反馈 | ||
|
||
v0.0.4 | ||
v0.0.5 | ||
|
||
- [x] 增加分类筛选项 | ||
- [x] 升级flutter版本 | ||
- [x] 安卓可以在设置中开启音量键翻页 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/// 多线程下载并发数 | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../basic/commons.dart'; | ||
import '../basic/methods.dart'; | ||
import 'is_pro.dart'; | ||
|
||
late int _downloadThreadCount; | ||
int get downloadThreadCount => _downloadThreadCount; | ||
const _values = [1, 2, 3, 4, 5]; | ||
|
||
Future initDownloadThreadCount() async { | ||
_downloadThreadCount = await methods.getDownloadThread(); | ||
} | ||
|
||
Widget downloadThreadCountSetting() { | ||
return StatefulBuilder( | ||
builder: (BuildContext context, void Function(void Function()) setState) { | ||
return ListTile( | ||
title: Text( | ||
"下载线程数" + (!isPro ? "(发电)" : ""), | ||
style: TextStyle( | ||
color: !isPro ? Colors.grey : null, | ||
), | ||
), | ||
subtitle: Text("$_downloadThreadCount"), | ||
onTap: () async { | ||
await chooseDownloadThread(context); | ||
setState(() {}); | ||
}, | ||
); | ||
}, | ||
); | ||
} | ||
|
||
Future chooseDownloadThread(BuildContext context) async { | ||
if (!isPro) { | ||
defaultToast(context, "先发电才能使用多线程嗷"); | ||
return; | ||
} | ||
int? value = await chooseListDialog(context,title: "选择下载线程数", values:_values,); | ||
if (value != null) { | ||
await methods.setDownloadThread(value); | ||
_downloadThreadCount = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:wax/protos/properties.pb.dart'; | ||
|
||
import '../../basic/commons.dart'; | ||
import 'images.dart'; | ||
|
||
// todo 加载本地cover | ||
// todo 显示下载状态和进度 | ||
class DownloadInfoCard extends StatelessWidget { | ||
final bool link; | ||
final ComicDownloadDto comic; | ||
|
||
const DownloadInfoCard( | ||
this.comic, { | ||
this.link = false, | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
const titleStyle = TextStyle(fontWeight: FontWeight.bold); | ||
final authorStyle = TextStyle( | ||
fontSize: 13, | ||
color: Colors.pink.shade300, | ||
); | ||
return Container( | ||
padding: const EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), | ||
decoration: BoxDecoration( | ||
border: Border( | ||
bottom: BorderSide( | ||
color: Theme.of(context).dividerColor, | ||
), | ||
), | ||
), | ||
child: Row( | ||
children: [ | ||
Card( | ||
child: ComicImage( | ||
url: comic.cover, | ||
width: 100 * coverWidth / coverHeight, | ||
height: 100, | ||
), | ||
), | ||
Container(width: 10), | ||
Expanded( | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
link | ||
? GestureDetector( | ||
onLongPress: () { | ||
confirmCopy(context, comic.title); | ||
}, | ||
child: Text(comic.title, style: titleStyle), | ||
) | ||
: Text(comic.title, style: titleStyle), | ||
Container(height: 4), | ||
Row(children: [ | ||
Text( | ||
comic.deleting | ||
? "删除中" | ||
: comic.status == 2 | ||
? "下载失败" | ||
: comic.status == 1 | ||
? "下载成功" | ||
: "下载中", | ||
style: TextStyle( | ||
color: comic.deleting | ||
? Colors.red | ||
: comic.status == 2 | ||
? Colors.red | ||
: comic.status == 1 | ||
? Colors.green | ||
: Colors.blue, | ||
), | ||
), | ||
Container(width: 14), | ||
Text("${comic.pageDown} / ${comic.pageCount}"), | ||
]), | ||
Container(height: 4), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.