61 lines
1.6 KiB
Dart
61 lines
1.6 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_wisetronic/widgets/general/download_item.dart';
|
|
import '../../store/store.dart';
|
|
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
|
|
|
|
class MobileDownloadApps extends StatefulWidget {
|
|
final Map<String, dynamic> data;
|
|
|
|
MobileDownloadApps(this.data, {Key key}) : super(key: key);
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return MobileDownloadAppsState();
|
|
}
|
|
|
|
}
|
|
|
|
class MobileDownloadAppsState extends State<MobileDownloadApps> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (widget.data == null) {
|
|
return Container();
|
|
}
|
|
Column col = Column(
|
|
children: [
|
|
Container(
|
|
child: Util.showImage(
|
|
'https:${widget.data['download-image']['image']}'
|
|
),
|
|
),
|
|
],
|
|
);
|
|
List<Widget> apps = _getApps();
|
|
for (int i = 0; i < apps.length; i++) {
|
|
col.children.add(apps[i]);
|
|
}
|
|
return col;
|
|
}
|
|
|
|
List<Widget> _getApps() {
|
|
List<Widget> apps = [];
|
|
for (int i = 0; i < (widget.data['apps'] as List).length; i++) {
|
|
apps.add(DownloadItem((widget.data['apps'] as List)[i], width: MediaQuery.of(context).size.width,));
|
|
if (i + 1 < (widget.data['apps'] as List).length) {
|
|
apps.add(Container(
|
|
padding: EdgeInsets.only(top: 10.0, bottom: 5.0),
|
|
decoration: BoxDecoration(
|
|
border: Border(
|
|
top: BorderSide(
|
|
width: 0.5,
|
|
color: Colors.black38,
|
|
),
|
|
),
|
|
),
|
|
));
|
|
}
|
|
}
|
|
return apps;
|
|
}
|
|
} |