@@ -49,8 +49,7 @@ class TaskView extends ChangeNotifier with LocationBase {
4949 String ? id,
5050 DateTime ? lastAlarmCheck,
5151 List <LocationAlarmServiceBase >? alarms,
52- })
53- : _encryptionPassword = encryptionPassword,
52+ }) : _encryptionPassword = encryptionPassword,
5453 alarms = alarms ?? [],
5554 lastAlarmCheck = lastAlarmCheck ?? DateTime .now (),
5655 id = id ?? const Uuid ().v4 ();
@@ -62,7 +61,7 @@ class TaskView extends ChangeNotifier with LocationBase {
6261 final fragment = uri.fragment;
6362
6463 final rawParameters =
65- const Utf8Decoder ().convert (base64Url.decode (fragment));
64+ const Utf8Decoder ().convert (base64Url.decode (fragment));
6665 final parameters = jsonDecode (rawParameters);
6766
6867 return ViewServiceLinkParameters (
@@ -76,10 +75,9 @@ class TaskView extends ChangeNotifier with LocationBase {
7675 );
7776 }
7877
79- factory TaskView .fromJSON (final Map <String , dynamic > json) =>
80- TaskView (
78+ factory TaskView .fromJSON (final Map <String , dynamic > json) => TaskView (
8179 encryptionPassword:
82- SecretKey (List <int >.from (json["encryptionPassword" ])),
80+ SecretKey (List <int >.from (json["encryptionPassword" ])),
8381 nostrPublicKey: json["nostrPublicKey" ],
8482 relays: List <String >.from (json["relays" ]),
8583 name: json["name" ] ?? "Unnamed Task" ,
@@ -92,6 +90,7 @@ class TaskView extends ChangeNotifier with LocationBase {
9290
9391 switch (identifier) {
9492 case LocationAlarmType .geo:
93+ case LocationAlarmType .radiusBasedRegion:
9594 return GeoLocationAlarm .fromJSON (alarm);
9695 case LocationAlarmType .proximity:
9796 return ProximityLocationAlarm .fromJSON (alarm);
@@ -109,8 +108,10 @@ class TaskView extends ChangeNotifier with LocationBase {
109108 : Colors .primaries[Random ().nextInt (Colors .primaries.length)],
110109 );
111110
112- static Future <TaskView > fetchFromNostr (final AppLocalizations l10n,
113- final ViewServiceLinkParameters parameters,) async {
111+ static Future <TaskView > fetchFromNostr (
112+ final AppLocalizations l10n,
113+ final ViewServiceLinkParameters parameters,
114+ ) async {
114115 final completer = Completer <TaskView >();
115116
116117 final request = Request (generate64RandomHexChars (), [
@@ -152,7 +153,7 @@ class TaskView extends ChangeNotifier with LocationBase {
152153 relays: List <String >.from (data['relays' ]),
153154 name: l10n.longFormattedDate (DateTime .now ()),
154155 color:
155- Colors .primaries[Random ().nextInt (Colors .primaries.length)],
156+ Colors .primaries[Random ().nextInt (Colors .primaries.length)],
156157 ),
157158 );
158159 } catch (error) {
@@ -199,7 +200,8 @@ class TaskView extends ChangeNotifier with LocationBase {
199200 };
200201 }
201202
202- Future <String ?> validate (final AppLocalizations l10n, {
203+ Future <String ?> validate (
204+ final AppLocalizations l10n, {
203205 required final TaskService taskService,
204206 required final ViewService viewService,
205207 }) async {
@@ -208,14 +210,14 @@ class TaskView extends ChangeNotifier with LocationBase {
208210 }
209211
210212 final sameTask = taskService.tasks.firstWhereOrNull (
211- (element) => element.nostrPublicKey == nostrPublicKey);
213+ (element) => element.nostrPublicKey == nostrPublicKey);
212214
213215 if (sameTask != null ) {
214216 return l10n.taskImport_error_sameTask (sameTask.name);
215217 }
216218
217219 final sameView = viewService.views.firstWhereOrNull (
218- (element) => element.nostrPublicKey == nostrPublicKey);
220+ (element) => element.nostrPublicKey == nostrPublicKey);
219221
220222 if (sameView != null ) {
221223 return l10n.taskImport_error_sameView (sameView.name);
0 commit comments