Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

課金ページの修正 #512

Merged
merged 34 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ab23ef2
Avoid android error
bannzai Feb 20, 2022
32f168b
adjustment position
bannzai Feb 20, 2022
0687ea2
to full screen and add close button to premium introduction sheet
bannzai Feb 20, 2022
e9296f3
:shell: dart pub upgrade purchases_flutter
bannzai Feb 23, 2022
9f2178e
Remove unnecessary method
bannzai Feb 23, 2022
3cca1e5
:shell: flutter pub run build_runner build --delete-conflicting-outputs
bannzai Feb 23, 2022
1e3d95f
:shell: flutter pub run build_runner build --delete-conflicting-outputs
bannzai Feb 23, 2022
2d2b9ea
Remove localization
bannzai Feb 23, 2022
cd1ac6b
Copy to PremiumIntroduction state
bannzai Feb 23, 2022
020801e
Fix import
bannzai Feb 23, 2022
9c0d9d4
Remove unnecessary state"h
bannzai Feb 23, 2022
5d13d86
Remove unnecessary offeringType
bannzai Feb 23, 2022
d09459d
Fix state passing
bannzai Feb 23, 2022
a9f2024
remove unnecessary import
bannzai Feb 23, 2022
fb9660d
Fix sheet test
bannzai Feb 23, 2022
63e1fab
rename test file
bannzai Feb 23, 2022
e13f3b3
Replace to PremiumIntroductionState
bannzai Feb 23, 2022
4b9117d
:memo: replace to without hard code
bannzai Feb 23, 2022
167daff
Merge remote-tracking branch 'origin/fix/android/purchase' into fix/a…
bannzai Feb 23, 2022
92b9c4d
Add localization package
bannzai Feb 23, 2022
f045e65
Add option for localization
bannzai Feb 23, 2022
a00a08f
Add yaml file for l10
bannzai Feb 23, 2022
4895c56
Add settings file for each locale localization
bannzai Feb 23, 2022
c3e391b
:up: version flutter
bannzai Feb 23, 2022
02f0d7a
Fix localization
bannzai Feb 23, 2022
3d73294
remove failed localization code
bannzai Feb 23, 2022
ab219bf
Use ja
bannzai Feb 23, 2022
953b70b
Use current locale
bannzai Feb 23, 2022
cc08b56
Add monthlyPremiumPackage
bannzai Feb 24, 2022
21ee7d4
add proxy properties
bannzai Feb 24, 2022
67a2e09
Override properties
bannzai Feb 24, 2022
9ec99e5
Wrap with MaterialApp
bannzai Feb 24, 2022
442a19c
Wrap with Scaffold
bannzai Feb 24, 2022
f9086c8
:shelll: pod update PurchasesHybridCommon
bannzai Feb 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
FILE_FIREBASE_IOS_PRODUCTION: ${{ secrets.FILE_FIREBASE_IOS_PRODUCTION }}
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.10.0'
flutter-version: '2.10.2'
- run: flutter pub get
- name: Run iOS
run: flutter build ios --debug --no-codesign --flavor development --target lib/main.dev.dart --no-sound-null-safety
Expand All @@ -45,7 +45,7 @@ jobs:
FILE_FIREBASE_ANDROID_PRODUCTION: ${{ secrets.FILE_FIREBASE_ANDROID_PRODUCTION }}
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.10.0'
flutter-version: '2.10.2'
- run: flutter pub get
- run: flutter build apk --debug --flavor development --target lib/main.dev.dart --no-sound-null-safety
test:
Expand All @@ -58,6 +58,6 @@ jobs:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.10.0'
flutter-version: '2.10.2'
- run: flutter pub get
- run: flutter test
22 changes: 11 additions & 11 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ PODS:
- package_info (0.0.1):
- Flutter
- PromisesObjC (2.0.0)
- Purchases (3.13.1):
- PurchasesCoreSwift (= 3.13.1)
- purchases_flutter (3.8.0):
- Purchases (3.13.2):
- PurchasesCoreSwift (= 3.13.2)
- purchases_flutter (3.9.5):
- Flutter
- PurchasesHybridCommon (= 1.11.1)
- PurchasesCoreSwift (3.13.1)
- PurchasesHybridCommon (1.11.1):
- Purchases (= 3.13.1)
- PurchasesHybridCommon (= 1.11.2)
- PurchasesCoreSwift (3.13.2)
- PurchasesHybridCommon (1.11.2):
- Purchases (= 3.13.2)
- shared_preferences_ios (0.0.1):
- Flutter
- sign_in_with_apple (0.0.1):
Expand Down Expand Up @@ -337,10 +337,10 @@ SPEC CHECKSUMS:
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Purchases: 2693d6444609de044ab25fcda9561bef038f24da
purchases_flutter: 214d452aaf860496aeee822487eafcdd962fab33
PurchasesCoreSwift: ca55f9ef671f89abed133775dd9e53f55007828d
PurchasesHybridCommon: a0313de4f31fbaf137518b2686ccdca4c91dd2b4
Purchases: 03200de9288724e77de435000d1828601e6b8e00
purchases_flutter: cf2b742f12b7ffef6f618c7f1ba1961e652825b1
PurchasesCoreSwift: 2ea4b33e5cece5c8a0751594ef7c6cbfcbd747a9
PurchasesHybridCommon: 56ef42d85c3e930d49aff4ac5fa027373d2e1bb8
shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af
Expand Down
3 changes: 3 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
arb-dir: lib/l10n
template-arb-file: app_ja.arb
output-localization-file: app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:intl/intl.dart';
import 'package:pilll/components/atoms/color.dart';
import 'package:pilll/components/atoms/font.dart';
import 'package:pilll/components/atoms/text_color.dart';
import 'package:pilll/domain/premium_introduction/components/purchase_buttons_state.dart';
import 'package:pilll/domain/premium_introduction/premium_introduction_state.dart';
import 'package:purchases_flutter/purchases_flutter.dart';

