mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
feat: Introduce QR Scanning to add new node (#1007)
* feat: Introduce QR Scanning to add new node * fix: Exception handing for scan qr and invalid qr value * fix: Exception handing for scan qr and invalid qr value
This commit is contained in:
@@ -66,6 +66,19 @@ class NodeCreateOrEditPage extends BasePage {
|
||||
@override
|
||||
String get title => editingNode != null ? S.current.edit_node : S.current.node_new;
|
||||
|
||||
@override
|
||||
Widget trailing(BuildContext context) => IconButton(
|
||||
onPressed: () async {
|
||||
await nodeCreateOrEditViewModel.scanQRCodeForNewNode();
|
||||
},
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
icon: Image.asset(
|
||||
'assets/images/qr_code_icon.png',
|
||||
),
|
||||
);
|
||||
|
||||
final NodeCreateOrEditViewModel nodeCreateOrEditViewModel;
|
||||
final Node? editingNode;
|
||||
final bool? isSelected;
|
||||
|
||||
@@ -44,6 +44,17 @@ class NodeForm extends StatelessWidget {
|
||||
}
|
||||
});
|
||||
}
|
||||
reaction((_) => nodeViewModel.address, (String address) {
|
||||
if (address != _addressController.text) {
|
||||
_addressController.text = address;
|
||||
}
|
||||
});
|
||||
|
||||
reaction((_) => nodeViewModel.port, (String port) {
|
||||
if (port != _portController.text) {
|
||||
_portController.text = port;
|
||||
}
|
||||
});
|
||||
|
||||
_addressController.addListener(() => nodeViewModel.address = _addressController.text);
|
||||
_portController.addListener(() => nodeViewModel.port = _portController.text);
|
||||
|
||||
Reference in New Issue
Block a user