Dart & basic

2.4.0 Dart SDK

https://github.com/dart-lang/sdk/releases

https://github.com/dart-lang

https://dart.dev/guides/language

install

https://dart.dev/tutorials/server/get-started

windows


dart ..


/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2019-08-09
*
* @description flutter navigator Return data from a screen
* @augments
* @example
*
*/ import 'package:flutter/material.dart'; import 'details.dart'; void main()=>runApp(MyApp()); class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'flutter navigator Animate a widget across screens',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomeScreen(),
);
}
} class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Returning Data Demo'),
),
body: Center(
child: SelectionButton(),
),
);
}
} class SelectionButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RaisedButton(
onPressed: () {
_navigateAndDisplaySelection(context);
},
child: Text('Pick an option, any option!'),
);
}
// A method that launches the SelectionScreen
// and awaits the result from Navigator.pop.
_navigateAndDisplaySelection(BuildContext context) async {
// Navigator.push returns a Future that completes after calling
// Navigator.pop on the Selection Screen.
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SelectionScreen(),
),
);
// After the Selection Screen returns a result,
// hide any previous snackbars and show the new result.
Scaffold.of(context)
..removeCurrentSnackBar()
..showSnackBar(
SnackBar(
content: Text("$result"),
),
);
// TODO: .. ???
}
}

dart .. syntax

https://dart.dev/guides/language/language-tour

dart & Cascade notation (..)

https://dart.dev/guides/language/language-tour#cascade-notation-

querySelector('#confirm') // Get an object.
..text = 'Confirm' // Use its members.
..classes.add('important')
..onClick.listen((e) => window.alert('Confirmed!'));

dart .. operator

https://dart.dev/guides/language/language-tour













































xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


Dart & basic的更多相关文章

  1. Dart 基础重点截取 Dart 2 20180417

    官网教程 https://www.dartlang.org/guides/language/language-tour dart是一个单线程的语言,没有多线程 Final and const If y ...

  2. How do you run an interactive process in Dart?

    https://stackoverflow.com/questions/12682269/how-do-you-run-an-interactive-process-in-dart The test ...

  3. Atitit HTTP 认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结

    Atitit HTTP认证机制基本验证 (Basic Authentication) 和摘要验证 (Digest Authentication)attilax总结 1.1. 最广泛使用的是基本验证 ( ...

  4. Basic Tutorials of Redis(9) -First Edition RedisHelper

    After learning the basic opreation of Redis,we should take some time to summarize the usage. And I w ...

  5. Basic Tutorials of Redis(8) -Transaction

    Data play an important part in our project,how can we ensure correctness of the data and prevent the ...

  6. Basic Tutorials of Redis(7) -Publish and Subscribe

    This post is mainly about the publishment and subscription in Redis.I think you may subscribe some o ...

  7. Basic Tutorials of Redis(6) - List

    Redis's List is different from C#'s List,but similar with C#'s LinkedList.Sometimes I confuse with t ...

  8. Basic Tutorials of Redis(5) - Sorted Set

    The last post is mainly about the unsorted set,in this post I will show you the sorted set playing a ...

  9. Basic Tutorials of Redis(4) -Set

    This post will introduce you to some usages of Set in Redis.The Set is a unordered set,it means that ...

随机推荐

  1. pthon之变量

    1.变量由三部分组成: 变量名  =   值 如:name = 'xiaohan'     sex='男'   age = 20 2.变量名的规范 2.1 变量名只能是字母,数字或下划线的任意组合 2 ...

  2. Excel 常用数据类型、自定义格式、特殊值等等

    常用数据类型: 常规: 常规单元榴格式不包含慑拍H靛的数字格式. 数值: 可以设置小数位数,是否使用千位分割符,以及负数样式 货币: 可以设置小数位数,货币符号,以及负数样式 会计专用: 可以设置小数 ...

  3. #define typedef 区别

    1) #define是预处理指令,在编译预处理时进行简单的替换,不作正确性检查,不关含义是否正确照样带入,只有在编译已被展开的源程序时才会发现可能的错误并报错.例如: #define PI 3.141 ...

  4. P1255 数楼梯 Python实现

    题目描述 楼梯有N阶,上楼可以一步上一阶,也可以一步上二阶. 编一个程序,计算共有多少种不同的走法. 输入格式 一个数字,楼梯数. 输出格式 走的方式几种. 输入输出样例 输入 #1 4 输出 #1 ...

  5. php之__DIR__,__FILE__,getcwd()的区别。

    __DIR__ 在哪个脚本文件里面出现,就显示当前脚本的目录,不包含文件名.假如目录A下的1.php包含了这个魔术常量,这个文件被目录B下的2.php调用了.那么__DIR__返回的值是多少呢?返回的 ...

  6. HttpRunner(1)自我介绍

    前言 首先,我们无论学习哪个框架,都要带着问题,带着思考去学习 思考1:HttpRunner是什么? 思考2:HttpRunner的设计模式是什么? 思考3:为什么我们要学习HttpRunner?他的 ...

  7. 从NMEA0183到GNSS定位数据获取(二)软件篇

    作者:良知犹存 转载授权以及围观:欢迎添加微信公众号:Conscience_Remains 总述 GPS我们都知道,一种用来全球定位的系统,后来俄罗斯推出了格洛纳斯定位系统,中国推出了北斗定位,欧盟有 ...

  8. hdu 01 Matrix

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission ...

  9. ACdream1414 Geometry Problem

    Problem Description       Peter is studying in the third grade of elementary school. His teacher of ...

  10. VJ train1 I-彼岸

    一道递推题(我这个菜鸡刚开始以为是排列组合) 题目: 突破蝙蝠的包围,yifenfei来到一处悬崖面前,悬崖彼岸就是前进的方向,好在现在的yifenfei已经学过御剑术,可御剑轻松飞过悬崖.现在的问题 ...