+ token verification
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline failed
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version unknown status
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline failed
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version unknown status
This commit is contained in:
78
frontend/pweb/lib/pages/status/page.dart
Normal file
78
frontend/pweb/lib/pages/status/page.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pshared/widgets/locale.dart';
|
||||
|
||||
import 'package:pweb/pages/status/failure.dart';
|
||||
import 'package:pweb/pages/status/success.dart';
|
||||
import 'package:pweb/pages/with_footer.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
class StatusPage<T> extends StatefulWidget {
|
||||
final Future<T> Function() operation;
|
||||
final String errorMessage;
|
||||
final IconData? successIcon;
|
||||
final String successMessage;
|
||||
final String successDescription;
|
||||
final Widget? successAction;
|
||||
|
||||
const StatusPage({
|
||||
super.key,
|
||||
required this.operation,
|
||||
required this.errorMessage,
|
||||
this.successIcon,
|
||||
required this.successMessage,
|
||||
required this.successDescription,
|
||||
this.successAction,
|
||||
});
|
||||
|
||||
@override
|
||||
State<StatusPage<T>> createState() => _StatusPageState<T>();
|
||||
}
|
||||
|
||||
class _StatusPageState<T> extends State<StatusPage<T>> {
|
||||
late Future<T> _operation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_operation = widget.operation();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => PageWithFooter(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.verifyAccount),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
const LocaleChangerDropdown(
|
||||
availableLocales: AppLocalizations.supportedLocales,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: FutureBuilder<T>(
|
||||
future: _operation,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
return StatusPageFailure(
|
||||
errorMessage: widget.errorMessage,
|
||||
error: snapshot.error!,
|
||||
);
|
||||
}
|
||||
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
return StatusPageSuccess(
|
||||
successMessage: widget.successMessage,
|
||||
successDescription: widget.successDescription,
|
||||
icon: widget.successIcon,
|
||||
action: widget.successAction,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user