gecko/lib/screens/certifications.dart

83 lines
3.1 KiB
Dart
Raw Normal View History

2022-12-02 05:57:24 +01:00
import 'package:accordion/controllers.dart';
import 'package:easy_localization/easy_localization.dart';
2022-12-01 03:52:55 +01:00
import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/widgets/certs_received.dart';
import 'package:gecko/widgets/certs_counter.dart';
2022-12-01 03:52:55 +01:00
import 'package:gecko/widgets/certs_sent.dart';
2022-12-02 05:57:24 +01:00
import 'package:accordion/accordion.dart';
2022-12-01 03:52:55 +01:00
class CertificationsScreen extends StatelessWidget {
const CertificationsScreen(
{Key? key, required this.address, required this.username})
2022-12-01 03:52:55 +01:00
: super(key: key);
final String address;
final String username;
2022-12-01 03:52:55 +01:00
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
elevation: 0,
2022-12-01 03:52:55 +01:00
toolbarHeight: 60 * ratio,
title: SizedBox(
2022-12-01 03:52:55 +01:00
height: 22,
2023-03-23 00:24:34 +01:00
child: Text('certificationsOf'.tr(args: [username])),
2022-12-01 03:52:55 +01:00
)),
body: SafeArea(
2022-12-02 05:57:24 +01:00
child: Accordion(
2022-12-04 03:24:23 +01:00
paddingListTop: 10,
paddingListBottom: 10,
2022-12-02 05:57:24 +01:00
maxOpenSections: 1,
headerBackgroundColorOpened: orangeC,
scaleWhenAnimating: true,
openAndCloseAnimation: true,
headerPadding:
const EdgeInsets.symmetric(vertical: 7, horizontal: 15),
sectionOpeningHapticFeedback: SectionHapticFeedback.heavy,
sectionClosingHapticFeedback: SectionHapticFeedback.light,
children: [
AccordionSection(
isOpen: true,
leftIcon:
const Icon(Icons.insights_rounded, color: Colors.black),
headerBackgroundColor: yellowC,
headerBackgroundColorOpened: orangeC,
header: Row(children: [
2023-03-23 00:24:34 +01:00
Text(
'received'.tr(),
style: const TextStyle(fontSize: 20),
),
const SizedBox(width: 5),
CertsCounter(address: address)
]),
2022-12-02 05:57:24 +01:00
content: CertsReceived(address: address),
contentHorizontalPadding: 0,
contentBorderWidth: 1,
),
AccordionSection(
isOpen: false,
leftIcon:
const Icon(Icons.insights_rounded, color: Colors.black),
headerBackgroundColor: yellowC,
headerBackgroundColorOpened: orangeC,
header: Row(children: [
2023-03-23 00:24:34 +01:00
Text(
'sent'.tr(),
style: const TextStyle(fontSize: 20),
),
const SizedBox(width: 5),
CertsCounter(address: address, isSent: true)
]),
2022-12-02 05:57:24 +01:00
content: CertsSent(address: address),
contentHorizontalPadding: 20,
contentBorderWidth: 1,
// onOpenSection: () => print('onOpenSection ...'),
// onCloseSection: () => print('onCloseSection ...'),
),
]),
2022-12-01 03:52:55 +01:00
));
}
}