Git Product home page Git Product logo

flutter_app's Introduction

XDJcc

First Flutter project form XDJcc.

1.路由

1)界面跳转:

  Navigator.of(context).push("/detail",arguments:{'id',"界面跳转"})

2)替换路由的两种方式:

  Navigator.of(context).pushReplacementNamed("/detail",
    arguments: {"id": "replace替换路由切换页面 goods -> detail,goods销毁,detail代替该层级"});
  Navigator.of(context).pushNamed();
  Navigator.of(context).pop();
  Navigator.of(context).pushAndRemoveUntil(
    MaterialPageRoute(builder: (context) => const Home()),
    (route) => false));
  Navigator.of(context).pushAndRemoveUntil( MaterialPageRoute(builder: (context) =>  Home()), (route) => route == null );

清空路由栈,跳转至指定界面

  Navigator.of(context).pushNamedAndRemoveUntil(’/screen4’, ModalRoute.withName(’/screen1’));

指将制定的页面加入到路由中,然后将之前的路径移除知道制定的页面为止(将具有给定名称的路由推到导航器上,然后删除所有路径前面的路由直到’predicate’返回true为止。) 这时候将销毁栈内除了screen4的页面,点击直接去栈内screen4,这时screen4会重新build

2.Toast

File: ./Toast.dart use bot_toast. Center display by default ,you can set different position.For example 'top' or 'bottom'

Example: Toast.toastShow(msg,{position});

flutter_app's People

Contributors

xdjcc avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.