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
import 'package:flutter/material.dart'; | |
import 'package:flutter_native_log/flutter_native_log.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => new _MyAppState(); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="turquoise">#1ABC9C</color> | |
<color name="emerald">#2ECC71</color> | |
<color name="peter_river">#3498DB</color> | |
<color name="amethyst">#9B59B6</color> | |
<color name="wet_asphalt">#34495E</color> | |
<color name="green_sea">#16A085</color> | |
<color name="nephritis">#27AE60</color> |
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
NotificationListener<ScrollNotification>( | |
onNotification: (ScrollNotification scrollInfo) { | |
if (scrollInfo.metrics.pixels == | |
scrollInfo.metrics.maxScrollExtent) { | |
loadMore(); | |
} | |
}, | |
child: ListView.builder( | |
// ... | |
), |
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 loadMore() { | |
setState(() { | |
if((present + perPage )> originalItems.length) { | |
items.addAll( | |
originalItems.getRange(present, originalItems.length)); | |
} else { | |
items.addAll( | |
originalItems.getRange(present, present + perPage)); | |
} | |
present = present + perPage; |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', |
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
import 'dart:async'; | |
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart'; | |
class DynamicLinks { | |
// create a link with params | |
static Future<Uri> createLinkWithParams(String code) => | |
_getLink('mylink', {'code': code}); | |
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 initState() { | |
super.initState(); | |
_retrieveDynamicLink(); | |
} | |
Future<void> _retrieveDynamicLink() async { | |
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.retrieveDynamicLink(); | |
final Uri deepLink = data?.link; | |
if (deepLink != null) { |
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
import android.text.TextUtils | |
import android.util.Base64 | |
import com.android.billingclient.util.BillingHelper | |
import java.io.IOException | |
import java.security.InvalidKeyException | |
import java.security.KeyFactory | |
import java.security.NoSuchAlgorithmException | |
import java.security.PublicKey | |
import java.security.Signature |
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
BillingClient mBillingClient; | |
// To get key go to Developer Console > Select your app > Development Tools > Services & APIs. | |
String base64Key = "PLACE_YOUR_KEY_HERE"; | |
mBillingClient = BillingClient.newBuilder(this).setListener(new PurchasesUpdatedListener() { | |
@Override | |
public void onPurchasesUpdated(int responseCode, @Nullable List<Purchase> purchases) { | |
for(Purchase purchase: purchases) { | |
// When every a new purchase is made |