feat: add debug screen

This commit is contained in:
poka 2023-03-15 18:24:10 +01:00
parent 840932cbc2
commit 00b81d530e
1 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,62 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:provider/provider.dart';
class DebugScreen extends StatelessWidget {
const DebugScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final sub = Provider.of<SubstrateSdk>(context);
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: const SizedBox(
height: 22,
child: Text('Debug screen'),
)),
body: SafeArea(
child: Column(children: <Widget>[
const SizedBox(height: 40),
Center(
child: Column(
children: [
Text(
'node: ${sub.getConnectedEndpoint()}',
style: TextStyle(fontSize: 15, color: Colors.grey[700]),
),
const SizedBox(height: 15),
Text(
'blockN'.tr(args: [
sub.blocNumber.toString()
]), //'bloc N°${sub.blocNumber}',
style: TextStyle(fontSize: 15, color: Colors.grey[700]),
),
const SizedBox(height: 20),
SizedBox(
height: 60,
width: 250,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4,
backgroundColor: orangeC, // foreground
),
onPressed: () async => await sub.spawnBlock(),
child: const Text(
'Spawn a bloc',
style: TextStyle(
fontSize: 20, fontWeight: FontWeight.w600),
),
),
),
],
),
),
]),
));
}
}