class AnnualPurchaseButton extends StatelessWidget {
Expand All @@ -20,9 +20,11 @@ class AnnualPurchaseButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
final monthlyPrice = annualPackage.product.price / 12;
Locale locale = Localizations.localeOf(context);
final monthlyPriceString =
NumberFormat.simpleCurrency(decimalDigits: 0, name: "JPY")
NumberFormat.simpleCurrency(locale: locale.toString(), decimalDigits: 0)
.format(monthlyPrice);

return GestureDetector(
onTap: () {
onTap(annualPackage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ import 'package:flutter_svg/svg.dart';
import 'package:pilll/components/atoms/font.dart';
import 'package:pilll/components/atoms/text_color.dart';
import 'package:pilll/domain/premium_introduction/util/discount_deadline.dart';
import 'package:purchases_flutter/object_wrappers.dart';

class PremiumIntroductionDiscountRow extends HookConsumerWidget {
final Package monthlyPremiumPackage;
final DateTime? discountEntitlementDeadlineDate;

const PremiumIntroductionDiscountRow(
{Key? key, required this.discountEntitlementDeadlineDate})
: super(key: key);
const PremiumIntroductionDiscountRow({
Key? key,
required this.discountEntitlementDeadlineDate,
required this.monthlyPremiumPackage,
}) : super(key: key);

Widget build(BuildContext context, WidgetRef ref) {
final discountEntitlementDeadlineDate =
this.discountEntitlementDeadlineDate;
Expand Down Expand Up @@ -75,7 +80,7 @@ class PremiumIntroductionDiscountRow extends HookConsumerWidget {
Stack(
children: [
Text(
"¥480",
"${monthlyPremiumPackage.product.priceString}",
textAlign: TextAlign.center,
style: TextColorStyle.main.merge(
TextStyle(
Expand All @@ -86,7 +91,7 @@ class PremiumIntroductionDiscountRow extends HookConsumerWidget {
),
),
Positioned(
left: 30,
left: 24,
child: SvgPicture.asset("images/strikethrough.svg"),
),
],
Expand Down
46 changes: 22 additions & 24 deletions lib/domain/premium_introduction/components/purchase_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'package:pilll/analytics.dart';
import 'package:pilll/components/page/hud.dart';
import 'package:pilll/domain/premium_introduction/components/annual_purchase_button.dart';
import 'package:pilll/domain/premium_introduction/components/monthly_purchase_button.dart';
import 'package:pilll/domain/premium_introduction/components/purchase_buttons_state.dart';
import 'package:pilll/domain/premium_introduction/premium_complete_dialog.dart';
import 'package:pilll/domain/premium_introduction/premium_introduction_state.dart';
import 'package:pilll/domain/premium_introduction/premium_introduction_store.dart';
import 'package:pilll/entity/user_error.dart';
import 'package:pilll/error/error_alert.dart';
Expand All @@ -14,41 +14,39 @@ import 'package:purchases_flutter/purchases_flutter.dart';

class PurchaseButtons extends HookConsumerWidget {
final PremiumIntroductionStore store;
final Offerings offerings;
final OfferingType offeringType;
final Package monthlyPackage;
final Package annualPackage;

const PurchaseButtons({
Key? key,
required this.store,
required this.offerings,
required this.offeringType,
required this.monthlyPackage,
required this.annualPackage,
}) : super(key: key);

@override
Widget build(BuildContext context, WidgetRef ref) {
final state = ref.watch(purchaseButtonsStateProvider(offerings));
final monthlyPackage = state.monthlyPackage;
final annualPackage = state.annualPackage;

return Row(
children: [
Spacer(),
if (monthlyPackage != null)
MonthlyPurchaseButton(
monthlyPackage: monthlyPackage,
onTap: (monthlyPackage) async {
analytics.logEvent(name: "pressed_monthly_purchase_button");
await _purchase(context, monthlyPackage);
},
),
MonthlyPurchaseButton(
monthlyPackage: monthlyPackage,
onTap: (monthlyPackage) async {
analytics.logEvent(name: "pressed_monthly_purchase_button");
await _purchase(context, monthlyPackage);
},
),
SizedBox(width: 16),
if (annualPackage != null)
AnnualPurchaseButton(
annualPackage: annualPackage,
offeringType: state.offeringType,
onTap: (annualPackage) async {
analytics.logEvent(name: "pressed_annual_purchase_button");
await _purchase(context, annualPackage);
},
),
AnnualPurchaseButton(
annualPackage: annualPackage,
offeringType: offeringType,
onTap: (annualPackage) async {
analytics.logEvent(name: "pressed_annual_purchase_button");
await _purchase(context, annualPackage);
},
),
Spacer(),
],
);
Expand Down

This file was deleted.

Loading