Skip to content

Commit 09a463e

Browse files
author
Yong Bakos
committed
Continuum: Generate distinct Uri objects.
Uris need to, ultimately, be unique, but Continuum creates default Uri objects which are value-equivalent in Dart. As an initial solution for text information, use the information to create a unique Uri. References #3.
1 parent 6b84a83 commit 09a463e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/continuum.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:convert';
12
import 'thing.dart';
23

34
/// The whole set of all information.
@@ -19,7 +20,10 @@ class Continuum {
1920

2021
/// Transform `information` into a [Thing] with a URI.
2122
Thing store(dynamic information) {
22-
final thing = Thing(information: information, uri: Uri());
23+
final thing = Thing(
24+
information: information,
25+
uri: Uri.dataFromBytes(utf8.encode(information))
26+
);
2327
things[thing.uri] = thing;
2428
return thing;
2529
}

0 commit comments

Comments
 (0)