基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

taobao_image_viewer.dart 989 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. }