基础库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

41 行
989 B

  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:zhiying_comm/zhiying_comm.dart';
  4. class TaobaoImageView extends StatefulWidget {
  5. @override
  6. _TaobaoImageViewState createState() => _TaobaoImageViewState();
  7. }
  8. class _TaobaoImageViewState extends State<TaobaoImageView> {
  9. List<String> _images = List();
  10. @override
  11. void initState() {
  12. TaobaoLoader.loadImages('553848677009').then((images) {
  13. _images = images;
  14. setState(() {});
  15. });
  16. super.initState();
  17. }
  18. @override
  19. Widget build(BuildContext context) {
  20. return Scaffold(
  21. appBar: AppBar(
  22. title: Text('淘宝图片加载'),
  23. ),
  24. body: SingleChildScrollView(
  25. child: Column(
  26. children: _images.map((imageUrl) {
  27. return CachedNetworkImage(
  28. imageUrl: imageUrl ?? '',
  29. fit: BoxFit.fitWidth,
  30. );
  31. }).toList(),
  32. ),
  33. ),
  34. );
  35. }
  36. }