Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / flutter_github_ci.yml
Created March 18, 2023 02:22 — forked from rodydavis/flutter_github_ci.yml
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@anoochit
anoochit / avatar_layout.dart
Created February 28, 2023 13:34
FlutterFlow - Avatar Maker Custom widgets for
// Automatic FlutterFlow imports
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:flutter_svg/flutter_svg.dart';
@anoochit
anoochit / build.gradle
Created February 20, 2023 03:27 — forked from wendreof/build.gradle
7-How-to-Safely-Build-Assigned-Flutter-App-with-GitHub-Actions
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
@anoochit
anoochit / print_ticket.dart
Created December 27, 2022 15:14
thermal printer
// print test ticket
void printTicket() {
// make a screenshot with data
screenshotController
.captureFromWidget(
SizedBox(
width: 140,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@anoochit
anoochit / adpoint.dart
Last active December 17, 2022 11:16
loyalty card
import 'package:web3dart/web3dart.dart';
// Assume that the contract address and ABI are stored in variables
// called 'contractAddress' and 'contractAbi', respectively
// Create a new instance of the EthereumClient class
final client = Web3Client(rpcUrl, httpClient: httpClient);
// Load the contract using the contract address and ABI
final contract = DeployedContract(
@anoochit
anoochit / pubspec.yaml
Created December 17, 2022 03:37
How you can store an image in Cloud Firestore using Flutter
dependencies:
cloud_firestore: ^0.14.0+2
firebase_storage: ^4.0.0
@anoochit
anoochit / pfxgen.sh
Created November 5, 2022 10:01
generate pfx certificate
openssl genrsa 2048 > filessl.key
chmod 400 filessl.key
openssl req -new -x509 -nodes -sha256 -days 365 -key filessl.key -out filessl.crt
openssl pkcs12 -export -out filessl.pfx -inkey filessl.key -in filessl.crt
@anoochit
anoochit / Podfile
Created September 25, 2022 02:10
podfile example
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
@anoochit
anoochit / flutter_33_note.txt
Created September 6, 2022 02:41
Flutter 3.3 live session note
Flutter 3.3 live session note
* Stable release for all platforms
* SelectAbleArea widget
* Trackpad input
* MD3
* IconButton
@anoochit
anoochit / home_view.dart
Created September 1, 2022 02:54
sample tween animation
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../controllers/home_controller.dart';
class HomeView extends GetView<HomeController> {
const HomeView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {