Skip to content

Instantly share code, notes, and snippets.

Avatar
🤣
hello world.

尽管如此世界依然美丽 iota9star

🤣
hello world.
View GitHub Profile
@iota9star
iota9star / no-try-catch-await.dart
Last active Sep 22, 2021
No try catch, safe use await in one line.
View no-try-catch-await.dart
import 'dart:async';
Future<void> main() async {
var a = await any(err());
print(a);
print(a.runtimeType);
print(a.hasErr);
print(a.ok);
print(a.ok.runtimeType);
print(a.err);
@iota9star
iota9star / gen_qr_code.dart
Created Aug 9, 2021
Generate QR code by dart native.
View gen_qr_code.dart
import 'dart:io';
import 'package:image/image.dart';
import 'package:qr/qr.dart';
void main() async {
var bytes1 = _genQRCode('大宝好厉害!!!', rectSize: 20);
File('test1.png').writeAsBytesSync(bytes1);
var bytes2 = _genQRCode('大宝好厉害!!!', size: 500);
File('test2.png').writeAsBytesSync(bytes2);
View 📊 Weekly development breakdown
Vue.js 26 hrs 41 mins █████████████▊░░░░░░░ 65.8%
YAML 4 hrs 29 mins ██▎░░░░░░░░░░░░░░░░░░ 11.1%
Rust 2 hrs 7 mins █░░░░░░░░░░░░░░░░░░░░ 5.2%
SQL 1 hr 38 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.0%
XML 1 hr 18 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.2%
View trans_demo.dart
import 'dart:convert';
import 'dart:io';
void main(List<String> arguments) {
get('卡号登陆舰安理会的', func: TransType.ZH_HANT)
.then((value) => print(value))
.catchError((e) => print(e));
}
Future<R> get(