Dart & import show & import hide & import as & part & part of

// 部分导入,即仅仅导入 dart:ui 库里面的 Color 模块
import 'dart:ui' show Color;

https://stackoverflow.com/questions/19723063/what-is-the-difference-between-show-and-as-in-an-import-statement

https://riptutorial.com/dart/example/11450/importing-only-part-of-a-library

// Import only foo and bar.
import 'package:lib1/lib1.dart' show foo, bar; // Import all names EXCEPT foo.
import 'package:lib2/lib2.dart' hide foo;

Learning dart eBook (PDF)

https://riptutorial.com/Download/dart.pdf

dart:ui & Color

https://api.flutter.dev/flutter/dart-ui/Color-class.html

https://github.com/flutter/engine/blob/master/lib/ui/ui.dart

Color demo

Color c = const Color(0xFF42A5F5);
Color c = const Color.fromARGB(0xFF, 0x42, 0xA5, 0xF5);
Color c = const Color.fromARGB(255, 66, 165, 245);
Color c = const Color.fromRGBO(66, 165, 245, 1.0); Color c1 = const Color(0xFFFFFF);
// fully transparent white (invisible) Color c2 = const Color(0xFFFFFFFF);
// fully opaque white (visible)

https://github.com/flutter/css_colors/blob/master/lib/css_colors.dart

import 'dart:ui' show Color;

