Skip to content

Commit

Permalink
onSubscribed reads best
Browse files Browse the repository at this point in the history
Since it's a callback after the purchase completes.
The user will be already subscribed.
  • Loading branch information
CarlosNihelton committed Sep 6, 2023
1 parent 6ce676b commit c5cabcc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import 'subscribe_now_widgets.dart';
import 'subscription_status_model.dart';

class SubscribeNowPage extends StatelessWidget {
const SubscribeNowPage({super.key, required this.onSubscribe});
final void Function(SubscriptionInfo) onSubscribe;
const SubscribeNowPage({super.key, required this.onSubscribed});
final void Function(SubscriptionInfo) onSubscribed;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -43,7 +43,7 @@ class SubscribeNowPage extends StatelessWidget {
),
);
},
ifRight: onSubscribe,
ifRight: onSubscribed,
);
},
child: Text(lang.subscribeNow),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SubscriptionStatusPage extends StatelessWidget {
caption: lang.orgManaged,
),
SubscribeNowModel() => SubscribeNowPage(
onSubscribe: (info) =>
onSubscribed: (info) =>
context.read<ValueNotifier<SubscriptionInfo>>().value = info,
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Widget buildApp(
body: Provider.value(
value: model,
child: SubscribeNowPage(
onSubscribe: onSubs,
onSubscribed: onSubs,
),
),
),
Expand Down

0 comments on commit c5cabcc

Please sign in to comment.