Skip to content

Commit

Permalink
use static expando state to prevent breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Skycoder42 authored and daegalus committed Oct 5, 2021
1 parent e3933bc commit 6c160f1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/uuid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@ class Uuid {
});

final options;
final _state = {
'seedBytes': null,
'node': null,
'clockSeq': null,
'mSecs': 0,
'nSecs': 0,
'hasInitV1': false,
'hasInitV4': false
};

Uuid({Map<String, dynamic>? this.options});

static final _stateExpando = Expando<Map<String, dynamic>>();
Map<String, dynamic> get _state => _stateExpando[this] ??= {
'seedBytes': null,
'node': null,
'clockSeq': null,
'mSecs': 0,
'nSecs': 0,
'hasInitV1': false,
'hasInitV4': false
};

const Uuid({Map<String, dynamic>? this.options});

/// Validates the provided [uuid] to make sure it has all the necessary
/// components and formatting and returns a [bool]
Expand Down

0 comments on commit 6c160f1

Please sign in to comment.