class CSSColors {
static const Color aliceBlue = const Color(0xFFF0F8FF);
static const Color antiqueWhite = const Color(0xFFFAEBD7);
static const Color aqua = const Color(0xFF00FFFF);
static const Color aquamarine = const Color(0xFF7FFFD4);
static const Color azure = const Color(0xFFF0FFFF);
static const Color beige = const Color(0xFFF5F5DC);
static const Color bisque = const Color(0xFFFFE4C4);
static const Color black = const Color(0xFF000000);
static const Color blanchedAlmond = const Color(0xFFFFEBCD);
static const Color blue = const Color(0xFF0000FF);
static const Color blueViolet = const Color(0xFF8A2BE2);
static const Color brown = const Color(0xFFA52A2A);
static const Color burlyWood = const Color(0xFFDEB887);
static const Color cadetBlue = const Color(0xFF5F9EA0);
static const Color chartreuse = const Color(0xFF7FFF00);
static const Color chocolate = const Color(0xFFD2691E);
static const Color coral = const Color(0xFFFF7F50);
static const Color cornflowerBlue = const Color(0xFF6495ED);
static const Color cornsilk = const Color(0xFFFFF8DC);
static const Color crimson = const Color(0xFFDC143C);
static const Color cyan = const Color(0xFF00FFFF);
static const Color darkBlue = const Color(0xFF00008B);
static const Color darkCyan = const Color(0xFF008B8B);
static const Color darkGoldenRod = const Color(0xFFB8860B);
static const Color darkGray = const Color(0xFFA9A9A9);
static const Color darkGreen = const Color(0xFF006400);
static const Color darkGrey = const Color(0xFFA9A9A9);
static const Color darkKhaki = const Color(0xFFBDB76B);
static const Color darkMagenta = const Color(0xFF8B008B);
static const Color darkOliveGreen = const Color(0xFF556B2F);
static const Color darkOrange = const Color(0xFFFF8C00);
static const Color darkOrchid = const Color(0xFF9932CC);
static const Color darkRed = const Color(0xFF8B0000);
static const Color darkSalmon = const Color(0xFFE9967A);
static const Color darkSeaGreen = const Color(0xFF8FBC8F);
static const Color darkSlateBlue = const Color(0xFF483D8B);
static const Color darkSlateGray = const Color(0xFF2F4F4F);
static const Color darkSlateGrey = const Color(0xFF2F4F4F);
static const Color darkTurquoise = const Color(0xFF00CED1);
static const Color darkViolet = const Color(0xFF9400D3);
static const Color deepPink = const Color(0xFFFF1493);
static const Color deepSkyBlue = const Color(0xFF00BFFF);
static const Color dimGray = const Color(0xFF696969);
static const Color dimGrey = const Color(0xFF696969);
static const Color dodgerBlue = const Color(0xFF1E90FF);
static const Color fireBrick = const Color(0xFFB22222);
static const Color floralWhite = const Color(0xFFFFFAF0);
static const Color forestGreen = const Color(0xFF228B22);
static const Color fuchsia = const Color(0xFFFF00FF);
static const Color gainsboro = const Color(0xFFDCDCDC);
static const Color ghostWhite = const Color(0xFFF8F8FF);
static const Color gold = const Color(0xFFFFD700);
static const Color goldenRod = const Color(0xFFDAA520);
static const Color gray = const Color(0xFF808080);
static const Color green = const Color(0xFF008000);
static const Color greenYellow = const Color(0xFFADFF2F);
static const Color grey = const Color(0xFF808080);
static const Color honeyDew = const Color(0xFFF0FFF0);
static const Color hotPink = const Color(0xFFFF69B4);
static const Color indianRed = const Color(0xFFCD5C5C);
static const Color indigo = const Color(0xFF4B0082);
static const Color ivory = const Color(0xFFFFFFF0);
static const Color khaki = const Color(0xFFF0E68C);
static const Color lavender = const Color(0xFFE6E6FA);
static const Color lavenderBlush = const Color(0xFFFFF0F5);
static const Color lawnGreen = const Color(0xFF7CFC00);
static const Color lemonChiffon = const Color(0xFFFFFACD);
static const Color lightBlue = const Color(0xFFADD8E6);
static const Color lightCoral = const Color(0xFFF08080);
static const Color lightCyan = const Color(0xFFE0FFFF);
static const Color lightGoldenRodYellow = const Color(0xFFFAFAD2);
static const Color lightGray = const Color(0xFFD3D3D3);
static const Color lightGreen = const Color(0xFF90EE90);
static const Color lightGrey = const Color(0xFFD3D3D3);
static const Color lightPink = const Color(0xFFFFB6C1);
static const Color lightSalmon = const Color(0xFFFFA07A);
static const Color lightSeaGreen = const Color(0xFF20B2AA);
static const Color lightSkyBlue = const Color(0xFF87CEFA);
static const Color lightSlateGray = const Color(0xFF778899);
static const Color lightSlateGrey = const Color(0xFF778899);
static const Color lightSteelBlue = const Color(0xFFB0C4DE);
static const Color lightYellow = const Color(0xFFFFFFE0);
static const Color lime = const Color(0xFF00FF00);
static const Color limeGreen = const Color(0xFF32CD32);
static const Color linen = const Color(0xFFFAF0E6);
static const Color magenta = const Color(0xFFFF00FF);
static const Color maroon = const Color(0xFF800000);
static const Color mediumAquaMarine = const Color(0xFF66CDAA);
static const Color mediumBlue = const Color(0xFF0000CD);
static const Color mediumOrchid = const Color(0xFFBA55D3);
static const Color mediumPurple = const Color(0xFF9370DB);
static const Color mediumSeaGreen = const Color(0xFF3CB371);
static const Color mediumSlateBlue = const Color(0xFF7B68EE);
static const Color mediumSpringGreen = const Color(0xFF00FA9A);
static const Color mediumTurquoise = const Color(0xFF48D1CC);
static const Color mediumVioletRed = const Color(0xFFC71585);
static const Color midnightBlue = const Color(0xFF191970);
static const Color mintCream = const Color(0xFFF5FFFA);
static const Color mistyRose = const Color(0xFFFFE4E1);
static const Color moccasin = const Color(0xFFFFE4B5);
static const Color navajoWhite = const Color(0xFFFFDEAD);
static const Color navy = const Color(0xFF000080);
static const Color oldLace = const Color(0xFFFDF5E6);
static const Color olive = const Color(0xFF808000);
static const Color oliveDrab = const Color(0xFF6B8E23);
static const Color orange = const Color(0xFFFFA500);
static const Color orangeRed = const Color(0xFFFF4500);
static const Color orchid = const Color(0xFFDA70D6);
static const Color paleGoldenRod = const Color(0xFFEEE8AA);
static const Color paleGreen = const Color(0xFF98FB98);
static const Color paleTurquoise = const Color(0xFFAFEEEE);
static const Color paleVioletRed = const Color(0xFFDB7093);
static const Color papayaWhip = const Color(0xFFFFEFD5);
static const Color peachPuff = const Color(0xFFFFDAB9);
static const Color peru = const Color(0xFFCD853F);
static const Color pink = const Color(0xFFFFC0CB);
static const Color plum = const Color(0xFFDDA0DD);
static const Color powderBlue = const Color(0xFFB0E0E6);
static const Color purple = const Color(0xFF800080);
static const Color rebeccaPurple = const Color(0xFF663399);
static const Color red = const Color(0xFFFF0000);
static const Color rosyBrown = const Color(0xFFBC8F8F);
static const Color royalBlue = const Color(0xFF4169E1);
static const Color saddleBrown = const Color(0xFF8B4513);
static const Color salmon = const Color(0xFFFA8072);
static const Color sandyBrown = const Color(0xFFF4A460);
static const Color seaGreen = const Color(0xFF2E8B57);
static const Color seaShell = const Color(0xFFFFF5EE);
static const Color sienna = const Color(0xFFA0522D);
static const Color silver = const Color(0xFFC0C0C0);
static const Color skyBlue = const Color(0xFF87CEEB);
static const Color slateBlue = const Color(0xFF6A5ACD);
static const Color slateGray = const Color(0xFF708090);
static const Color slateGrey = const Color(0xFF708090);
static const Color snow = const Color(0xFFFFFAFA);
static const Color springGreen = const Color(0xFF00FF7F);
static const Color steelBlue = const Color(0xFF4682B4);
static const Color tan = const Color(0xFFD2B48C);
static const Color teal = const Color(0xFF008080);
static const Color thistle = const Color(0xFFD8BFD8);
static const Color tomato = const Color(0xFFFF6347);
static const Color turquoise = const Color(0xFF40E0D0);
static const Color violet = const Color(0xFFEE82EE);
static const Color wheat = const Color(0xFFF5DEB3);
static const Color white = const Color(0xFFFFFFFF);
static const Color whiteSmoke = const Color(0xFFF5F5F5);
static const Color yellow = const Color(0xFFFFFF00);
static const Color yellowGreen = const Color(0xFF9ACD32);
}

