Skip to content

Instantly share code, notes, and snippets.

View prasadsunny1's full-sized avatar
🏠
Working from home

sanni prasad prasadsunny1

🏠
Working from home
View GitHub Profile
@prasadsunny1
prasadsunny1 / SaveImagetoPhotoGallary.dart
Last active February 22, 2020 18:22
Save image to image gallery using "image_gallery_saver" and asking for permission using "permission_handler" with flutter
import 'dart:typed_data';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:image_gallery_saver/image_gallery_saver.dart';
import 'package:permission_handler/permission_handler.dart';
//iOS - add these keys to info.plist in your ios folder
// NSPhotoLibraryAddUsageDescription and NSPhotoLibraryUsageDescription
// This gist uses flutter packages
@prasadsunny1
prasadsunny1 / main.dart
Created August 18, 2019 08:38
main.dart
import "package:flutter/material.dart";
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@prasadsunny1
prasadsunny1 / CodeMagicAndroidCrash
Created August 7, 2019 13:48
Facing android build fail in codemagic. Works in local machine
== Building for Android ==
== /usr/local/bin/flutter build appbundle --release --build-name=1.0.25 --build-number=25 -v ==
[ +53 ms] executing: [/Users/builder/programs/flutter/] git log -n 1 --pretty=format:%H
[ +58 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ ] 20e59316b8b8474554b38493b8ca888794b0234a
[ ] executing: [/Users/builder/programs/flutter/] git describe --match v*.*.* --first-parent --long --tags
[ +22 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ ] v1.7.8+hotfix.4-0-g20e59316b
[ +19 ms] executing: [/Users/builder/programs/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
@prasadsunny1
prasadsunny1 / abc.html
Created December 30, 2018 10:32
my cool html
<html>
<head>
<title>
Hello sunny
</title>
</head>
</html>
@prasadsunny1
prasadsunny1 / transxml.py
Last active May 19, 2018 18:13
This python script takes an xml file and translaes all the values tagged with <value> in your target language(set target="LANG_CODE" in the script)
# -*- coding: utf-8 -*-
from google.cloud import translate
import six
import xml.dom.minidom as minidom
def translate_text(target, text):
"""Translates text into the target language.
Target must be an ISO 639-1 language code.