Skip to content

Instantly share code, notes, and snippets.

View blaugold's full-sized avatar

Gabriel Terwesten blaugold

View GitHub Profile

Installation

Packages:

  • cbl: Contains the Couchbase Lite API.
  • cbl_flutter: Initializes Couchbase Lite for Flutter.
  • cbl_dart: Initializes Couchbase Lite for Standalone Dart or Flutter unit tests.
  • cbl_flutter_ce: Selects the Community Edition for use with Flutter.
  • cbl_flutter_ee: Selects the Enterprise Edition for use with Flutter.
flutter: INFO 14:06:50.564 + 0ms [connectivity] connection status wifi
flutter: INFO 14:06:51.262 + 698ms [sync] User is signed in: Nl7TkP9LlAgd3LrsyRtQ7voBAB52
flutter: INFO 14:06:51.340 + 77ms [analytics] couch_document_loaded (doc: game:Nl7TkP9LlAgd3LrsyRtQ7voBAB52)
flutter: INFO 14:06:51.341 + 0ms [storage] loaded document game:Nl7TkP9LlAgd3LrsyRtQ7voBAB52
flutter: INFO 14:06:51.595 + 254ms [analytics] test_segmentation (a_a: true, consent_decline: standard, ad_load_timing: standard, core_package_ui: modern, b_b: standard)
flutter: INFO 14:06:51.637 + 41ms [migration] migration 14 was already handled
flutter: INFO 14:06:51.864 + 227ms [rewards] Reward next update: null
flutter: INFO 14:06:51.982 + 117ms [core] Loading bundled puzzles...
flutter: INFO 14:06:52.151 + 168ms [daily] remaining dates (normal): [2023-10-01, 2023-10-02, 2023-10-03, 2023-10-04, 2023-10-05, 2023-10-06, 2023-10-07, 2023-10-08, 2023-10-09, 2023-10-10, 2023-10-11, 2023-10-12, 20
@blaugold
blaugold / interned_bytes.dart
Last active October 19, 2023 08:57
interned_bytes.dart
import 'dart:convert';
import 'dart:typed_data';
import 'package:collection/collection.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
@immutable
class InternedBytes {
static final _internedInstances = <WeakReference<InternedBytes>>[];
extension WaitFailFast2<A, B> on (Future<A>, Future<B>) {
Future<(A, B)> get waitFailFast async {
final results = await Future.wait([$1, $2]);
return (results[0] as A, results[1] as B);
}
}
extension WaitFailFast3<A, B, C> on (Future<A>, Future<B>, Future<C>) {
Future<(A, B, C)> get waitFailFast async {
final results = await Future.wait([$1, $2, $3]);

Nutze ToStringHelper

Anstatt toString() zu überschreiben, benutze ToStringHelper:

class Person with ToStringHelper {
  Person(this.name, this.age);

  final String name;
 final int age;