2021-02-02 20:33:09 +01:00
|
|
|
import 'dart:io';
|
2021-01-30 15:24:08 +01:00
|
|
|
import 'package:flutter/services.dart';
|
2021-02-02 20:33:09 +01:00
|
|
|
import 'package:gecko/globals.dart';
|
|
|
|
import 'package:gecko/models/cesiumPlus.dart';
|
2021-02-22 08:49:29 +01:00
|
|
|
import 'package:gecko/models/home.dart';
|
2021-01-30 15:24:08 +01:00
|
|
|
import 'package:gecko/models/queries.dart';
|
2021-01-23 16:38:03 +01:00
|
|
|
import 'package:gecko/models/history.dart';
|
2020-12-21 01:05:00 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2021-01-06 21:17:01 +01:00
|
|
|
import 'package:flutter/foundation.dart';
|
2021-03-29 22:12:38 +02:00
|
|
|
import 'package:gecko/screens/myWallets/unlockingWallet.dart';
|
2020-12-21 01:05:00 +01:00
|
|
|
import 'dart:ui';
|
2020-12-21 03:59:25 +01:00
|
|
|
import 'package:graphql_flutter/graphql_flutter.dart';
|
2021-01-24 08:53:03 +01:00
|
|
|
import 'package:provider/provider.dart';
|
2021-03-21 00:35:32 +01:00
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
2021-01-06 05:04:54 +01:00
|
|
|
|
2021-01-26 21:00:26 +01:00
|
|
|
// ignore: must_be_immutable
|
2021-01-23 16:38:03 +01:00
|
|
|
class HistoryScreen extends StatelessWidget with ChangeNotifier {
|
2021-01-26 21:00:26 +01:00
|
|
|
final TextEditingController _outputPubkey = TextEditingController();
|
|
|
|
ScrollController scrollController = ScrollController();
|
2021-01-06 05:04:54 +01:00
|
|
|
final nRepositories = 20;
|
2021-01-29 03:44:09 +01:00
|
|
|
// HistoryProvider _historyProvider;
|
2021-01-30 15:24:08 +01:00
|
|
|
final _formKey = GlobalKey<FormState>();
|
|
|
|
FocusNode _pubkeyFocus = FocusNode();
|
2021-02-02 20:33:09 +01:00
|
|
|
List cesiumData;
|
2021-02-17 00:15:08 +01:00
|
|
|
final double avatarsSize = 80;
|
2021-01-24 08:53:03 +01:00
|
|
|
|
|
|
|
FetchMore fetchMore;
|
|
|
|
FetchMoreOptions opts;
|
2021-03-21 00:35:32 +01:00
|
|
|
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
2021-01-06 05:04:54 +01:00
|
|
|
|
2020-12-21 01:05:00 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-02-27 20:29:35 +01:00
|
|
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
2021-01-29 02:20:15 +01:00
|
|
|
HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
2021-02-22 08:49:29 +01:00
|
|
|
HomeProvider _homeProvider = Provider.of<HomeProvider>(context);
|
2021-01-26 21:00:26 +01:00
|
|
|
this._outputPubkey.text = _historyProvider.pubkey;
|
2021-04-02 12:05:37 +02:00
|
|
|
log.i('Build pubkey : ' + _historyProvider.pubkey);
|
2021-02-22 08:49:29 +01:00
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {});
|
2021-02-06 08:31:14 +01:00
|
|
|
|
2021-01-10 07:49:29 +01:00
|
|
|
return Scaffold(
|
2021-03-21 00:35:32 +01:00
|
|
|
key: _scaffoldKey,
|
2021-02-22 08:49:29 +01:00
|
|
|
appBar: AppBar(
|
|
|
|
title: _homeProvider.appBarExplorer,
|
|
|
|
actions: [
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
child: IconButton(
|
|
|
|
icon: _homeProvider.searchIcon,
|
|
|
|
color: Colors.grey[850],
|
|
|
|
onPressed: () {
|
|
|
|
if (_homeProvider.searchIcon.icon == Icons.search) {
|
|
|
|
_homeProvider.searchIcon = Icon(
|
|
|
|
Icons.close,
|
|
|
|
color: Colors.grey[850],
|
|
|
|
);
|
|
|
|
_homeProvider.appBarExplorer = TextField(
|
|
|
|
autofocus: true,
|
|
|
|
controller: _homeProvider.searchQuery,
|
|
|
|
onChanged: (text) {
|
2021-04-02 12:05:37 +02:00
|
|
|
log.d("Clé tappé: $text");
|
2021-02-22 08:49:29 +01:00
|
|
|
final String searchResult =
|
|
|
|
_historyProvider.isPubkey(context, text);
|
|
|
|
if (searchResult != '') {
|
|
|
|
_homeProvider.currentIndex = 0;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.grey[850],
|
|
|
|
),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
prefixIcon:
|
|
|
|
Icon(Icons.search, color: Colors.grey[850]),
|
|
|
|
hintText: "Rechercher ...",
|
|
|
|
hintStyle: TextStyle(color: Colors.grey[850])),
|
|
|
|
);
|
|
|
|
_homeProvider.handleSearchStart();
|
|
|
|
} else {
|
|
|
|
_homeProvider.handleSearchEnd();
|
|
|
|
}
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
backgroundColor: Color(0xffFFD58D),
|
|
|
|
),
|
2021-01-10 07:49:29 +01:00
|
|
|
floatingActionButton: Container(
|
|
|
|
height: 80.0,
|
|
|
|
width: 80.0,
|
|
|
|
child: FittedBox(
|
|
|
|
child: FloatingActionButton(
|
|
|
|
heroTag: "buttonScan",
|
|
|
|
onPressed: () async {
|
2021-02-18 07:54:35 +01:00
|
|
|
await _historyProvider.scan(context);
|
2021-01-10 07:49:29 +01:00
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: 40.0,
|
|
|
|
width: 40.0,
|
2021-02-18 04:42:57 +01:00
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 3),
|
|
|
|
child: Image.asset('assets/qrcode-scan.png'))),
|
2021-01-10 07:49:29 +01:00
|
|
|
backgroundColor: Color(
|
|
|
|
0xffEFEFBF), //Color(0xffFFD68E), //Color.fromARGB(500, 204, 255, 255),
|
|
|
|
),
|
2021-01-01 21:47:43 +01:00
|
|
|
),
|
2021-01-10 07:49:29 +01:00
|
|
|
),
|
|
|
|
body: Column(children: <Widget>[
|
2021-02-17 00:15:08 +01:00
|
|
|
SizedBox(height: 0),
|
2021-02-06 08:31:14 +01:00
|
|
|
if (_historyProvider.pubkey != '')
|
|
|
|
historyQuery(context, _historyProvider),
|
2021-01-10 07:49:29 +01:00
|
|
|
]));
|
2021-01-01 21:47:43 +01:00
|
|
|
}
|
|
|
|
|
2021-02-17 00:15:08 +01:00
|
|
|
Widget historyQuery(context, HistoryProvider _historyProvider) {
|
2021-01-30 15:24:08 +01:00
|
|
|
_pubkeyFocus.unfocus();
|
2021-02-06 08:31:14 +01:00
|
|
|
// HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
2021-02-02 20:33:09 +01:00
|
|
|
CesiumPlusProvider _cesiumPlusProvider =
|
|
|
|
Provider.of<CesiumPlusProvider>(context);
|
2021-02-07 02:59:48 +01:00
|
|
|
bool _isFirstExec = true;
|
2021-01-01 21:47:43 +01:00
|
|
|
return Expanded(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
children: <Widget>[
|
|
|
|
Query(
|
|
|
|
options: QueryOptions(
|
|
|
|
document: gql(getHistory),
|
|
|
|
variables: <String, dynamic>{
|
2021-01-24 08:53:03 +01:00
|
|
|
'pubkey': _historyProvider.pubkey,
|
2021-01-01 21:47:43 +01:00
|
|
|
'number': nRepositories,
|
|
|
|
'cursor': null
|
|
|
|
},
|
|
|
|
),
|
2021-02-04 21:00:37 +01:00
|
|
|
builder: (QueryResult result, {fetchMore, refetch}) {
|
2021-01-01 21:47:43 +01:00
|
|
|
if (result.isLoading && result.data == null) {
|
|
|
|
return const Center(
|
|
|
|
child: CircularProgressIndicator(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result.hasException) {
|
2021-04-02 12:05:37 +02:00
|
|
|
log.e('Error GVA: ' + result.exception.toString());
|
2021-01-11 19:46:20 +01:00
|
|
|
return Column(children: <Widget>[
|
|
|
|
SizedBox(height: 50),
|
|
|
|
Text(
|
|
|
|
"Aucun noeud GVA valide n'a pu être trouvé.\nVeuillez réessayer ultérieurement.",
|
|
|
|
style: TextStyle(fontSize: 17.0),
|
|
|
|
)
|
|
|
|
]);
|
2021-01-01 21:47:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (result.data == null && result.exception.toString() == null) {
|
2021-01-11 19:46:20 +01:00
|
|
|
return const Text('Aucune donnée à afficher.');
|
2021-01-01 21:47:43 +01:00
|
|
|
}
|
|
|
|
|
2021-03-21 00:35:32 +01:00
|
|
|
num balance;
|
|
|
|
|
|
|
|
if (result.data['balance'] == null) {
|
|
|
|
balance = 0.0;
|
|
|
|
} else {
|
|
|
|
balance = _historyProvider
|
|
|
|
.removeDecimalZero(result.data['balance']['amount'] / 100);
|
|
|
|
}
|
2021-01-08 02:10:23 +01:00
|
|
|
|
2021-02-03 18:45:08 +01:00
|
|
|
opts = _historyProvider.checkQueryResult(
|
|
|
|
result, opts, _outputPubkey.text);
|
2021-01-30 15:24:08 +01:00
|
|
|
|
2021-02-07 02:59:48 +01:00
|
|
|
// _historyProvider.transBC = null;
|
|
|
|
|
2021-01-08 02:10:23 +01:00
|
|
|
// Build history list
|
2021-01-24 08:53:03 +01:00
|
|
|
return NotificationListener(
|
2021-02-22 19:44:58 +01:00
|
|
|
child: Builder(
|
|
|
|
builder: (context) => Expanded(
|
|
|
|
child: ListView(
|
|
|
|
controller: scrollController,
|
|
|
|
children: <Widget>[
|
|
|
|
SizedBox(height: 20),
|
|
|
|
if (_historyProvider.pubkey != '')
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
if (_isFirstExec)
|
|
|
|
Container(
|
|
|
|
padding: const EdgeInsets.fromLTRB(
|
2021-03-21 00:35:32 +01:00
|
|
|
20, 0, 30, 0),
|
2021-02-22 19:44:58 +01:00
|
|
|
child: FutureBuilder(
|
|
|
|
future:
|
|
|
|
_cesiumPlusProvider.getAvatar(
|
|
|
|
_historyProvider.pubkey),
|
|
|
|
initialData: [
|
|
|
|
File(appPath.path +
|
|
|
|
'/default_avatar.png')
|
|
|
|
],
|
|
|
|
builder: (BuildContext context,
|
|
|
|
AsyncSnapshot<List> _avatar) {
|
|
|
|
cesiumData = _avatar.data;
|
|
|
|
// _cesiumPlusProvider.isComplete = true;
|
|
|
|
if (_avatar.connectionState !=
|
|
|
|
ConnectionState.done) {
|
|
|
|
return Image.file(
|
|
|
|
File(appPath.path +
|
|
|
|
'/default_avatar.png'),
|
|
|
|
height: avatarsSize);
|
|
|
|
}
|
|
|
|
if (_avatar.hasError) {
|
|
|
|
return Image.file(
|
|
|
|
File(appPath.path +
|
|
|
|
'/default_avatar.png'),
|
|
|
|
height: avatarsSize);
|
|
|
|
}
|
|
|
|
if (_avatar.hasData) {
|
|
|
|
return SingleChildScrollView(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.all(0.0),
|
|
|
|
child: Image.file(
|
|
|
|
_avatar.data[0],
|
|
|
|
height: avatarsSize));
|
|
|
|
}
|
|
|
|
return Image.file(
|
|
|
|
File(appPath.path +
|
|
|
|
'/default_avatar.png'),
|
|
|
|
height: avatarsSize);
|
|
|
|
})),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
Clipboard.setData(ClipboardData(
|
|
|
|
text: _historyProvider.pubkey));
|
|
|
|
_historyProvider.snackCopyKey(context);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
_historyProvider.getShortPubkey(
|
|
|
|
_historyProvider.pubkey),
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 22,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
fontFamily: 'Monospace')),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
padding: const EdgeInsets.fromLTRB(
|
|
|
|
30, 0, 5, 0), // .only(right: 15),
|
2021-03-21 00:35:32 +01:00
|
|
|
child: Card(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
SvgPicture.string(
|
|
|
|
_historyProvider
|
|
|
|
.generateIdenticon(
|
|
|
|
_historyProvider
|
|
|
|
.pubkey),
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
height: 64,
|
|
|
|
width: 64,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
2021-02-22 19:44:58 +01:00
|
|
|
SizedBox(width: 0)
|
|
|
|
]),
|
|
|
|
if (_isFirstExec)
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceAround,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
padding: const EdgeInsets.fromLTRB(
|
|
|
|
0, 0, 0, 0),
|
|
|
|
// padding: const EdgeInsets.,
|
|
|
|
child: FutureBuilder(
|
|
|
|
future: _cesiumPlusProvider.getName(
|
|
|
|
_historyProvider.pubkey),
|
|
|
|
initialData: '...',
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
return Text(
|
2021-03-19 06:33:48 +01:00
|
|
|
snapshot.data != null
|
2021-02-22 19:44:58 +01:00
|
|
|
? snapshot.data
|
|
|
|
: '-',
|
|
|
|
style:
|
|
|
|
TextStyle(fontSize: 20));
|
|
|
|
}))
|
|
|
|
]),
|
|
|
|
SizedBox(height: 18),
|
2021-02-07 02:59:48 +01:00
|
|
|
if (_isFirstExec)
|
|
|
|
Container(
|
2021-02-17 00:15:08 +01:00
|
|
|
padding:
|
2021-02-22 19:44:58 +01:00
|
|
|
const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
|
|
|
child: Text(balance.toString() + ' Ğ1',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(fontSize: 18.0))),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
ElevatedButton(
|
|
|
|
style: ElevatedButton.styleFrom(
|
|
|
|
elevation: 1,
|
|
|
|
primary: Colors.grey[50], // background
|
|
|
|
onPrimary: Colors.black, // foreground
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
_historyProvider.switchProfileView();
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
_historyProvider.historySwitchButtun,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 15,
|
|
|
|
color: Color(0xffD28928)))),
|
|
|
|
// const Divider(
|
|
|
|
// color: Colors.grey,
|
|
|
|
// height: 5,
|
|
|
|
// thickness: 0.5,
|
|
|
|
// indent: 0,
|
|
|
|
// endIndent: 0,
|
|
|
|
// ),
|
|
|
|
_historyProvider.isHistoryScreen
|
|
|
|
? historyView(context, result)
|
2021-03-29 22:12:38 +02:00
|
|
|
: payView(context, _historyProvider),
|
2021-02-22 19:44:58 +01:00
|
|
|
],
|
|
|
|
))),
|
2021-01-24 08:53:03 +01:00
|
|
|
onNotification: (t) {
|
|
|
|
if (t is ScrollEndNotification &&
|
|
|
|
scrollController.position.pixels >=
|
2021-01-29 14:21:57 +01:00
|
|
|
scrollController.position.maxScrollExtent * 0.7) {
|
2021-01-24 08:53:03 +01:00
|
|
|
fetchMore(opts);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
});
|
2021-01-01 21:47:43 +01:00
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
2020-12-21 01:05:00 +01:00
|
|
|
|
2021-03-29 22:12:38 +02:00
|
|
|
Widget payView(context, HistoryProvider _historyProvider) {
|
2021-02-17 00:15:08 +01:00
|
|
|
return Stack(
|
2021-03-08 11:11:01 +01:00
|
|
|
clipBehavior: Clip.hardEdge,
|
2021-02-17 00:15:08 +01:00
|
|
|
children: <Widget>[
|
|
|
|
Form(
|
|
|
|
key: _formKey,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: <Widget>[
|
|
|
|
SizedBox(height: 20),
|
2021-04-03 02:39:09 +02:00
|
|
|
Text('Commentaire:', style: TextStyle(fontSize: 20.0)),
|
2021-02-17 00:15:08 +01:00
|
|
|
Padding(
|
2021-01-30 15:24:08 +01:00
|
|
|
padding: EdgeInsets.all(8.0),
|
2021-02-17 00:15:08 +01:00
|
|
|
child: TextField(
|
2021-04-03 00:07:03 +02:00
|
|
|
controller: _historyProvider.payComment,
|
2021-02-17 00:15:08 +01:00
|
|
|
maxLines: 2,
|
2021-01-30 15:24:08 +01:00
|
|
|
textAlign: TextAlign.center,
|
2021-02-17 00:15:08 +01:00
|
|
|
decoration: InputDecoration(),
|
|
|
|
style: TextStyle(
|
2021-04-03 02:39:09 +02:00
|
|
|
fontSize: 22,
|
2021-02-17 00:15:08 +01:00
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold))),
|
|
|
|
SizedBox(height: 20),
|
2021-04-03 02:39:09 +02:00
|
|
|
Text('Montant (DU/Ğ1):', style: TextStyle(fontSize: 20.0)),
|
2021-02-17 00:15:08 +01:00
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.all(8.0),
|
|
|
|
child: TextFormField(
|
2021-04-03 02:39:09 +02:00
|
|
|
style: TextStyle(fontSize: 22),
|
2021-04-03 00:07:03 +02:00
|
|
|
controller: _historyProvider.payAmount,
|
2021-02-17 00:15:08 +01:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
maxLines: 1,
|
|
|
|
keyboardType: TextInputType.number,
|
2021-04-03 02:39:09 +02:00
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding:
|
|
|
|
EdgeInsets.symmetric(vertical: 25.0, horizontal: 10.0),
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderRadius: BorderRadius.circular(10.0)),
|
|
|
|
),
|
2021-02-17 00:15:08 +01:00
|
|
|
inputFormatters: <TextInputFormatter>[
|
|
|
|
FilteringTextInputFormatter.allow(RegExp(r'(^\d*\.?\d*)'))
|
|
|
|
],
|
2021-01-30 15:24:08 +01:00
|
|
|
),
|
2021-02-17 00:15:08 +01:00
|
|
|
),
|
|
|
|
Padding(
|
2021-02-17 01:13:47 +01:00
|
|
|
padding: const EdgeInsets.only(top: 15),
|
2021-03-08 11:11:01 +01:00
|
|
|
child: OutlinedButton(
|
|
|
|
style: OutlinedButton.styleFrom(
|
|
|
|
side: BorderSide(width: 2, color: Color(0xffD28928))),
|
2021-02-17 01:13:47 +01:00
|
|
|
onPressed: () {
|
2021-03-29 22:12:38 +02:00
|
|
|
// if (_formKey.currentState.validate()) {
|
|
|
|
// _formKey.currentState.save();
|
|
|
|
// }
|
2021-03-30 02:00:46 +02:00
|
|
|
// _historyProvider.pay(payAmount.text, payComment.text);
|
|
|
|
Navigator.push(context,
|
|
|
|
MaterialPageRoute(builder: (context) {
|
2021-04-03 00:07:03 +02:00
|
|
|
return UnlockingWallet(
|
|
|
|
wallet: defaultWallet, action: "pay");
|
2021-03-30 02:00:46 +02:00
|
|
|
}));
|
2021-02-17 01:13:47 +01:00
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(12),
|
|
|
|
child: Text("PAYER",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 25, color: Colors.grey[850]))),
|
|
|
|
))
|
2021-02-17 00:15:08 +01:00
|
|
|
],
|
2021-01-30 15:24:08 +01:00
|
|
|
),
|
2021-02-17 00:15:08 +01:00
|
|
|
),
|
|
|
|
],
|
2021-01-30 15:24:08 +01:00
|
|
|
);
|
2021-01-09 10:48:06 +01:00
|
|
|
}
|
2021-02-17 00:15:08 +01:00
|
|
|
|
|
|
|
Widget historyView(context, result) {
|
|
|
|
HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
|
|
|
|
|
|
|
|
return _historyProvider.transBC == null
|
|
|
|
? Text('Aucune transaction à afficher.')
|
|
|
|
: Column(children: <Widget>[
|
|
|
|
for (var repository in _historyProvider.transBC)
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 5.0),
|
|
|
|
child: ListTile(
|
|
|
|
contentPadding: const EdgeInsets.all(5.0),
|
|
|
|
leading: Text(repository[1].toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 12,
|
|
|
|
color: Colors.grey[800],
|
|
|
|
fontWeight: FontWeight.w700),
|
|
|
|
textAlign: TextAlign.center),
|
|
|
|
title: Text(repository[3],
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 15.0, fontFamily: 'Monospace'),
|
|
|
|
textAlign: TextAlign.center),
|
|
|
|
subtitle: Text(repository[6] != '' ? repository[6] : '-',
|
|
|
|
style: TextStyle(fontSize: 12.0),
|
|
|
|
textAlign: TextAlign.center),
|
|
|
|
trailing: Text("${repository[4]} Ğ1",
|
|
|
|
style: TextStyle(fontSize: 14.0),
|
|
|
|
textAlign: TextAlign.justify),
|
|
|
|
dense: true,
|
|
|
|
isThreeLine: false,
|
|
|
|
onTap: () {
|
|
|
|
// this._outputPubkey.text = repository[2];
|
2021-02-18 07:54:35 +01:00
|
|
|
_historyProvider.isPubkey(context, repository[2]);
|
2021-02-17 00:15:08 +01:00
|
|
|
})),
|
|
|
|
if (result.isLoading)
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
CircularProgressIndicator(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// if (_historyProvider.isTheEnd) // What I did before ...
|
|
|
|
if (!_historyProvider.pageInfo['hasPreviousPage'])
|
|
|
|
Column(children: <Widget>[
|
|
|
|
SizedBox(height: 15),
|
|
|
|
Text("Début de l'historique.",
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(fontSize: 20)),
|
|
|
|
SizedBox(height: 15)
|
|
|
|
])
|
|
|
|
]);
|
|
|
|
}
|
2021-01-01 21:47:43 +01:00
|
|
|
}
|