当前位置:网站首页>Dart extended feature
Dart extended feature
2022-06-30 14:00:00 【xiangxiongfly915】
List of articles
Dart Extended features
summary
Generally, a class should be extended , You need to inherit this class , stay dart 2.7 in the future , introduce extension, Used to extend the methods of the class .
Use
extension StringToNumber on String {
int toInt() {
return int.parse(this);
}
}
extension NumberOperator on int {
int add(int other) {
return this + other;
}
}
int result = "18".toInt();
int sum = 1.add(2);
API Conflict
Mode one
Use show or hide Restricted use .
import 'extension1.dart' hide StringToNumber, NumberOperator;
import 'extension2.dart';
Mode two
rename .
import 'extention1.dart';
import 'extention2.dart' as ext2;
边栏推荐
- Today's sleep quality record 80 points
- Tencent two sides: @bean and @component are used on the same class. What happens?
- 一条查询SQL是如何执行的
- In the digital age, XDR (extended detection and response) has unlimited possibilities
- navicat数据库建表是没有utf8选项。
- 【科研数据处理】[基础]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)
- Read all the knowledge points about enterprise im in one article
- [the path of system analyst] Chapter V software engineering (software process improvement)
- There is no utf8 option for creating tables in Navicat database.
- [deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and "zero value"
猜你喜欢

防火墙基础之总部双机热备与分支基础配置

Apache Doris comparison optimization Encyclopedia
![[KALI] KALI系统、软件更新(附带镜像源)](/img/ac/43a3f81d50ab6866271b500b142252.png)
[KALI] KALI系统、软件更新(附带镜像源)

步骤详解 | 助您轻松提交 Google Play 数据安全表单
![[Title brushing] heater](/img/ee/70e122b1b1a406624aa7c6442fcdc1.png)
[Title brushing] heater

腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?

60 divine vs Code plug-ins!!

visualstudio 和sql

Intelligent operation and maintenance: visual management system based on BIM Technology

There is no utf8 option for creating tables in Navicat database.
随机推荐
【刷题篇】避免洪水泛滥
随着产业互联网的发展,有关互联网的落地和应用也就变得宽阔了起来
【刷题篇】供暖器
Unity animator parameter
[kubernetes series] k8s set mysql8 case insensitive
幸运哈希竞猜系统开发(源码部署)趣投哈希游戏玩法开发(案例需求)
可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈
Tencent two sides: @bean and @component are used on the same class. What happens?
提权扫描工具
Jetpack Compose 实现完美屏幕适配
深入理解.Net中的线程同步之构造模式(二)内核模式2.内核模式构造物Semaphone
MySQL如何将列合并?
数字时代,XDR(扩展检测与响应)的无限可能
Multi terminal collaboration of Huawei accounts to create a better internet life
Introduction to two types of rxjs observable operators
Deep understanding Net (2) kernel mode 3 Kernel mode construct mutex
60 divine vs Code plug-ins!!
QQ 居然被盗了?原因在这......
[Title brushing] heater
表格储存中sql查询的时候,查询结果增加主键报错,查询结果超过10w行。需要对主键增加上多元索引吗?