flutter material/colors

https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/colors.dart

https://github.com/flutter/flutter/blob/master/packages/flutter/lib/material.dart#L48


export 'src/material/colors.dart';

create-library-packages

创建 dart 库文件

https://dart.dev/guides/libraries/create-library-packages

https://github.com/flutter/flutter/blob/master/packages/flutter/pubspec.yaml

dart part

您可能听说过part指令,该指令可将库拆分为多个Dart文件。

我们建议您避免使用part而是创建小型库。

https://dart.dev/guides/libraries/create-library-packages#organizing-a-library-package

part of

https://livebook.manning.com/book/dart-in-action/chapter-5/1

demo

https://github.com/flutter/engine/blob/master/lib/ui/ui.dart

// @dart = 2.9
library dart.ui; import 'dart:_internal' hide Symbol; // ignore: unused_import
import 'dart:async';
import 'dart:collection' as collection;
import 'dart:convert';
import 'dart:developer' as developer;
import 'dart:io'; // ignore: unused_import
import 'dart:isolate' show SendPort;
import 'dart:math' as math;
import 'dart:nativewrappers';
import 'dart:typed_data'; part 'annotations.dart';
part 'channel_buffers.dart';
part 'compositing.dart';
part 'geometry.dart';
part 'hash_codes.dart';
part 'hooks.dart';
part 'isolate_name_server.dart';
part 'lerp.dart';
part 'natives.dart';
part 'painting.dart';
part 'plugins.dart';
part 'pointer.dart';
part 'semantics.dart';
part 'text.dart';
part 'window.dart';



xgqfrms 2012-2020

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


