当前位置:网站首页>Dart development skills
Dart development skills
2022-06-30 09:44:00 【InfoQ】
Dart Simple extension of string currency format in
void main() {
print("1000".currency());
print("1300000".currency());
print("1005000".currency(symbol: '£'));
print("1000000".currency(symbol: '€'));
}
extension StringFormatter on String{
String currency({String symbol = "\$"}) {
int step = 1;
String val = this;
for (var i = val.length-1; i >=0; i--) {
if (i - 2*step > 0) {
val = val.replaceRange(i-2*step, i-2*step, ",");
step++;
}
}
return "$symbol$val";
}
}

Use Flutter stay Android 12 Verify on Android App Links
How it works ?
await DomainVerificationManager.isSupported;- Verified : Passed Android Domain to which link validation applies
- Selected : Failed validation , But the user manually associates the domain of the application .
- nothing : Any other domain
await DomainVerificationManager.domainStageVerified;
await DomainVerificationManager.domainStageSelected;
await DomainVerificationManager.domainStageNone;Change state
await DomainVerificationManager.domainRequest();Conclusion
边栏推荐
- JVM family
- Experience of an acmer
- Redis + MySQL implements the like function
- Challenge transform() 2D
- Simple redis lock
- UltraEdit delete empty line method
- 云技能提升好伙伴,亚马逊云师兄今天正式营业
- 八大排序(二)
- Solution to pychart's failure in importing torch package
- Electron, which can wrap web page programs into desktop applications
猜你喜欢

AutoUpdater. Net client custom update file

Distributed ID

5. Messager framework and imessager interface

prometheus 监控之 ntp_exporter

Challenge transform() 2D

直播带货源码开发中,如何降低直播中的延迟?

MySQL-- Entity Framework Code First(EF Code First)

Solution to the eighth training competition of 2020 Provincial Games

Guilin robust medical acquired 100% equity of Guilin Latex to fill the blank of latex product line

【新书推荐】MongoDB Performance Tuning
随机推荐
About the smart platform solution for business hall Terminal Desktop System
八大排序(二)
抽象类和接口
Challenge transform() 2D
Guilin robust medical acquired 100% equity of Guilin Latex to fill the blank of latex product line
Niuke walks on the tree (ingenious application of parallel search)
ES6 learning path (II) let & const
11. customize hooks
float
Cb/s Architecture - Implementation Based on cef3+mfc
I'm late for school
Pass anonymous function to simplification principle
Pipe pipe --namedpipe and anonymouspipe
How do I start? (continuously updating)
Niuke IOI weekly competition 20 popularization group (problem solving)
Numpy (data type)
布隆过滤器
Deep Learning with Pytorch-Train A Classifier
ES6 learning path (III) deconstruction assignment
Flutter的特别之处在哪里