Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:app_finance/_classes/herald/app_locale.dart';
5 : import 'package:app_finance/_classes/structure/navigation/app_route.dart';
6 : import 'package:app_finance/_configs/theme_helper.dart';
7 : import 'package:app_finance/pages/_interfaces/abstract_page_state.dart';
8 : import 'package:app_finance/pages/subscription/widgets/apple_widget.dart';
9 : import 'package:app_finance/pages/subscription/widgets/google_widget.dart';
10 : import 'package:app_finance/pages/subscription/widgets/other_widget.dart';
11 : import 'package:app_finance/design/wrapper/row_widget.dart';
12 : import 'package:app_finance/design/wrapper/text_wrapper.dart';
13 : import 'package:material_ui/material_ui.dart';
14 : import 'package:flutter/foundation.dart';
15 :
16 : class SubscriptionPage extends StatefulWidget {
17 2 : const SubscriptionPage({super.key});
18 :
19 0 : @override
20 0 : SubscriptionPageState createState() => SubscriptionPageState();
21 : }
22 :
23 : class SubscriptionPageState extends AbstractPageState<SubscriptionPage> {
24 0 : @override
25 : String getButtonName() => '';
26 :
27 0 : @override
28 : Widget buildButton(BuildContext context, BoxConstraints constraints) => ThemeHelper.emptyBox;
29 :
30 0 : @override
31 0 : String getTitle() => AppLocale.labels.subscriptionHeadline;
32 :
33 0 : @override
34 : Widget buildContent(BuildContext context, BoxConstraints constraints) {
35 0 : double indent = ThemeHelper.getIndent();
36 0 : NavigatorState nav = Navigator.of(context);
37 0 : return Padding(
38 0 : padding: EdgeInsets.fromLTRB(indent, indent, indent, 0),
39 0 : child: Column(
40 0 : children: [
41 0 : Text(AppLocale.labels.subscription),
42 : const Divider(),
43 0 : RowWidget(
44 : indent: indent,
45 0 : maxWidth: ThemeHelper.getWidth(context, 2, constraints),
46 : alignment: MainAxisAlignment.spaceBetween,
47 : chunk: const [null, null],
48 0 : children: [
49 0 : [
50 0 : ElevatedButton(
51 0 : onPressed: () => nav.pushNamed(AppRoute.aboutRoute, arguments: {'search': '1'}),
52 0 : child: TextWrapper(AppLocale.labels.termPrivacy),
53 : ),
54 : ],
55 0 : [
56 0 : Align(
57 : alignment: Alignment.centerRight,
58 0 : child: ElevatedButton(
59 0 : onPressed: () => nav.pushNamed(AppRoute.aboutRoute, arguments: {'search': '2'}),
60 0 : child: TextWrapper(AppLocale.labels.termUse),
61 : ),
62 : ),
63 : ],
64 : ],
65 : ),
66 : const Divider(),
67 0 : Expanded(
68 0 : child: switch (defaultTargetPlatform) {
69 0 : TargetPlatform.iOS || TargetPlatform.macOS => const AppleWidget(),
70 0 : TargetPlatform.android => const GoogleWidget(),
71 : _ => const OtherWidget(),
72 : },
73 : ),
74 : ThemeHelper.hIndent,
75 : ],
76 : ),
77 : );
78 : }
79 : }
|