-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
159 additions
and
26 deletions.
There are no files selected for viewing
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
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
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,25 @@ | ||
|
||
import 'package:thor_devkit_dart/crypto/address.dart'; | ||
|
||
class InvalidAddressException implements Exception { | ||
late String _message; | ||
|
||
InvalidAddressException([String message = 'Invalid InvalidAddress']) { | ||
_message = message; | ||
} | ||
|
||
|
||
@override | ||
String toString() { | ||
return _message; | ||
} | ||
|
||
} | ||
|
||
void validateAddress(String address) { | ||
if (address == null) { | ||
throw InvalidAddressException(); | ||
} else if (!Address.isAddress(address)) { | ||
throw InvalidAddressException("Invalid Address!"); | ||
} | ||
} |
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,29 @@ | ||
|
||
|
||
import 'package:flutter/material.dart'; | ||
|
||
oneButtonPopup(BuildContext context, Text title, Text content) { | ||
// set up the buttons | ||
Widget cancelButton = TextButton( | ||
child: Text("OK"), | ||
onPressed: () { | ||
Navigator.pop(context); | ||
}, | ||
); | ||
// set up the AlertDialog | ||
AlertDialog alert = AlertDialog( | ||
title: title, | ||
content: content, | ||
actions: [ | ||
cancelButton, | ||
], | ||
); | ||
// show the dialog | ||
showDialog( | ||
barrierDismissible: false, | ||
context: context, | ||
builder: (BuildContext context) { | ||
return alert; | ||
}, | ||
); | ||
} |
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