From 3eb3bd6f074df27a463504d26d57b695173dec9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?th=E1=BB=8Bnh?= Date: Wed, 11 Dec 2024 06:31:51 +0700 Subject: [PATCH 1/3] Revide login with google/apple be separated per platform. Remove payment bypass on owner --- app/lib/pages/apps/app_detail/app_detail.dart | 4 +- app/lib/pages/onboarding/auth.dart | 39 ++++++------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/app/lib/pages/apps/app_detail/app_detail.dart b/app/lib/pages/apps/app_detail/app_detail.dart index d4b6075836..b66d9ef026 100644 --- a/app/lib/pages/apps/app_detail/app_detail.dart +++ b/app/lib/pages/apps/app_detail/app_detail.dart @@ -395,9 +395,7 @@ class _AppDetailPageState extends State { width: MediaQuery.of(context).size.width * 0.9, text: app.getFormattedPrice(), onPressed: () async { - if (app.paymentLink != null && - app.paymentLink!.isNotEmpty && - !app.isOwner(SharedPreferencesUtil().uid)) { + if (app.paymentLink != null && app.paymentLink!.isNotEmpty) { _checkPaymentStatus(app.id); await launchUrl(Uri.parse(app.paymentLink!)); } else { diff --git a/app/lib/pages/onboarding/auth.dart b/app/lib/pages/onboarding/auth.dart index b6d3a43294..c5b3274249 100644 --- a/app/lib/pages/onboarding/auth.dart +++ b/app/lib/pages/onboarding/auth.dart @@ -20,8 +20,6 @@ class AuthComponent extends StatefulWidget { class _AuthComponentState extends State { @override Widget build(BuildContext context) { - final customBackendUrl = SharedPreferencesUtil().customBackendUrl; - return Consumer( builder: (context, provider, child) { return Padding( @@ -41,31 +39,18 @@ class _AuthComponentState extends State { ), ), SizedBox(height: MediaQuery.of(context).textScaleFactor > 1.0 ? 18 : 32), - if (customBackendUrl.isEmpty) - SignInButton( - Buttons.google, - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), - onPressed: () => provider.onGoogleSignIn(widget.onSignIn), - ), - if (customBackendUrl.isEmpty && Platform.isIOS) - SignInWithAppleButton( - style: SignInWithAppleButtonStyle.whiteOutlined, - onPressed: () => provider.onAppleSignIn(widget.onSignIn), - height: 52, - ), - // if (customBackendUrl.isNotEmpty) - // ElevatedButton( - // onPressed: () { - // }, - // child: Text('Sign In with Email'), - // ), - // if (customBackendUrl.isNotEmpty) const SizedBox(height: 16), - // if (customBackendUrl.isEmpty) - // TextButton( - // onPressed: () {}, - // child: const Text('Sign Up'), - // ), + !Platform.isIOS + ? SignInButton( + Buttons.google, + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + onPressed: () => provider.onGoogleSignIn(widget.onSignIn), + ) + : SignInWithAppleButton( + style: SignInWithAppleButtonStyle.whiteOutlined, + onPressed: () => provider.onAppleSignIn(widget.onSignIn), + height: 52, + ), const SizedBox(height: 16), RichText( textAlign: TextAlign.center, From c5060de0af5184b111d313003b78a8c1656c86a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?th=E1=BB=8Bnh?= Date: Wed, 11 Dec 2024 06:36:14 +0700 Subject: [PATCH 2/3] Change $/m button to Subcribe --- app/lib/pages/apps/app_detail/app_detail.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/pages/apps/app_detail/app_detail.dart b/app/lib/pages/apps/app_detail/app_detail.dart index b66d9ef026..70eec16eea 100644 --- a/app/lib/pages/apps/app_detail/app_detail.dart +++ b/app/lib/pages/apps/app_detail/app_detail.dart @@ -393,7 +393,7 @@ class _AppDetailPageState extends State { padding: const EdgeInsets.all(8.0), child: AnimatedLoadingButton( width: MediaQuery.of(context).size.width * 0.9, - text: app.getFormattedPrice(), + text: "Subscribe", onPressed: () async { if (app.paymentLink != null && app.paymentLink!.isNotEmpty) { _checkPaymentStatus(app.id); From 7a6475aabde9388e7c124eac20c52cb8655d2fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?th=E1=BB=8Bnh?= Date: Wed, 11 Dec 2024 06:42:40 +0700 Subject: [PATCH 3/3] Remove the price label for paid apps --- app/lib/pages/apps/list_item.dart | 18 +++++++++--------- .../pages/apps/widgets/app_section_card.dart | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/lib/pages/apps/list_item.dart b/app/lib/pages/apps/list_item.dart index 532d912110..cae88e0bde 100644 --- a/app/lib/pages/apps/list_item.dart +++ b/app/lib/pages/apps/list_item.dart @@ -108,15 +108,15 @@ class AppListItem extends StatelessWidget { ), ) : Container(), - app.isPaid - ? Padding( - padding: const EdgeInsets.only(top: 8), - child: Text( - app.getFormattedPrice(), - style: TextStyle(color: Colors.grey.shade400, fontSize: 14), - ), - ) - : const SizedBox(), + //app.isPaid + // ? Padding( + // padding: const EdgeInsets.only(top: 8), + // child: Text( + // app.getFormattedPrice(), + // style: TextStyle(color: Colors.grey.shade400, fontSize: 14), + // ), + // ) + // : const SizedBox(), ], ), ], diff --git a/app/lib/pages/apps/widgets/app_section_card.dart b/app/lib/pages/apps/widgets/app_section_card.dart index b04c9eef7c..b10c4b0497 100644 --- a/app/lib/pages/apps/widgets/app_section_card.dart +++ b/app/lib/pages/apps/widgets/app_section_card.dart @@ -140,15 +140,15 @@ class SectionAppItemCard extends StatelessWidget { ], ) : const SizedBox(), - app.isPaid - ? Padding( - padding: const EdgeInsets.only(top: 4.0), - child: Text( - app.getFormattedPrice(), - style: TextStyle(color: Colors.grey.shade400, fontSize: 14), - ), - ) - : const SizedBox(), + //app.isPaid + // ? Padding( + // padding: const EdgeInsets.only(top: 4.0), + // child: Text( + // app.getFormattedPrice(), + // style: TextStyle(color: Colors.grey.shade400, fontSize: 14), + // ), + // ) + // : const SizedBox(), ], ), )