Update transactions form with auth
This commit is contained in:
parent
411ffaedb2
commit
79735a7550
1 changed files with 13 additions and 1 deletions
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:nekoya_flutter/api/api.dart';
|
import 'package:nekoya_flutter/api/api.dart';
|
||||||
import 'package:nekoya_flutter/components/transaction_box.dart';
|
import 'package:nekoya_flutter/components/transaction_box.dart';
|
||||||
|
import 'package:nekoya_flutter/data/auth.dart';
|
||||||
|
|
||||||
class Transactions extends StatefulWidget {
|
class Transactions extends StatefulWidget {
|
||||||
const Transactions({Key? key}) : super(key: key);
|
const Transactions({Key? key}) : super(key: key);
|
||||||
|
@ -11,6 +12,17 @@ class Transactions extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _TransactionsState extends State<Transactions> {
|
class _TransactionsState extends State<Transactions> {
|
||||||
|
var session = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
getSession().then((session) async {
|
||||||
|
session = session;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
@ -21,7 +33,7 @@ class _TransactionsState extends State<Transactions> {
|
||||||
backgroundColor: const Color(0xff212226),
|
backgroundColor: const Color(0xff212226),
|
||||||
),
|
),
|
||||||
body: FutureBuilder<dynamic>(
|
body: FutureBuilder<dynamic>(
|
||||||
future: getTransactions(),
|
future: getTransactions(session),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData) {
|
||||||
var data = snapshot.data;
|
var data = snapshot.data;
|
||||||
|
|
Loading…
Reference in a new issue