add current bloc number in settings; remove Substrate debug menu

This commit is contained in:
poka 2022-07-22 22:33:05 +02:00
parent 10eeeba601
commit f44dd4aa76
2 changed files with 39 additions and 31 deletions

View File

@ -20,7 +20,6 @@ import 'package:gecko/screens/onBoarding/1.dart';
import 'package:gecko/screens/search.dart';
import 'package:gecko/screens/settings.dart';
import 'package:flutter/services.dart';
import 'package:gecko/screens/substrate_sandbox.dart';
import 'package:provider/provider.dart';
class HomeScreen extends StatelessWidget {
@ -74,19 +73,19 @@ class HomeScreen extends StatelessWidget {
);
},
),
ListTile(
key: const Key('substrateSandbox'),
title: const Text('Substrate debug'),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const SubstrateSandBox();
}),
);
},
),
// ListTile(
// key: const Key('substrateSandbox'),
// title: const Text('Substrate debug'),
// onTap: () {
// Navigator.pop(context);
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) {
// return const SubstrateSandBox();
// }),
// );
// },
// ),
// ListTile(
// title: const Text('A propos'),

View File

@ -194,23 +194,32 @@ class SettingsScreen extends StatelessWidget {
);
}),
Consumer<SubstrateSdk>(builder: (context, _sub, _) {
return Consumer<SettingsProvider>(builder: (context, _set, _) {
return Visibility(
visible: selectedDuniterEndpoint == 'Auto',
child: SizedBox(
width: 250,
height: _sub.getConnectedEndpoint() == null ? 60 : 20,
child: Text(
_sub.getConnectedEndpoint() ??
"Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.",
style: TextStyle(
fontSize: 15,
fontStyle: FontStyle.italic,
color: Colors.grey[700]),
),
),
);
});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Consumer<SettingsProvider>(builder: (context, _set, _) {
return Visibility(
visible: selectedDuniterEndpoint == 'Auto',
child: SizedBox(
width: 250,
height: _sub.getConnectedEndpoint() == null ? 60 : 20,
child: Text(
_sub.getConnectedEndpoint() ??
"Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.",
style: TextStyle(
fontSize: 15,
fontStyle: FontStyle.italic,
color: Colors.grey[700]),
),
),
);
}),
Text(
'bloc N°${_sub.blocNumber}',
style: TextStyle(fontSize: 14, color: Colors.grey[700]),
)
],
);
}),
]);
}