Flutter 打开背景透明的路由页面

1、PageRouteBuilder – opaque:false
2、Scaffold-- backgroundColor: Colors.transparent

Navigator.of(context).push(
  PageRouteBuilder(
    opaque:false,
    pageBuilder: (context, animation, secondaryAnimation) {
      return Scaffold(
        backgroundColor: Colors.transparent,
        body: SafeArea(
          child: Stack(
            children: [
             //...
            ],
          ),
      )
    );
    }
));

你可能感兴趣的:(flutter,dart)