93 lines
2.5 KiB
Dart
93 lines
2.5 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
|
|
|
|
class MobileMiniPosLearnMore extends StatefulWidget {
|
|
final Map<String, dynamic> data;
|
|
const MobileMiniPosLearnMore(this.data, {Key key}) : super(key: key);
|
|
|
|
@override
|
|
State<StatefulWidget> createState() {
|
|
return MobileMiniPosLearnMoreState();
|
|
}
|
|
|
|
}
|
|
|
|
class MobileMiniPosLearnMoreState extends State<MobileMiniPosLearnMore> {
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Column col = Column(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(bottom: 20.0),
|
|
child: Util.showImage(
|
|
'https:${widget.data['image-top']['image']}',
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
|
|
],
|
|
);
|
|
List<Widget> w = _getContent();
|
|
for (int i = 0; i < w.length; i++) {
|
|
col.children.add(w[i]);
|
|
}
|
|
return SingleChildScrollView(
|
|
child: col,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
}
|
|
|
|
List<Widget> _getContent() {
|
|
List<Widget> widgets = [];
|
|
for (int i = 0; i < (widget.data['sections'] as List).length; i++) {
|
|
Column col = Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [],
|
|
);
|
|
col.children.add(Container(
|
|
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 4.0),
|
|
child: Text(
|
|
'${(widget.data['sections'] as List)[i]['title']}',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 16.0,
|
|
color: Colors.black87,
|
|
),
|
|
),
|
|
));
|
|
col.children.add(
|
|
Container(
|
|
padding: EdgeInsets.only(top: 10.0, left: 8.0, right: 8.0, bottom: 8.0),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(20.0),
|
|
child: Util.showImage(
|
|
'https:${(widget.data['sections'] as List)[i]['image']['image']}',
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
col.children.add(Container(
|
|
margin: EdgeInsets.only(top: 4.0, left: 8.0, right: 8.0, bottom: 20.0),
|
|
padding: EdgeInsets.only(bottom: 10.0),
|
|
child: Text(
|
|
'${(widget.data['sections'] as List)[i]['description']}',
|
|
style: TextStyle(
|
|
fontSize: 14.0,
|
|
color: Colors.black38,
|
|
),
|
|
),
|
|
));
|
|
widgets.add(col);
|
|
}
|
|
return widgets;
|
|
}
|
|
}
|