app/src/build.gradle
productFlavors {
app_dev {
dimension "version"
applicationIdSuffix ".dev"
}
app_stg {
signingConfig signingConfigs.debug
dimension "version"
applicationIdSuffix ".stg"
}
app_prod {
signingConfig signingConfigs.release
dimension "version"
}
}
If it does have something like that, then you need to go to Run -> Edit Configuration -> Pick your main.dart
on left side -> Inside ‘Build flavor’ put “app_dev” inside the textbox (The string can be anything and it depends on what’s inside your productFlavors { ... }
)
debug的时候去掉ABI splits in app build.gradle
Flutter Swiper组件使用过程中异常问题
解决方法:增加key属性
Key子类包含LocalKey和GlobalKey。
Swiper(
itemCount: image_length,
loop: true,
autoplay: true,
key: UniqueKey(),
itemBuilder: (BuildContext context, int index) {
return Image.network("image_url");
}
)
podfile里面的
# platform :ios, '11.0'
打开注释改为
platform :ios, '13.0'
pod完之后再改回来
使用 NestedScrollView
NestedScrollView(
headerSliverBuilder: (context, value) {
return [
SliverToBoxAdapter(
child: Header()
),
SliverToBoxAdapter(
child: TabBar(
controller: _controller,
tabs: [
Tab(icon: Icon(Icons.x)),
Tab(icon: Icon(Icons.y)),
Tab(icon: Icon(Icons.z)),
],
),
),
];
},
body: Container(
child: TabBarView(
controller: _controller,
children: <Widget>[
page1(),
page2(),
page3(),
],
),
),
)
会存在同步滚动的问题,可参考关于flutter NestedScrollView导致其body的tabbarview的多个list同步滚动的解决方案,但是我试过了没作用
SingleScrollView嵌套TabbarView,对TabbarView用Container保住并设置高度,其高度监听scrollview滚动用动态计算,效果还可以
void setState(VoidCallback fn) {
if (!mounted) return;
super.setState(fn);
}