This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:collection'; | |
Future<void> main() async { | |
final list = await [ | |
Future.delayed(const Duration(milliseconds: 1500), () => 1), | |
Future.delayed(const Duration(milliseconds: 5000), () => throw '2'), | |
Future.delayed(const Duration(milliseconds: 1200), () => 3), | |
Future.delayed(const Duration(milliseconds: 8000), () => throw '4'), | |
Future.delayed(const Duration(milliseconds: 4300), () => 5), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
class NewValueNotifier<T> extends ChangeNotifier implements ValueListenable<T> { | |
NewValueNotifier(this._value); | |
@override | |
T get value => _value; | |
T _value; | |
set value(T value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
Future<void> main() async { | |
final a = await err().noc(); | |
print(a); | |
print(a.runtimeType); | |
print(a.hasErr); | |
print(a.value); | |
print(a.value.runtimeType); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class Mutex { | |
Completer<void>? _completer; | |
Future<void> lock() async { | |
while (_completer != null) { | |
await _completer!.future; | |
} | |
_completer = Completer<void>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:collection'; | |
import 'package:collection/collection.dart'; | |
import 'package:tuple/tuple.dart'; | |
typedef QueueTask<T> = Tuple3<int, FutureOr<T> Function(), Completer<T>>; | |
extension QueueTaskExtension<T> on QueueTask<T> { | |
int get taskId => item1; |