2022-12-02 05:57:24 +01:00
|
|
|
import 'package:accordion/controllers.dart';
|
2022-12-04 03:03:08 +01:00
|
|
|
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';
|
2022-12-04 03:03:08 +01:00
|
|
|
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 {
|
2022-12-02 02:11:22 +01:00
|
|
|
const CertificationsScreen(
|
|
|
|
{Key? key, required this.address, required this.username})
|
2022-12-01 03:52:55 +01:00
|
|
|
: super(key: key);
|
|
|
|
final String address;
|
2022-12-02 02:11:22 +01:00
|
|
|
final String username;
|
2022-12-01 03:52:55 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
appBar: AppBar(
|
2022-12-02 02:11:22 +01:00
|
|
|
elevation: 0,
|
2022-12-01 03:52:55 +01:00
|
|
|
toolbarHeight: 60 * ratio,
|
2022-12-02 06:58:18 +01:00
|
|
|
title: SizedBox(
|
2022-12-01 03:52:55 +01:00
|
|
|
height: 22,
|
2022-12-02 06:58:18 +01:00
|
|
|
child: Text('Certifications de $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,
|
2022-12-04 03:03:08 +01:00
|
|
|
header: Row(children: [
|
|
|
|
Text('received'.tr()),
|
|
|
|
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,
|
2022-12-04 03:03:08 +01:00
|
|
|
header: Row(children: [
|
|
|
|
Text('sent'.tr()),
|
|
|
|
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
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|