Skip to content
Snippets Groups Projects
To find the state of this project's repository at the time of any of these versions, check out the tags.
history.dart 14.25 KiB
import 'dart:io';

import 'package:flutter/services.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/cesiumPlus.dart';
import 'package:gecko/models/queries.dart';
import 'package:gecko/models/history.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'dart:ui';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart';
import 'package:truncate/truncate.dart';

// ignore: must_be_immutable
class HistoryScreen extends StatelessWidget with ChangeNotifier {
  final TextEditingController _outputPubkey = TextEditingController();
  ScrollController scrollController = ScrollController();
  final nRepositories = 20;
  // HistoryProvider _historyProvider;
  final _formKey = GlobalKey<FormState>();
  FocusNode _pubkeyFocus = FocusNode();
  List cesiumData;

  FetchMore fetchMore;
  FetchMoreOptions opts;

  @override
  Widget build(BuildContext context) {
    HistoryProvider _historyProvider = Provider.of<HistoryProvider>(context);
    this._outputPubkey.text = _historyProvider.pubkey;
    print('Build pubkey : ' + _historyProvider.pubkey);
    // _historyProvider.snackNode(context);
    WidgetsBinding.instance.addPostFrameCallback((_) {
      _historyProvider.snackNode(context);
    });

    return Scaffold(
        floatingActionButton: Container(
          height: 80.0,
          width: 80.0,
          child: FittedBox(
            child: FloatingActionButton(
              heroTag: "buttonScan",
              onPressed: () async {
                await _historyProvider.scan();
              },
              child: Container(
                  height: 40.0,
                  width: 40.0,
                  child: Image.asset('images/scanner.png')),
              backgroundColor: Color(
                  0xffEFEFBF), //Color(0xffFFD68E), //Color.fromARGB(500, 204, 255, 255),
            ),
          ),
        ),
        body: Column(children: <Widget>[
          SizedBox(height: 20),
          TextField(
              autofocus: false,
              focusNode: _pubkeyFocus,
              // Entrée de la pubkey
              onChanged: (text) {
                print("Clé tappxé: $text");
                _historyProvider.isPubkey(text);
              },
              controller: this._outputPubkey,
              maxLines: 1,
              textAlign: TextAlign.center,
              decoration: InputDecoration(