Add icon; Add them colors; Add new page for validate wallet storage; Improve paddings
|
@ -12,7 +12,7 @@
|
|||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="gecko">
|
||||
<!-- android:icon="@mipmap/launcher_icon"> -->
|
||||
<!-- android:icon="@mipmap/ic_launcher"> -->
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
|
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 307 KiB After Width: | Height: | Size: 242 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 19 KiB |
|
@ -38,8 +38,17 @@ class Gecko extends StatelessWidget {
|
|||
);
|
||||
return MaterialApp(
|
||||
title: 'Ğecko',
|
||||
theme:
|
||||
ThemeData(primaryColor: Colors.blue[50], accentColor: Colors.black),
|
||||
theme: ThemeData(
|
||||
primaryColor: Color(0xffD28928),
|
||||
accentColor: Color(0xffFFD68E),
|
||||
textTheme: TextTheme(
|
||||
bodyText1: TextStyle(),
|
||||
bodyText2: TextStyle(),
|
||||
).apply(
|
||||
bodyColor: Color(0xff855F2D),
|
||||
// displayColor: Colors.blue,
|
||||
),
|
||||
),
|
||||
home: GraphQLProvider(
|
||||
client: _client,
|
||||
child: HomeScreen(),
|
||||
|
|
|
@ -17,18 +17,183 @@ class _GenerateWalletState extends State<GenerateWalletScreen> {
|
|||
DubpRust.setup();
|
||||
}
|
||||
|
||||
TextEditingController _mnemonic = new TextEditingController();
|
||||
TextEditingController _mnemonicController = new TextEditingController();
|
||||
TextEditingController _pubkey = new TextEditingController();
|
||||
TextEditingController _pin = new TextEditingController();
|
||||
String generatedMnemonic;
|
||||
NewWallet actualWallet;
|
||||
final formKey = GlobalKey<FormState>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'Clé publique:',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: this._mnemonic,
|
||||
controller: this._pubkey,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'Phrase secrète:',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: this._mnemonicController,
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.all(15.0),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400)),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'Code PIN:',
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: this._pin,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(),
|
||||
style: TextStyle(
|
||||
fontSize: 30.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 12),
|
||||
new RaisedButton(
|
||||
color: Color(0xffFFD68E),
|
||||
onPressed: () => generateMnemonic(),
|
||||
child: Text('Générer un wallet', style: TextStyle(fontSize: 20))),
|
||||
SizedBox(height: 30),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: new RaisedButton(
|
||||
color: Color(0xffFFD68E),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return ValidStoreWalletScreen(
|
||||
generatedMnemonic: this.generatedMnemonic,
|
||||
generatedWallet:
|
||||
this.actualWallet); //, this.actualWallet);
|
||||
}),
|
||||
).then((value) => setState(() {
|
||||
if (value) {
|
||||
_pin.clear();
|
||||
_mnemonicController.clear();
|
||||
_pubkey.clear();
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Text('Enregistrer ce wallet',
|
||||
style: TextStyle(fontSize: 20))))),
|
||||
SizedBox(height: 15)
|
||||
]));
|
||||
}
|
||||
|
||||
Future generateMnemonic() async {
|
||||
try {
|
||||
this.generatedMnemonic =
|
||||
await DubpRust.genMnemonic(language: Language.french);
|
||||
} catch (e, stack) {
|
||||
print(e);
|
||||
if (kReleaseMode) {
|
||||
await sentry.Sentry.captureException(
|
||||
e,
|
||||
stackTrace: stack,
|
||||
);
|
||||
}
|
||||
}
|
||||
this.actualWallet = await generateWallet(this.generatedMnemonic);
|
||||
return this.generatedMnemonic;
|
||||
}
|
||||
|
||||
Future generateWallet(generatedMnemonic) async {
|
||||
try {
|
||||
this.actualWallet = await DubpRust.genWalletFromMnemonic(
|
||||
language: Language.french, mnemonic: generatedMnemonic);
|
||||
} catch (e, stack) {
|
||||
print(e);
|
||||
if (kReleaseMode) {
|
||||
await sentry.Sentry.captureException(
|
||||
e,
|
||||
stackTrace: stack,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
this._mnemonicController.text = generatedMnemonic;
|
||||
this._pubkey.text = actualWallet.publicKey;
|
||||
this._pin.text = actualWallet.pin;
|
||||
});
|
||||
|
||||
return actualWallet;
|
||||
}
|
||||
}
|
||||
|
||||
class ValidStoreWalletScreen extends StatefulWidget {
|
||||
final String generatedMnemonic;
|
||||
final NewWallet generatedWallet;
|
||||
|
||||
ValidStoreWalletScreen(
|
||||
{Key validationKey,
|
||||
@required this.generatedMnemonic,
|
||||
@required this.generatedWallet})
|
||||
: super(key: validationKey);
|
||||
|
||||
@override
|
||||
_ValidStoreWalletScreen createState() => _ValidStoreWalletScreen();
|
||||
}
|
||||
|
||||
class _ValidStoreWalletScreen extends State<ValidStoreWalletScreen> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
// DubpRust.setup();
|
||||
this._mnemonicController.text = widget.generatedMnemonic;
|
||||
this._pubkey.text = widget.generatedWallet.publicKey;
|
||||
}
|
||||
|
||||
TextEditingController _mnemonicController = new TextEditingController();
|
||||
TextEditingController _pubkey = new TextEditingController();
|
||||
TextEditingController _pin = new TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
child: Column(children: <Widget>[
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: this._mnemonicController,
|
||||
maxLines: 2,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(),
|
||||
|
@ -46,64 +211,21 @@ class _GenerateWalletState extends State<GenerateWalletScreen> {
|
|||
fontSize: 14.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: this._pin,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(),
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 12),
|
||||
new RaisedButton(
|
||||
onPressed: () => generateMnemonic(),
|
||||
child: Text('Générer un wallet', style: TextStyle(fontSize: 20))),
|
||||
SizedBox(height: 20)
|
||||
]));
|
||||
}
|
||||
|
||||
Future generateMnemonic() async {
|
||||
String generatedMnemonic;
|
||||
try {
|
||||
generatedMnemonic = await DubpRust.genMnemonic(language: Language.french);
|
||||
} catch (e, stack) {
|
||||
print(e);
|
||||
if (kReleaseMode) {
|
||||
await sentry.Sentry.captureException(
|
||||
e,
|
||||
stackTrace: stack,
|
||||
color: Color(0xffFFD68E),
|
||||
onPressed: () => storeWallet(widget.generatedWallet),
|
||||
child: Text('Confirmer', style: TextStyle(fontSize: 20))),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
generateWallet(generatedMnemonic);
|
||||
}
|
||||
|
||||
Future generateWallet(generatedMnemonic) async {
|
||||
Future storeWallet(actualWallet) async {
|
||||
final walletFile = await _localWallet;
|
||||
NewWallet newWallet;
|
||||
try {
|
||||
newWallet = await DubpRust.genWalletFromMnemonic(
|
||||
language: Language.french, mnemonic: generatedMnemonic);
|
||||
} catch (e, stack) {
|
||||
print(e);
|
||||
if (kReleaseMode) {
|
||||
await sentry.Sentry.captureException(
|
||||
e,
|
||||
stackTrace: stack,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
setState(() {
|
||||
this._mnemonic.text = generatedMnemonic;
|
||||
this._pubkey.text = newWallet.publicKey;
|
||||
this._pin.text = newWallet.pin;
|
||||
});
|
||||
|
||||
return walletFile.writeAsString('${newWallet.dewif}');
|
||||
walletFile.writeAsString('${widget.generatedWallet.dewif}');
|
||||
_pin.clear();
|
||||
Navigator.pop(context, true);
|
||||
FocusScope.of(context).unfocus();
|
||||
}
|
||||
|
||||
Future<String> get _localPath async {
|
||||
|
|
|
@ -64,6 +64,7 @@ class HistoryScreenState extends State<HistoryScreen> {
|
|||
print('Build this.pubkey : ' + this.pubkey);
|
||||
print('isBuilding: ' + isBuilding.toString());
|
||||
return Column(children: <Widget>[
|
||||
SizedBox(height: 8),
|
||||
TextField(
|
||||
// Entrée de la pubkey
|
||||
onChanged: (text) {
|
||||
|
@ -84,10 +85,7 @@ class HistoryScreenState extends State<HistoryScreen> {
|
|||
errorBorder: InputBorder.none,
|
||||
disabledBorder: InputBorder.none,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold)),
|
||||
historyQuery(),
|
||||
]);
|
||||
}
|
||||
|
@ -186,7 +184,7 @@ class HistoryScreenState extends State<HistoryScreen> {
|
|||
if (this.pubkey != '')
|
||||
Text(balance.toString() + ' Ğ1',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30.0, color: Colors.black)),
|
||||
style: TextStyle(fontSize: 30.0)),
|
||||
for (var repository in _transBC)
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.all(5.0),
|
||||
|
|
|
@ -31,9 +31,8 @@ class HomeScreenState extends State<HomeScreen> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
backgroundColor: Colors.grey[300],
|
||||
return Scaffold(
|
||||
backgroundColor: Color(0xffF9F9F1),
|
||||
body: SafeArea(
|
||||
child: IndexedStack(
|
||||
index: currentIndex,
|
||||
|
@ -62,12 +61,15 @@ class HomeScreenState extends State<HomeScreen> {
|
|||
height: 40.0,
|
||||
width: 40.0,
|
||||
child: Image.asset('images/scanner.png')),
|
||||
backgroundColor: Color.fromARGB(500, 204, 255, 255),
|
||||
backgroundColor: Color(
|
||||
0xffEFEFBF), //Color(0xffFFD68E), //Color.fromARGB(500, 204, 255, 255),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
fixedColor: Colors.black,
|
||||
backgroundColor: Color(0xffFFD68E),
|
||||
fixedColor: Color(0xff855F2D),
|
||||
unselectedItemColor: Color(0xffBD935C),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
onTap: onTabTapped,
|
||||
currentIndex: currentIndex,
|
||||
|
@ -86,6 +88,6 @@ class HomeScreenState extends State<HomeScreen> {
|
|||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,12 +30,13 @@ class _MyWalletState extends State<MyWalletsScreen> {
|
|||
bool hasError = false;
|
||||
String validPin = 'NO PIN';
|
||||
String currentText = "";
|
||||
var pinColor = Colors.grey[300];
|
||||
var pinColor = Color(0xffF9F9F1);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
SizedBox(height: 8),
|
||||
InkWell(
|
||||
child: TextField(
|
||||
enabled: false,
|
||||
|
@ -113,9 +114,9 @@ class _MyWalletState extends State<MyWalletsScreen> {
|
|||
}
|
||||
},
|
||||
onChanged: (value) {
|
||||
if (pinColor != Colors.grey[300]) {
|
||||
if (pinColor != Color(0xffF9F9F1)) {
|
||||
setState(() {
|
||||
pinColor = Colors.grey[300];
|
||||
pinColor = Color(0xffF9F9F1);
|
||||
});
|
||||
}
|
||||
print(value);
|
||||
|
|
|
@ -5,7 +5,7 @@ description: A new Flutter project.
|
|||
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
|
||||
version: 0.0.0+7
|
||||
version: 0.0.0+8
|
||||
|
||||
environment:
|
||||
sdk: ">=2.7.0 <3.0.0"
|
||||
|
@ -29,10 +29,10 @@ dependencies:
|
|||
|
||||
|
||||
flutter_icons:
|
||||
android: "launcher_icon"
|
||||
android: "ic_launcher"
|
||||
ios: true
|
||||
image_path: "assets/icon/gecko5b96.png"
|
||||
cupertino_icons: ^1.0.0
|
||||
image_path: "assets/icon/gecko5bduniter2.png"
|
||||
# cupertino_icons: ^1.0.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
|