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

home_banner.dart 864 B

4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132
  1. import 'package:flutter/material.dart';
  2. import 'package:zhiying_comm/zhiying_comm.dart';
  3. import 'package:flutter_swiper/flutter_swiper.dart';
  4. class HomeBanner extends StatelessWidget {
  5. final Map<String, dynamic> model;
  6. const HomeBanner(this.model, {Key key}) : super(key: key);
  7. @override
  8. Widget build(BuildContext context) {
  9. return Container(
  10. width: double.infinity,
  11. height: 200,
  12. child: Swiper(
  13. itemBuilder: (BuildContext context, int index) {
  14. // return new Image.network(
  15. // "http://via.placeholder.com/350x150",
  16. // fit: BoxFit.fill,
  17. // );
  18. return Container();
  19. },
  20. itemCount: 3,
  21. pagination: new SwiperPagination(),
  22. control: new SwiperControl(),
  23. onTap: (index) {
  24. print(model.toString());
  25. },
  26. ),
  27. );
  28. }
  29. }