forked from axiom-team/gecko
Replace button by floatingActionButton; show 20 last transcations; Use flutter way for version controle
This commit is contained in:
parent
fa3940201e
commit
1c26298a16
|
@ -80,7 +80,7 @@ Future getBalance(String pubkey) async {
|
||||||
// Get history
|
// Get history
|
||||||
Future getHistory(String pubkey) async {
|
Future getHistory(String pubkey) async {
|
||||||
print(pubkey);
|
print(pubkey);
|
||||||
var number = 3;
|
var number = 20;
|
||||||
var query = """{
|
var query = """{
|
||||||
txsHistoryBc(
|
txsHistoryBc(
|
||||||
pubkeyOrScript: "$pubkey"
|
pubkeyOrScript: "$pubkey"
|
||||||
|
|
245
lib/main.dart
245
lib/main.dart
|
@ -42,141 +42,120 @@ class _MyAppState extends State<MyApp> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
backgroundColor: Colors.grey[300],
|
backgroundColor: Colors.grey[300],
|
||||||
body: Builder(
|
body: Builder(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return ListView(
|
return ListView(
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
color: Colors.white,
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
SizedBox(height: 20),
|
|
||||||
TextField(
|
|
||||||
// enabled: false,
|
|
||||||
onChanged: (text) {
|
|
||||||
print("Clé tappé: $text");
|
|
||||||
isPubkey(text);
|
|
||||||
},
|
|
||||||
controller: this._outputPubkey,
|
|
||||||
maxLines: 1,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText:
|
|
||||||
'Tappez/Collez une clé publique, ou scannez',
|
|
||||||
hintStyle: TextStyle(fontSize: 15),
|
|
||||||
contentPadding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 7, vertical: 15),
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
errorBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15.0,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.bold)),
|
|
||||||
TextField(
|
|
||||||
// Affichage balance
|
|
||||||
enabled: false,
|
|
||||||
controller: this._outputBalance,
|
|
||||||
maxLines: 1,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '',
|
|
||||||
hintStyle: TextStyle(fontSize: 15),
|
|
||||||
contentPadding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 7, vertical: 15),
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
errorBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
),
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 30.0, color: Colors.black)),
|
|
||||||
TextField(
|
|
||||||
// Affichage history
|
|
||||||
enabled: false,
|
|
||||||
controller: this._outputHistory,
|
|
||||||
maxLines: null,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
prefixIcon: Icon(Icons.wrap_text),
|
|
||||||
hintText: '',
|
|
||||||
hintStyle: TextStyle(fontSize: 15),
|
|
||||||
contentPadding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 7, vertical: 15),
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
errorBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 13.0,
|
|
||||||
height: 1.5,
|
|
||||||
color: Colors.black)),
|
|
||||||
SizedBox(height: 20),
|
|
||||||
this._buttonGroup(),
|
|
||||||
SizedBox(height: 70),
|
|
||||||
// Expanded(
|
|
||||||
// child: ListView.builder(
|
|
||||||
// padding: const EdgeInsets.all(8),
|
|
||||||
// itemCount: names.length,
|
|
||||||
// itemBuilder: (BuildContext context, int index) {
|
|
||||||
// return Container(
|
|
||||||
// height: 50,
|
|
||||||
// margin: EdgeInsets.all(2),
|
|
||||||
// child: Center(
|
|
||||||
// child: Text(
|
|
||||||
// '${names[index]} (${msgCount[index]})',
|
|
||||||
// style: TextStyle(fontSize: 18),
|
|
||||||
// )),
|
|
||||||
// );
|
|
||||||
// }))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
// floatingActionButton: FloatingActionButton(
|
|
||||||
// onPressed: () => _scanBytes(),
|
|
||||||
// tooltip: 'Prennez une photo',
|
|
||||||
// child: const Icon(Icons.camera_alt),
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buttonGroup() {
|
|
||||||
return Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: SizedBox(
|
|
||||||
height: 120,
|
|
||||||
child: InkWell(
|
|
||||||
onTap: _scan,
|
|
||||||
child: Card(
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Container(
|
||||||
flex: 2,
|
color: Colors.white,
|
||||||
child: Image.asset('images/scanner.png'),
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(height: 20),
|
||||||
|
TextField(
|
||||||
|
// enabled: false,
|
||||||
|
onChanged: (text) {
|
||||||
|
print("Clé tappé: $text");
|
||||||
|
isPubkey(text);
|
||||||
|
},
|
||||||
|
controller: this._outputPubkey,
|
||||||
|
maxLines: 1,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText:
|
||||||
|
'Tappez/Collez une clé publique, ou scannez',
|
||||||
|
hintStyle: TextStyle(fontSize: 15),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 7, vertical: 15),
|
||||||
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15.0,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold)),
|
||||||
|
TextField(
|
||||||
|
// Affichage balance
|
||||||
|
enabled: false,
|
||||||
|
controller: this._outputBalance,
|
||||||
|
maxLines: 1,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '',
|
||||||
|
hintStyle: TextStyle(fontSize: 15),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 7, vertical: 15),
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 30.0, color: Colors.black)),
|
||||||
|
TextField(
|
||||||
|
// Affichage history
|
||||||
|
enabled: false,
|
||||||
|
controller: this._outputHistory,
|
||||||
|
maxLines: null,
|
||||||
|
keyboardType: TextInputType.multiline,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: Icon(Icons.wrap_text),
|
||||||
|
hintText: '',
|
||||||
|
hintStyle: TextStyle(fontSize: 15),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 7, vertical: 15),
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
errorBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13.0,
|
||||||
|
height: 1.5,
|
||||||
|
color: Colors.black)),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
SizedBox(height: 70),
|
||||||
|
// Expanded(
|
||||||
|
// child: ListView.builder(
|
||||||
|
// padding: const EdgeInsets.all(8),
|
||||||
|
// itemCount: names.length,
|
||||||
|
// itemBuilder: (BuildContext context, int index) {
|
||||||
|
// return Container(
|
||||||
|
// height: 50,
|
||||||
|
// margin: EdgeInsets.all(2),
|
||||||
|
// child: Center(
|
||||||
|
// child: Text(
|
||||||
|
// '${names[index]} (${msgCount[index]})',
|
||||||
|
// style: TextStyle(fontSize: 18),
|
||||||
|
// )),
|
||||||
|
// );
|
||||||
|
// }))
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Divider(height: 20),
|
|
||||||
Expanded(flex: 1, child: Text("Scanner")),
|
|
||||||
],
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
floatingActionButton: Container(
|
||||||
|
height: 80.0,
|
||||||
|
width: 80.0,
|
||||||
|
child: FittedBox(
|
||||||
|
child: FloatingActionButton(
|
||||||
|
onPressed: () => _scan(),
|
||||||
|
// label: Text('Scanner'),
|
||||||
|
child: Container(
|
||||||
|
height: 40.0,
|
||||||
|
width: 40.0,
|
||||||
|
child: Image.asset('images/scanner.png')),
|
||||||
|
backgroundColor: Color.fromARGB(500, 204, 255, 255),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)));
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future checkNode() async {
|
Future checkNode() async {
|
||||||
|
@ -188,8 +167,10 @@ class _MyAppState extends State<MyApp> {
|
||||||
Future _scan() async {
|
Future _scan() async {
|
||||||
await Permission.camera.request();
|
await Permission.camera.request();
|
||||||
String barcode = await scanner.scan();
|
String barcode = await scanner.scan();
|
||||||
this._outputPubkey.text = "";
|
// this._outputPubkey.text = "";
|
||||||
isPubkey(barcode);
|
if (barcode != null) {
|
||||||
|
isPubkey(barcode);
|
||||||
|
}
|
||||||
return barcode;
|
return barcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.0.0+1
|
version: 0.0.0+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
[[ -z $1 ]] && echo "Please choose a version." && exit 1
|
# [[ -z $1 ]] && echo "Please choose a version." && exit 1
|
||||||
|
|
||||||
flutter build apk --split-per-abi
|
fVersion=$(grep "version: " pubspec.yaml | awk '{ print $2 }')
|
||||||
|
|
||||||
APPNAME="gecko"
|
APPNAME="gecko"
|
||||||
VERSION="$1"
|
VERSION=$(awk -F '+' '{ print $1 }' <<<$fVersion)
|
||||||
|
BUILD=$(awk -F '+' '{ print $2 }' <<<$fVersion)
|
||||||
ori_app="app.apk"
|
ori_app="app.apk"
|
||||||
|
|
||||||
|
echo "Nom du build final: ${APPNAME}-${VERSION}+${BUILD}.apk"
|
||||||
|
|
||||||
|
flutter build apk --split-per-abi --build-name $VERSION --build-number $BUILD
|
||||||
|
|
||||||
if [[ -d $HOME/Téléchargements ]]; then
|
if [[ -d $HOME/Téléchargements ]]; then
|
||||||
DL="$HOME/Téléchargements"
|
DL="$HOME/Téléchargements"
|
||||||
elif [[ -d $HOME/Downloads ]]; then
|
elif [[ -d $HOME/Downloads ]]; then
|
||||||
|
@ -16,7 +21,7 @@ else
|
||||||
DL="/tmp"
|
DL="/tmp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
appPath="$DL/${APPNAME}-${VERSION}.apk"
|
appPath="$DL/${APPNAME}-${VERSION}+${BUILD}.apk"
|
||||||
mv build/app/outputs/flutter-apk/$ori_app "$appPath" && echo "$appPath" || exit 1
|
mv build/app/outputs/flutter-apk/$ori_app "$appPath" && echo "$appPath" || exit 1
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue