Skip to content

Instantly share code, notes, and snippets.

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

Muhammad Dafi dafinoer

🏠
Working from home
View GitHub Profile
@dafinoer
dafinoer / fastfile.rb
Created May 26, 2024 15:11
Flutter automate upload APK file to Firebase App Distribute with Fastline.
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@dafinoer
dafinoer / protobuf_setup.gradle
Last active September 10, 2023 17:03
Setup gradle file protobuf Kotlin
android {
sourceSets {
main {
proto {
// Directory Default Proto
srcDir 'src/main/proto'
}
}
}
}
if(keystoreProperties['storeFile']){
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
} else {
storeFile file('DevKeyStore.jks')
storePassword 'xxxxx'
keyAlias 'alias your app'
keyPassword 'xxxx'
class PdfUtil {
final doc = pdf.Document();
final PdfPageFormat? formatPage;
PdfUtil(this.formatPage);
Future<Uint8List> buildPdf(pdf.Widget widget) {
doc.addPage(pdf.Page(
build: (pdf.Context context) => widget,
pageFormat: formatPage,
void _setupChopper() {
final httpx = HttpClient();
httpx.findProxy = (url) => 'PROXY <ip_address_from_postman>:9090';
httpx.badCertificateCallback =
(X509Certificate cert, String host, int port) => true;
_client = ChopperClient(
converter: JsonConverter(),
baseUrl: baseurl,
client: http.IOClient(httpx),
import 'package:bagidua/screens/food/detail_food_page.dart';
import 'package:bagidua/screens/home_page.dart';
import 'package:bagidua/screens/order/order_page.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
class RoutesHandler {
static dynamic homeHandler() {
return Handler(
class RouteName {
static const String login = '/login';
static const String register = '/register';
static const String home = '/home';
static const String detailFood = '/detail/food';
static const String order = '/order';
@dafinoer
dafinoer / main.dart
Last active November 14, 2019 10:20
//singleton
class User{
static final User _user = User._private();
User._private(){}
factory User.singleton(int ids){
return _user;
void main(){
/// 1. forEach
var perusahaan = ['bukalapak', 'tokopedia', 'blibli', 'salestock'];
perusahaan.forEach((data)=> print(data)); /// bukalapak tokopedia blibli salestock
///2
var perusahan_id = perusahaan.map((data)=> '${data} indonesia').toList();
print(perusahan_id);
///3
void main(){
/// 1. forEach
var perusahaan = ['bukalapak', 'tokopedia', 'blibli', 'salestock'];
perusahaan.forEach((data)=> print(data)); /// bukalapak tokopedia blibli salestock
///2
var perusahan_id = perusahaan.map((data)=> '${data} indonesia').toList();
print(perusahan_id);
///3