This commit is contained in:
2026-07-12 04:33:48 +08:00
parent f8a90ad305
commit e7ce0f7bae
151 changed files with 2765 additions and 2947 deletions

View File

@@ -12,8 +12,8 @@ import '../../utils/utils.dart';
class DownloadItem extends StatefulWidget {
final dynamic desc;
final double width;
const DownloadItem(this.desc, {Key key, this.width}) : super(key: key);
final double? width;
const DownloadItem(this.desc, {Key? key, this.width}) : super(key: key);
@override
State<StatefulWidget> createState() {
@@ -52,7 +52,7 @@ class DownloadItemState extends State<DownloadItem> {
margin: EdgeInsets.only(right: 16.0),
),
Container(
width: widget.width != null ? widget.width - iconWidth - buttonWidth - 60 : MediaQuery.of(context).size.width - iconWidth - buttonWidth - 60,
width: widget.width != null ? widget.width! - iconWidth - buttonWidth - 60 : MediaQuery.of(context).size.width - iconWidth - buttonWidth - 60,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -186,9 +186,9 @@ class DownloadItemState extends State<DownloadItem> {
}
Widget getDownloadButton() {
String downloadUrl;
String os = Utils.getOs();
String selectedOs;
String? downloadUrl;
String? os = Utils.getOs();
String? selectedOs;
List<String> supportedOss = [];
for (int i = 0; i < (widget.desc['urls'] as List).length; i++) {
supportedOss.add((widget.desc['urls'] as List)[i]['os']);
@@ -244,7 +244,7 @@ class DownloadItemState extends State<DownloadItem> {
} else if (downloadUrl != null && downloadUrl.isNotEmpty) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).primaryColor,
padding: EdgeInsets.all(8)
),
child: Row(
@@ -255,7 +255,7 @@ class DownloadItemState extends State<DownloadItem> {
padding: EdgeInsets.only(right: 0.0, left: 6.0, top: 6.0, bottom: 6.0),
child: Icon(
IconData(
Utils.getOsFontHex(selectedOs),
Utils.getOsFontHex(selectedOs!),
fontFamily: 'wisetronic',
fontPackage: null
),