我无法在液体滑动中实现连接结果

  • 本文关键字:实现 连接 结果 flutter dart
  • 更新时间 :
  • 英文 :


嗨,我正在尝试使用OfflineBuilderLiquidSwipe但它不起作用,而且我不知道为什么有人可以帮助我?谢谢!

Widget build(BuildContext context) {
final pages = [
//pagina1
Container(
color: connected ? Colors.purple[700] : color: Colors.red,
),
Container(
color: Colors.pink[700]
),
];
return Scaffold(
body: OfflineBuilder(
connectivityBuilder: (
BuildContext context,
ConnectivityResult connectivity,
Widget child,
) {
final bool connected = connectivity != ConnectivityResult.none;
return LiquidSwipe(
pages: pages,
enableLoop: true,
fullTransitionValue: 700,
enableSlideIcon: false,
waveType: WaveType.liquidReveal,
positionSlideIcon: 0.7,
);
}),
);
}
}

您没有使用OfflineBuilder中的connected。试试这个

final pages(bool connected) => [
//pagina1
Container(
color: connected ? Colors.purple[700] : color: Colors.red,
),
Container(
color: Colors.pink[700]
),      
];
Widget build(BuildContext context) {
return Scaffold(
body: OfflineBuilder(
connectivityBuilder: (
BuildContext context,
ConnectivityResult connectivity,
Widget child,
) {
final bool connected = connectivity != ConnectivityResult.none;
return LiquidSwipe(
pages: pages(connected),
enableLoop: true,
fullTransitionValue: 700,
enableSlideIcon: false,
waveType: WaveType.liquidReveal,
positionSlideIcon: 0.7,
);
},
),
);
}
}

相关内容

  • 没有找到相关文章