-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Starport Template pre-release fixes (#94)
- Loading branch information
1 parent
ce7ca3f
commit d9580f1
Showing
16 changed files
with
415 additions
and
220 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
starport_template/lib/entities/import_wallet_form_data.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,11 @@ | ||
class ImportWalletFormData { | ||
final String mnemonic; | ||
final String name; | ||
final String password; | ||
|
||
const ImportWalletFormData({ | ||
required this.mnemonic, | ||
required this.name, | ||
required this.password, | ||
}); | ||
} |
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,73 @@ | ||
import 'package:cosmos_ui_components/components/template/cosmos_password_field.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:starport_template/entities/import_wallet_form_data.dart'; | ||
|
||
class AddWalletBottomSheet extends StatefulWidget { | ||
final void Function(ImportWalletFormData) importClicked; | ||
|
||
const AddWalletBottomSheet({ | ||
Key? key, | ||
required this.importClicked, | ||
}) : super(key: key); | ||
|
||
@override | ||
_AddWalletBottomSheetState createState() => _AddWalletBottomSheetState(); | ||
} | ||
|
||
class _AddWalletBottomSheetState extends State<AddWalletBottomSheet> { | ||
String _mnemonic = ""; | ||
String _alias = ""; | ||
String _password = ""; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return SafeArea( | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
ListTile( | ||
title: TextFormField( | ||
decoration: const InputDecoration( | ||
labelText: "Enter mnemonic", | ||
border: OutlineInputBorder(), | ||
), | ||
onChanged: (value) => _mnemonic = value, | ||
), | ||
), | ||
ListTile( | ||
title: TextFormField( | ||
decoration: const InputDecoration( | ||
labelText: "Enter alias", | ||
border: OutlineInputBorder(), | ||
), | ||
onChanged: (value) => _alias = value, | ||
), | ||
), | ||
ListTile( | ||
title: CosmosPasswordField( | ||
onPasswordUpdated: (value) => _password = value, | ||
), | ||
), | ||
ElevatedButton( | ||
onPressed: () => _importClicked(context), | ||
style: ElevatedButton.styleFrom( | ||
shape: const StadiumBorder(), | ||
), | ||
child: const Text("Import wallet"), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
void _importClicked(BuildContext context) { | ||
Navigator.of(context).pop(); | ||
widget.importClicked( | ||
ImportWalletFormData( | ||
mnemonic: _mnemonic, | ||
name: _alias, | ||
password: _password, | ||
), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.