-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add interface for new atSign management utilities
- Loading branch information
1 parent
5736dbf
commit 48c6d17
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
packages/dart/npt_flutter/lib/features/onboarding/util/atsign_manager.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
abstract class AtsignInformation { | ||
String get atSign; | ||
String get rootDomain; | ||
} | ||
|
||
// This will return a map which looks like: | ||
// | ||
// { | ||
// "@alice": AtsignInformation{ atSign: "@alice", rootDomain: "root.atsign.org" }, | ||
// "@bob": AtsignInformation{ atSign: "@alice", rootDomain: "vip.ve.atsign.zone" }, | ||
// } | ||
// | ||
// Note: AtsignInformation is a class, so usage will look like | ||
// | ||
// var atSign = "@alice"; | ||
// var atSignInfo = await getAtsignEntries(); | ||
// var rootDomain = atSignInfo[atSign].rootDomain; | ||
// | ||
// Now you have the rootDomain for the existing atSign and can use it to onboard | ||
// correctly | ||
|
||
Future<Map<String, AtsignInformation>> getAtsignEntries() { | ||
return Future.value({}); | ||
} | ||
|
||
// This class will allow you to store atSign information | ||
// you need to call this after onboarding a NEW atSign | ||
Future<bool> saveAtsignInformation(AtsignInformation info) { | ||
return Future.value(true); | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/dart/npt_flutter/lib/features/onboarding/util/pre_offboard.dart
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Hand this method the atSign you wish to offboard | ||
// Returns: a boolean, true = success, false = failed | ||
Future<bool> preSignout(String atSign) async { | ||
// We need to do the following before "signing out" | ||
// - Wipe all application state | ||
// - Remove the tray icon | ||
return true; | ||
} |