zoukankan      html  css  js  c++  java
  • 右滑返回上一页

    代码:

    import 'package:flutter/cupertino.dart';

    class RightBackDemo extends StatelessWidget {
    const RightBackDemo({Key key}) : super(key: key);

    @override
    Widget build(BuildContext context) {
    return CupertinoPageScaffold(
    child: Center(
    child: Container(
    height: 100.0,
    100.0,
    color: CupertinoColors.activeBlue,
    child: CupertinoButton(
    child: Icon(CupertinoIcons.add),
    onPressed: (){
    Navigator.of(context).push(
    CupertinoPageRoute(builder: (BuildContext context){//使用cupertinoPage 就自动带有手势右滑返回
    return RightBackDemo();//还是打开本控件
    })
    );
    },
    ),
    ),
    ),
    );
    }
    }
    总结:

    //手势右滑返回操作

     

    导入cupertino

    使用的一切控件 都带前缀 cupertino  

    使用CupertinoPageRoute()//系统会默认给我们添加右滑返回

     

  • 相关阅读:
    HTML5画布(线条、渐变)
    HTML5画布(圆形)
    HTML5画布(矩形)
    HTML5拖放
    HTML5音频
    HTML5视频
    table添加正确的样式
    Mac上SublimeText3安装Emmet时PyV8安装问题
    PHP分页
    Mysql的limit用法
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12214721.html
Copyright © 2011-2022 走看看