update deps and clean up (GH-2)
This commit is contained in:
parent
355f505197
commit
3a5aaa780c
5 changed files with 85 additions and 185 deletions
|
|
@ -14,15 +14,15 @@ class InAppPurchaseListener extends StatelessWidget {
|
|||
return BlocListener<PurchaseDetailsCubit, List<PurchaseDetails>>(
|
||||
listener: (context, state) {
|
||||
if (state.last.status == PurchaseStatus.purchased) {
|
||||
showSnackbar('Coffee received, thank you! ☕');
|
||||
showSnackBar('Coffee received, thank you! ☕');
|
||||
}
|
||||
|
||||
if (state.last.status == PurchaseStatus.pending) {
|
||||
showSnackbar('Coffee is on the way! ☕');
|
||||
showSnackBar('Coffee is on the way! ☕');
|
||||
}
|
||||
|
||||
if (state.last.status == PurchaseStatus.error) {
|
||||
showSnackbar('Something went wrong, failed to send coffee 😢');
|
||||
showSnackBar('Something went wrong, failed to send coffee 😢');
|
||||
}
|
||||
},
|
||||
child: child,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
void showSnackbar(String message) {
|
||||
void showSnackBar(String message) {
|
||||
final scaffoldMessenger =
|
||||
GetIt.I<GlobalKey<ScaffoldMessengerState>>().currentState;
|
||||
scaffoldMessenger?.showSnackBar(SnackBar(content: Text(message)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue