Created
March 25, 2021 04:15
-
-
Save jtmuller5/5c7732c638fd9c24b469cc793aa79893 to your computer and use it in GitHub Desktop.
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
Future<void> incrementCounter(String key) async { | |
AtKey atKey = AtKey(); | |
atKey.key = key; | |
/// Share with the other sign | |
if(shareWith) { | |
atKey.sharedWith = AtConstants().atMap[atProtocolService.currentAtSign]; | |
} | |
counter++; | |
await atProtocolService.atClientImpl.put(atKey, counter.toString()); | |
if (key == 'one') { | |
/// This line enables this @sign to notify another @sign | |
await atProtocolService.atClientImpl.notify(atKey, counter.toString(), OperationEnum.update); | |
one = counter.toString(); | |
} else if (key == 'two') { | |
two = counter.toString(); | |
} else if (key == 'three') { | |
three = counter.toString(); | |
} | |
notifyListeners(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment