Skip to content

Commit

Permalink
about us functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockchainViper committed Feb 21, 2024
1 parent f07a168 commit 2097b61
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ PODS:
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -116,6 +118,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share (from `.symlinks/plugins/share/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
Expand Down Expand Up @@ -151,6 +154,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
mobile_scanner:
:path: ".symlinks/plugins/mobile_scanner/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
share:
Expand Down Expand Up @@ -180,6 +185,7 @@ SPEC CHECKSUMS:
MLKitVision: 8baa5f46ee3352614169b85250574fde38c36f49
mobile_scanner: 38dcd8a49d7d485f632b7de65e4900010187aef2
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:app/authentication.dart';
import 'package:app/package_info_helper.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand All @@ -7,6 +8,7 @@ import 'package:app/router.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
PackageInfoPlusHelper.init();
Authentication.checkForAuth().then((isAuthenticated) {
AnyFluroRouter.setupRouter();
runApp(Anypay(isAuthenticated));
Expand Down
11 changes: 11 additions & 0 deletions lib/package_info_helper.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import 'package:package_info_plus/package_info_plus.dart';

class PackageInfoPlusHelper {
static String version = "";
static String build = "";
static Future init() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
version = packageInfo.version;
build = packageInfo.buildNumber;
}
}
12 changes: 10 additions & 2 deletions lib/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import 'package:app/routes/payment.dart';
import 'package:app/routes/invoice.dart';
import 'package:app/routes/login.dart';

import 'routes/about_us.dart';

class AnyFluroRouter {
static FluroRouter router = FluroRouter();

Expand All @@ -25,7 +27,7 @@ class AnyFluroRouter {

if (klassParams.length == 0) {
return klass();
} else if(klassParams.length == 1) {
} else if (klassParams.length == 1) {
return klass(klassParams[0]);
} else {
return klass(klassParams[0], klassParams[1]);
Expand Down Expand Up @@ -84,6 +86,11 @@ class AnyFluroRouter {
handler: newHandler(() => SetCurrency(), []),
transitionType: TransitionType.inFromBottom,
);
router.define(
'settings/about_us',
handler: newHandler(() => AboutUs(), []),
transitionType: TransitionType.inFromBottom,
);
router.define(
'settings/addresses',
handler: newHandler(() => Addresses(), []),
Expand All @@ -106,7 +113,8 @@ class AnyFluroRouter {
);
router.define(
'new-address/:code/:chain',
handler: newHandler((code, chain) => NewAddress(code, chain), ['code', 'chain']),
handler: newHandler(
(code, chain) => NewAddress(code, chain), ['code', 'chain']),
transitionType: TransitionType.inFromBottom,
);
}
Expand Down
89 changes: 89 additions & 0 deletions lib/routes/about_us.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import 'package:app/package_info_helper.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:app/app_controller.dart';
import 'package:app/authentication.dart';
import 'package:flutter/material.dart';
import 'package:app/back_button.dart';
import 'package:url_launcher/url_launcher.dart';
import '../coins.dart';

class AboutUs extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SingleChildScrollView(
child: SafeArea(
child:
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Text(
"AnyPay",
style: TextStyle(fontSize: 40, fontWeight: FontWeight.w500),
),
SizedBox(
height: 10,
),
Text("[email protected]"),
SizedBox(
height: 10,
),
_clickable(
url: "https://docs.anypayx.com/terms",
title: "Terms of Service"),
SizedBox(
height: 10,
),
_clickable(
url: "https://docs.anypayx.com/privacy",
title: "Privacy Policy"),
SizedBox(
height: 10,
),
_clickable(
url: "https://docs.anypayx.com/", title: "Documentation"),
SizedBox(
height: 10,
),
Text(
"${PackageInfoPlusHelper.version} [Build ${PackageInfoPlusHelper.build}]",
style: TextStyle(fontStyle: FontStyle.italic),
),
SizedBox(
height: 10,
),
Text(
"2024",
style: TextStyle(fontStyle: FontStyle.italic),
),
SizedBox(
height: 10,
),
CircleBackButton(
margin: EdgeInsets.only(top: 20.0),
backPath: '/settings',
),
]),
),
),
),
);
}

Widget _clickable({required String title, required String url}) {
return GestureDetector(
onTap: () async {
await launchUrl(Uri.parse(url));
},
child: Column(
children: [
Text(
title,
style: TextStyle(
decoration: TextDecoration.underline,
decorationColor: Colors.blue,
),
),
],
));
}
}
23 changes: 23 additions & 0 deletions lib/routes/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class _SettingsPageState extends State<SettingsPage> {
_SelectCurrencyLink(context),
_BusinessInfoLink(context),
_AddressesLink(context),
_buildAboutUs(context),
CircleBackButton(
margin: EdgeInsets.only(top: 20.0),
backPath: 'navigation',
Expand Down Expand Up @@ -171,6 +172,28 @@ class _SettingsPageState extends State<SettingsPage> {
);
}

Widget _buildAboutUs(context) {
return Container(
margin: EdgeInsets.all(10.0),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.all(AppController.scale(20.0)),
child: Text("About Us",
style: TextStyle(
fontSize: 22,
))),
],
),
onTap: () {
Navigator.pushNamed(context, 'settings/about_us');
}),
);
}

Widget _SelectCurrencyLink(context) {
return Container(
margin: EdgeInsets.all(10.0),
Expand Down
16 changes: 16 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
path:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies:
http: ^1.2.0
intl: ^0.19.0
confirm_dialog: ^1.0.1
package_info_plus: ^5.0.1

flutter:
sdk: flutter
Expand Down

0 comments on commit 2097b61

Please sign in to comment.