Dart & import show & import hide & import as & part & part of的更多相关文章

  1. 模块,import,from xxx import xxx

    一,模块 模块就是一个包含了python定义和声明的文件,文件名就是模块的名字加上.py后缀,总体来说,import加载的模块一共分成四个通用的类别: 1,使用python编写的py文件 2,已被变异 ...

  2. 协议 + socket import 和 form xx import *的区别 028

    一 . 网络通信协议(了解) 1 . osi 七层协议 (最好记住 面试会问) 应表会传网数物(应用层 表示层 会话层 传输层 网络层 数据链路层 物理层) 2 .tcp/ip五层 或 tcp/ip四 ...

  3. ubuntu16 升级pip3后报错File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'

    问题:ubuntu16 执行pip3 install --upgrade pip之后,pip3执行出错. Traceback (most recent call last): File "/ ...

  4. less新手入门(三) 作为函数使用的Mixin、@import 导入指令 、@import 导入选项

    五.作为函数使用的Mixin 从mixin返回变量 在mixin中定义的所有变量都是可见的,并且可以在调用者的作用范围中使用(除非调用者用相同的名称定义它自己的变量). .mixin(){ @widt ...

  5. mac os 使用 from scipy.misc import imread ImportError: cannot import name 'imread'

    mac os 使用 from scipy.misc import imread ImportError: cannot import name 'imread' 问题1: 我原先安装了 pillow ...

  6. 输入pip命令报错:from pip import main ImportError: cannot import name 'main'

    报错信息: qly@qlyComputer:~$ pip Traceback (most recent call last): File "/usr/bin/pip", line ...

  7. Python 导入模块的两种方法:import xxx 和from...import xxx

    import 方式导入模块 import tool.getsum.add # 导入模块,优先会从启动文件的当前目录开始寻找 # 如果找到,就使用 # 如果找不到,会在系统模块存放目录去 tool.ge ...

  8. 动态导入(import)和静态导入(import)的区别

    import static静态导入是JDK1.5中的新特性.一般我们导入一个类都用 import com.....ClassName;而静态导入是这样:import static com.....Cl ...

  9. #import、#include、#import<>和#import””的区别

    一.#import与#include #import不会引起交叉编译的问题.因为在Objective-C中会存在C/C++和Object-C混编的问题,如果用#include引入头文件,会导致交叉编译 ...

随机推荐

  1. 在这个应用中,我使用了 MQ 来处理异步流程、Redis 缓存热点数据、MySQL 持久化数据,还有就是在系统中调用另外一个业务系统的接口,对我的应用来说这些都是属于 RPC 调用,而 MQ、MySQL 持久化的数据也会存在于一个分布式文件系统中,他们之间的调用也是需要用 RPC 来完成数据交互的。

    在这个应用中,我使用了 MQ 来处理异步流程.Redis 缓存热点数据.MySQL 持久化数据,还有就是在系统中调用另外一个业务系统的接口,对我的应用来说这些都是属于 RPC 调用,而 MQ.MySQ ...

  2. # Functions are First-Class Citizens in Python 一等公民

    # Functions are First-Class Citizens in Python 一等公民https://cn.bing.com/search?form=MOZSBR&pc=MOZ ...

  3. Quartz 定时任务调度

    一.在Quartz.NET中quartz.properties的配置文件,忽略不修改,考虑下面: var props = new NameValueCollection { { "quart ...

  4. 同时执行多个$.getJSON() 出现数据混乱的问题的解决

    $.getJSON() $.getJSON( url [, data ] [, success(data, textStatus, jqXHR) ] ) url是必选参数,表示json数据的地址: d ...

  5. hadoop知识点总结(三)YARN设计理念及基本架构

    YARN设计理念与基本架构 1,MRv1的局限性:扩展性差,可靠性差,资源利用率低,无法支持多种计算框架 2,YARN基本设计思想 1)基本框架对比 Hadoop1.0中,JobTracker由资源管 ...

  6. Neeto-Vue:我为了记笔记,手写了一个为知笔记客户端

    构建自托管的笔记系统 这两年各种笔记系统快速井喷,好像谁都能来掺一脚,app store随便搜索一个关键字就会有一大堆的结果,从老牌的印象笔记,Bear,MWeb,有道云笔记再到新星专注笔记之类,从买 ...

  7. Jenkins(6)测试报告邮件发送

    前言 前面已经实现在jenkins上展示html的测试报告,接下来只差最后一步,把报告发给你的领导,展示你的劳动成果了. 安装 Email Extension Plugin 插件 jenkins首页- ...

  8. Scala集合库、模式匹配和样例类

    package com.yz8 import org.junit.Test class test { @Test def test: Unit = { val ints = List(1,5,7,6, ...

  9. 2020年10月ICPC & 天梯赛 选拔赛【ACFJ】

    A. 表达式 题意 题解 将所有数字替换为A,运算符替换为O,然后不断合并(AOA),判断表达式最后是否为A即可. 注意将数字替换时判断有无前导零. 代码 #include <bits/stdc ...

  10. SCZ 20170812 T1 HKJ

    因为题面实在是太过暴力,就不贴链接了--我自己重新写一下题面吧-- 题目描述 给定一张带权有向图,设起点为1,终点为n,每个点除编号外还有一个序号,要求输出从起点至终点的最短路经过的点的序号和最短距离 ...