|
|
@ -32,15 +32,36 @@ class _CommunityPage extends State<CommunityPage> |
|
|
|
"关于回乡", |
|
|
|
"关于回乡", |
|
|
|
// "直播", |
|
|
|
// "直播", |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
ScrollPhysics b = BouncingScrollPhysics(); |
|
|
|
|
|
|
|
int scrollCount = 0; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tabcontroller == null) |
|
|
|
if (tabcontroller == null) |
|
|
|
tabcontroller = TabController(length: lables.length, vsync: this, initialIndex: 1); |
|
|
|
tabcontroller = TabController(length: lables.length, vsync: this, initialIndex: 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void onChildScroll(){ |
|
|
|
|
|
|
|
if(scrollCount == 0){ |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
b = NeverScrollableScrollPhysics(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
scrollCount+=1; |
|
|
|
|
|
|
|
Future.delayed(Duration(seconds:1), () { |
|
|
|
|
|
|
|
scrollCount-=1; |
|
|
|
|
|
|
|
if(scrollCount == 0){ |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
b = BouncingScrollPhysics(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_toRelease() async { |
|
|
|
_toRelease() async { |
|
|
|
await Navigator.of(context).pushNamed('/router/release_dynamic'); |
|
|
|
await Navigator.of(context).pushNamed('/router/release_dynamic'); |
|
|
|
if(tabcontroller.index == 0){ |
|
|
|
if(tabcontroller.index == 0){ |
|
|
@ -101,7 +122,7 @@ class _CommunityPage extends State<CommunityPage> |
|
|
|
body: Container( |
|
|
|
body: Container( |
|
|
|
padding: EdgeInsets.only(bottom: 76.h), |
|
|
|
padding: EdgeInsets.only(bottom: 76.h), |
|
|
|
child: TabBarView( |
|
|
|
child: TabBarView( |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
physics: b, |
|
|
|
children: lables.map((e) { |
|
|
|
children: lables.map((e) { |
|
|
|
if (e == "关于回乡") { |
|
|
|
if (e == "关于回乡") { |
|
|
|
return BrandPage(); |
|
|
|
return BrandPage(); |
|
|
@ -112,12 +133,12 @@ class _CommunityPage extends State<CommunityPage> |
|
|
|
} |
|
|
|
} |
|
|
|
else if(e == "分享健康"){ |
|
|
|
else if(e == "分享健康"){ |
|
|
|
if (tuijian == null){ |
|
|
|
if (tuijian == null){ |
|
|
|
tuijian = CommunityChildPage(tuijianKey,"分享健康"); |
|
|
|
tuijian = CommunityChildPage(tuijianKey,"分享健康",onChildScroll); |
|
|
|
} |
|
|
|
} |
|
|
|
return tuijian; |
|
|
|
return tuijian; |
|
|
|
}else if(e == "关注"){ |
|
|
|
}else if(e == "关注"){ |
|
|
|
if (guanzhu == null){ |
|
|
|
if (guanzhu == null){ |
|
|
|
guanzhu = CommunityChildPage(guanzhuKey,"关注"); |
|
|
|
guanzhu = CommunityChildPage(guanzhuKey,"关注",onChildScroll); |
|
|
|
} |
|
|
|
} |
|
|
|
return guanzhu; |
|
|
|
return guanzhu; |
|
|
|
} |
|
|
|
} |
|
|
|