This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { "id": 1, "url": "https://picsum.photos/800/500?random=1" }, | |
| { "id": 2, "url": "https://picsum.photos/800/500?random=2" }, | |
| { "id": 3, "url": "https://picsum.photos/800/500?random=3" }, | |
| { "id": 4, "url": "https://picsum.photos/800/500?random=4" }, | |
| { "id": 5, "url": "https://picsum.photos/800/500?random=5" }, | |
| { "id": 6, "url": "https://picsum.photos/800/500?random=6" }, | |
| { "id": 7, "url": "https://picsum.photos/800/500?random=7" }, | |
| { "id": 8, "url": "https://picsum.photos/800/500?random=8" }, | |
| { "id": 9, "url": "https://picsum.photos/800/500?random=9" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PaymentScreen extends StatefulWidget { | |
| const PaymentScreen({Key? key}) : super(key: key); | |
| @override | |
| State<StatefulWidget> createState() { | |
| return _PaymentScreenState(); | |
| } | |
| } | |
| class _PaymentScreenState extends State<PaymentScreen> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| billingHelper!.checkRestore(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| billingHelper!.buyProduct(Platform.isAndroid ? 'android.test.purchased' : 'weekly'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void initListeners() { | |
| billingHelper?.setPurchaseUpdateHandler((status, value) async { | |
| switch (status) { | |
| case 'success': | |
| if (kDebugMode) { | |
| print('$status : $value'); | |
| ScaffoldMessenger.of(context).showSnackBar(SnackBar( | |
| duration: const Duration(seconds: 1), | |
| backgroundColor: Utils.getPrimaryColor(), | |
| content: Text( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Future<void> initPrice() async { | |
| await billingHelper?.getPrice(Platform.isAndroid ? 'android.test.purchased' : 'weekly'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<String> productIds = [Platform.isAndroid ? 'android.test.purchased' : 'weekly']; | |
| Future<void> initBilling() async { | |
| billingHelper = FlutterBillingPlugin(); | |
| //pass secret key for iOS development auto renewal | |
| await billingHelper?.init(productIds, "a59d0387edeb46e594fc00be5463ab7f", false); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dependencies: | |
| flutter_billing_plugin: ^0.0.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void playVideo() { | |
| String path = "android.resource://" + getPackageName() + "/" + R.raw.video; | |
| binding.videoView.setVideoURI(Uri.parse(path)); | |
| binding.videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { | |
| @Override | |
| public void onCompletion(MediaPlayer mp) { | |
| } | |
| }); | |
| binding.videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { |