Skip to content

Instantly share code, notes, and snippets.

View TheAlphamerc's full-sized avatar
:electron:
React | Next | Node | Flutter | Xamarin

Sonu Sharma TheAlphamerc

:electron:
React | Next | Node | Flutter | Xamarin
View GitHub Profile
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
dio: ^3.0.9
intl: ^0.15.8
path: ^1.6.4
share: ^0.6.5
get_it: ^4.0.2
Click to expand
|      
|-- lib
|   |-- app_delegate.dart
|   |-- bloc
|   |   |-- User
|   |   |   |-- User_bloc.dart
@TheAlphamerc
TheAlphamerc / FirebaseUtility.dart
Created March 4, 2020 02:45
Flutter firebase utility to upload and delete file from firebase
import 'dart:io';
import 'package:path/path.dart' as Path;
import 'package:firebase_storage/firebase_storage.dart';
class FirebaseUtility{
static Future<String> uploadFileToFirebase(File file) async {
try {
StorageReference storageReference = FirebaseStorage.instance
.ref()
@TheAlphamerc
TheAlphamerc / Marker_generator.dart
Created January 13, 2020 12:06
Build the widget and return bitmap through callback.
import 'package:flutter/material.dart';
import 'dart:typed_data';
import 'package:flutter/rendering.dart';
import 'dart:ui' as ui;
/// This just adds overlay and builds [_MarkerHelper] on that overlay.
/// [_MarkerHelper] does all the heavy work of creating and getting bitmaps
class MarkerGenerator {
final Function(List<Uint8List>) callback;
final List<Widget> markerWidgets;
@TheAlphamerc
TheAlphamerc / flutterCreateBuildCliComman.text
Created November 12, 2019 05:04
Create android and ios build using flutter cli command
flutter build apk
cp build/app/outputs/apk/release/app-release.apk buildOutput/
flutter build ios
cd ios
xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive
xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipa
cd ..
cp ios/build/Runner.ipa/Runner.ipa buildOutput/
@TheAlphamerc
TheAlphamerc / Card.cs
Created June 26, 2019 06:38
Xamarin form android native card view
using System;
using System.ComponentModel;
using Xamarin.Forms;
namespace Sample.Controls
{
public class Card : View
{
public Card()
{
@TheAlphamerc
TheAlphamerc / BindableStackLayout.cs
Created June 1, 2019 12:40
Bindable stack layout
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
@TheAlphamerc
TheAlphamerc / BackgroundExtension.cs
Last active June 1, 2019 12:06
Add background color to xamarin android view
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.Graphics;
using Android.Graphics.Drawables;
using Android.OS;
using Android.Runtime;
@TheAlphamerc
TheAlphamerc / BlurredImage.cs
Created March 13, 2019 07:48
Create blurred image in xamarin form
using System;
using Xamarin.Forms;
namespace Sample.Controls
{
public class BlurredImage : Image
{
}
@TheAlphamerc
TheAlphamerc / CreditCardModel.cs
Created March 7, 2019 04:26
Stripe payment gateway In xamarin forms
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
namespace Nonco.Model.PaymentGatway
{
public class CreditCardModel
{
[JsonProperty("exp_month")]