61 lines
1.8 KiB
Dart
61 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:ltx_flutter/appwrite/auth_api.dart';
|
|
import 'package:ltx_flutter/appwrite/database_api.dart';
|
|
import 'package:ltx_flutter/appwrite/categories_api.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class AccountPage extends StatefulWidget {
|
|
const AccountPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
_AccountPageState createState() => _AccountPageState();
|
|
}
|
|
|
|
class _AccountPageState extends State<AccountPage> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
Expanded(
|
|
child: ListView(
|
|
children: [
|
|
Card(
|
|
child: Consumer<AuthAPI>(builder: (context, account, child) {
|
|
return ListTile(
|
|
leading: Icon(Icons.person),
|
|
title: Text("Account"),
|
|
trailing: Text("${account.username}"),
|
|
);
|
|
}),
|
|
),
|
|
Card(
|
|
child:
|
|
Consumer<DatabaseAPI>(builder: (context, entries, child) {
|
|
return ListTile(
|
|
leading: Icon(Icons.edit_note),
|
|
title: Text("Entries"),
|
|
trailing: Text("${entries.total}"),
|
|
);
|
|
}),
|
|
),
|
|
Card(
|
|
child: Consumer<CategoriesAPI>(
|
|
builder: (context, categories, child) {
|
|
return ListTile(
|
|
leading: Icon(Icons.category),
|
|
title: Text("Categories"),
|
|
trailing: Text("${categories.total}"),
|
|
);
|
|
}),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Placeholder(),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|