mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +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(),
|
||||
defaultSku: "sku_monthly_min3",
|
||||
timePeriod: "Month",
|
||||
isSubscription: true,
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
const Text(
|
||||
@ -139,6 +140,7 @@ class YearlyPurchaseWidget extends StatelessWidget {
|
||||
skus: _generateSkus(),
|
||||
defaultSku: "sku_sub_yearly_1",
|
||||
timePeriod: "Year",
|
||||
isSubscription: false,
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
const Text(
|
||||
|
@ -16,15 +16,18 @@ import 'package:gitjournal/widgets/purchase_slider.dart';
|
||||
class PurchaseButton extends StatelessWidget {
|
||||
final ProductDetails product;
|
||||
final String timePeriod;
|
||||
final bool subscription;
|
||||
|
||||
PurchaseButton(this.product, this.timePeriod);
|
||||
PurchaseButton(this.product, this.timePeriod, {@required this.subscription});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var price = product != null ? product.price : "Dev Mode";
|
||||
|
||||
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,
|
||||
padding: const EdgeInsets.fromLTRB(32.0, 16.0, 32.0, 16.0),
|
||||
onPressed: product != null ? () => _initPurchase(context) : null,
|
||||
@ -51,11 +54,13 @@ class PurchaseWidget extends StatefulWidget {
|
||||
final Set<String> skus;
|
||||
final String defaultSku;
|
||||
final String timePeriod;
|
||||
final bool isSubscription;
|
||||
|
||||
PurchaseWidget({
|
||||
@required this.skus,
|
||||
@required this.defaultSku,
|
||||
@required this.timePeriod,
|
||||
@required this.isSubscription,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -266,7 +271,11 @@ class _PurchaseWidgetState extends State<PurchaseWidget> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
),
|
||||
const SizedBox(height: 32.0),
|
||||
PurchaseButton(_selectedProduct, widget.timePeriod),
|
||||
PurchaseButton(
|
||||
_selectedProduct,
|
||||
widget.timePeriod,
|
||||
subscription: widget.isSubscription,
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
);
|
||||
|
Reference in New Issue
Block a user