Skip to content

Instantly share code, notes, and snippets.

View ponnamkarthik's full-sized avatar

Karthik Ponnam ponnamkarthik

View GitHub Profile
import 'package:flutter/material.dart';
import 'package:flutter_demo_provider/app_state.dart';
import 'package:provider/provider.dart';
class TextEditWidget extends StatefulWidget {
@override
_TextEditWidgetState createState() => _TextEditWidgetState();
}
import 'package:flutter/material.dart';
import 'package:flutter_demo_provider/app_state.dart';
import 'package:flutter_demo_provider/text_display.dart';
import 'package:flutter_demo_provider/text_edit.dart';
import 'package:provider/provider.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
import 'package:flutter/material.dart';
class AppState with ChangeNotifier {
AppState();
String _displayText = "";
void setDisplayText(String text) {
_displayText = text;
notifyListeners();
@ponnamkarthik
ponnamkarthik / Flutter Multi select ChoiceChip
Last active March 17, 2021 08:10
Flutter Multi select ChoiceChip #Flutter #Android #ios
# Flutter Multi select ChoiceChip
Hello Everyone
In this article we will see how to use `ChoiceChip` to accept multiple selections
Let's get started
First things first
@ponnamkarthik
ponnamkarthik / firebase_storage_signed_url.js
Last active February 20, 2019 12:34
Firebase Storage generate Signed Url
var serviceAccount = require("./service/cred.json");
// admin.initializeApp(functions.config().firebase);
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
const { Storage } = require('@google-cloud/storage');
/*
* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
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
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
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});