mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 11:33:34 +08:00
PurchaseScreen: Change text of yearly to "Purchase"
Instead of "Subscribe". Maybe this will help.
This commit is contained in:
@ -102,6 +102,7 @@ class MonthlyRentalWidget extends StatelessWidget {
|
|||||||
skus: _generateSkus(),
|
skus: _generateSkus(),
|
||||||
defaultSku: "sku_monthly_min3",
|
defaultSku: "sku_monthly_min3",
|
||||||
timePeriod: "Month",
|
timePeriod: "Month",
|
||||||
|
isSubscription: true,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
const Text(
|
const Text(
|
||||||
@ -139,6 +140,7 @@ class YearlyPurchaseWidget extends StatelessWidget {
|
|||||||
skus: _generateSkus(),
|
skus: _generateSkus(),
|
||||||
defaultSku: "sku_sub_yearly_1",
|
defaultSku: "sku_sub_yearly_1",
|
||||||
timePeriod: "Year",
|
timePeriod: "Year",
|
||||||
|
isSubscription: false,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
const Text(
|
const Text(
|
||||||
|
@ -16,15 +16,18 @@ import 'package:gitjournal/widgets/purchase_slider.dart';
|
|||||||
class PurchaseButton extends StatelessWidget {
|
class PurchaseButton extends StatelessWidget {
|
||||||
final ProductDetails product;
|
final ProductDetails product;
|
||||||
final String timePeriod;
|
final String timePeriod;
|
||||||
|
final bool subscription;
|
||||||
|
|
||||||
PurchaseButton(this.product, this.timePeriod);
|
PurchaseButton(this.product, this.timePeriod, {@required this.subscription});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var price = product != null ? product.price : "Dev Mode";
|
var price = product != null ? product.price : "Dev Mode";
|
||||||
|
|
||||||
return RaisedButton(
|
return RaisedButton(
|
||||||
child: Text('Subscribe for $price / $timePeriod'),
|
child: subscription
|
||||||
|
? Text('Subscribe for $price / $timePeriod')
|
||||||
|
: Text('Purchase for $price / $timePeriod'),
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
padding: const EdgeInsets.fromLTRB(32.0, 16.0, 32.0, 16.0),
|
padding: const EdgeInsets.fromLTRB(32.0, 16.0, 32.0, 16.0),
|
||||||
onPressed: product != null ? () => _initPurchase(context) : null,
|
onPressed: product != null ? () => _initPurchase(context) : null,
|
||||||
@ -51,11 +54,13 @@ class PurchaseWidget extends StatefulWidget {
|
|||||||
final Set<String> skus;
|
final Set<String> skus;
|
||||||
final String defaultSku;
|
final String defaultSku;
|
||||||
final String timePeriod;
|
final String timePeriod;
|
||||||
|
final bool isSubscription;
|
||||||
|
|
||||||
PurchaseWidget({
|
PurchaseWidget({
|
||||||
@required this.skus,
|
@required this.skus,
|
||||||
@required this.defaultSku,
|
@required this.defaultSku,
|
||||||
@required this.timePeriod,
|
@required this.timePeriod,
|
||||||
|
@required this.isSubscription,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -266,7 +271,11 @@ class _PurchaseWidgetState extends State<PurchaseWidget> {
|
|||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 32.0),
|
const SizedBox(height: 32.0),
|
||||||
PurchaseButton(_selectedProduct, widget.timePeriod),
|
PurchaseButton(
|
||||||
|
_selectedProduct,
|
||||||
|
widget.timePeriod,
|
||||||
|
subscription: widget.isSubscription,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user