基础组件库
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.

guide_page.dart 1014 B

4 years ago
12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_base_widget/models/app_config_model.dart';
  3. import 'package:flutter_swiper/flutter_swiper.dart';
  4. import 'package:zhiying_comm/zhiying_comm.dart';
  5. class GuidePage extends StatefulWidget {
  6. final AppConfigGuideModel model;
  7. const GuidePage(this.model, {Key key}) : super(key: key);
  8. @override
  9. State<StatefulWidget> createState() => _GuidePageState();
  10. }
  11. class _GuidePageState extends State<GuidePage> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return Swiper(
  15. itemBuilder: (BuildContext context, int index) {
  16. return new Image.network(
  17. widget.model?.images[index],
  18. fit: BoxFit.fill,
  19. );
  20. },
  21. loop: false,
  22. itemCount: widget.model?.images?.length ?? 0,
  23. pagination: new SwiperPagination(),
  24. control: new SwiperControl(),
  25. onIndexChanged: (index) {
  26. Logger.debug(index);
  27. },
  28. onTap: (index) {
  29. Logger.debug('点击');
  30. },
  31. );
  32. }
  33. }