lianyagang / flutter_swiper_null_safety

根据大佬https://github.com/best-flutter/flutter_swiper修改到空安全swiper
MIT License
95 stars 48 forks source link

Exception caught by rendering library #14

Closed osReilly closed 2 years ago

osReilly commented 2 years ago
  body: Column(
    children: [
      Text('test flutter swiper'),
      Container(
        child: Swiper(
          itemBuilder: (BuildContext context, int index) {
            return Image.network(
              "https://via.placeholder.com/350x150",
              fit: BoxFit.fill,
            );
          },
          itemCount: 3,
          pagination: SwiperPagination(),
          control: SwiperControl(),
        ),
      )
    ],
  )

报错Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderViewport#8c7d1 NEEDS-PAINT 'package:flutter[/src/rendering/box.dart]()': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1929 pos 12: 'hasSize'

lianyagang commented 2 years ago

更新flutter 到3.x版本

lianyagang commented 2 years ago
  body: Column(
    children: [
      Text('test flutter swiper'),
      Container(
        child: Swiper(
          itemBuilder: (BuildContext context, int index) {
            return Image.network(
              "https://via.placeholder.com/350x150",
              fit: BoxFit.fill,
            );
          },
          itemCount: 3,
          pagination: SwiperPagination(),
          control: SwiperControl(),
        ),
      )
    ],
  )

报错Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderViewport#8c7d1 NEEDS-PAINT 'package:flutter/src/rendering/box.dart': package:flutter/…/rendering/box.dart:1 Failed assertion: line 1929 pos 12: 'hasSize'

更新到flutter 3.x版本