You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.2 KiB
Dart
62 lines
2.2 KiB
Dart
import 'package:fluffychat/pangea/controllers/pangea_controller.dart';
|
|
import 'package:fluffychat/pangea/pages/settings_subscription/settings_subscription.dart';
|
|
import 'package:fluffychat/pangea/widgets/subscription/subscription_buttons.dart';
|
|
import 'package:fluffychat/widgets/matrix.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
|
|
class ChangeSubscription extends StatelessWidget {
|
|
final SubscriptionManagementController controller;
|
|
ChangeSubscription({
|
|
required this.controller,
|
|
super.key,
|
|
});
|
|
|
|
final PangeaController pangeaController = MatrixState.pangeaController;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return controller.subscriptionsAvailable
|
|
? Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
L10n.of(context)!.selectYourPlan,
|
|
style: const TextStyle(fontSize: 16),
|
|
),
|
|
const SizedBox(height: 16.0),
|
|
const Divider(height: 1),
|
|
SubscriptionButtons(controller: controller),
|
|
const SizedBox(height: 32),
|
|
if (controller.selectedSubscription != null)
|
|
IntrinsicWidth(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
OutlinedButton(
|
|
onPressed: () => controller.submitChange(),
|
|
child: Text(
|
|
controller.selectedSubscription!.isTrial
|
|
? L10n.of(context)!.activateTrial
|
|
: L10n.of(context)!.pay,
|
|
),
|
|
),
|
|
const SizedBox(height: 20),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
)
|
|
: const Center(
|
|
child: Padding(
|
|
padding: EdgeInsets.all(16.0),
|
|
child: CircularProgressIndicator.adaptive(
|
|
strokeWidth: 2,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|