Skip to content

Instantly share code, notes, and snippets.

View dhruvanbhalara's full-sized avatar
👨‍💻
Focusing

Dhruvan Bhalara dhruvanbhalara

👨‍💻
Focusing
View GitHub Profile
class DashedBorder extends BoxBorder {
const DashedBorder({
this.top = BorderSide.none,
this.right = BorderSide.none,
this.bottom = BorderSide.none,
this.left = BorderSide.none,
this.dashLength = 5.0,
this.dashGap = 3.0,
});
import 'dart:async';
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
class MyConnectivity {
MyConnectivity._();
static final _instance = MyConnectivity._();
static MyConnectivity get instance => _instance;
@dhruvanbhalara
dhruvanbhalara / android.rb
Created October 9, 2024 07:57 — forked from jtmuller5/android.rb
Android and iOS Fastfiles for Flutter App
# android/fastlane/Fastfile
update_fastlane
default_platform(:android)
platform :android do
lane :bump_version_code do
versionCode = File.read("metadata/versionCode").to_i
versionCode = versionCode + 1
import "package:flutter/material.dart";
import "package:google_fonts/google_fonts.dart";
import "memory_usage.dart" if (dart.library.html) 'memory_usage_web.dart';
import "dart:async";
const showMemMonitor = bool.fromEnvironment("SHOW_MEM_MONITOR");
class MemoryMonitor extends StatefulWidget {
const MemoryMonitor({super.key});
@dhruvanbhalara
dhruvanbhalara / fluttercleanrecursive.sh
Created April 18, 2024 06:56 — forked from jeroen-meijer/fluttercleanrecursive.sh
Flutter Clean Recursive - Clear up space on your hard drive by cleaning your Flutter projects. This script searches for all Flutter projects in this directory and all subdirectories and runs 'flutter clean'. Note: may take a long time for folders with large amounts of projects.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script:
# sh ./fluttercleanrecursive.sh
# or
# sudo sh fluttercleanrecursive.sh
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)"
echo "Looking for projects... (may take a while)"

Location Service

you can just create an intsance/(you can register this with get_it/ioc contiainer) for easy usage

import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:your_project_folder/permission_manager.dart';
@dhruvanbhalara
dhruvanbhalara / deploy.yml
Created June 18, 2020 10:51 — forked from apgapg/deploy.yml
Github Workflow for Building, Releasing Flutter web app to Github Pages and Firebase Hosting
# This is a basic workflow to help you get started with Actions
name: Build, Release app to Github Pages and Firebase Hosting
# name: Test, Build and Release apk
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master