Skip to content

Instantly share code, notes, and snippets.

View GAM3RG33K's full-sized avatar

GAM3RG33K

View GitHub Profile
@GAM3RG33K
GAM3RG33K / custom_gesture_detector.dart
Last active May 3, 2024 13:09
Advanced multi touch gesture detection in flutter
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'multi_drag_gestures.dart';
typedef GestureMultiDragUpdateCallback = void Function(
Offset initialPosition, Offset latestPosition, double delta);
typedef GestureMultiDragEndCallback = void Function(
Offset initialPosition, Offset latestPosition, double delta);
typedef GestureMultiDragCancelCallback = void Function();
@GAM3RG33K
GAM3RG33K / ReadMe.md
Created February 14, 2020 07:07
A Guide to setup and use Plantuml
@GAM3RG33K
GAM3RG33K / ReadMe.md
Last active September 13, 2023 06:36
maestro.mobile.dev - ReadMe.md for beginners
@GAM3RG33K
GAM3RG33K / Deploy a Flutter Web project on Wildfly server.md
Last active July 26, 2022 20:08
How to deploy a Flutter Web project on Wildfly server

Brief

There are two approaches for deploying a website on "Wild-fly":

  1. Using simple file handlers and URL mapping
  2. By creating and deploying WAR file

Note: Make sure the all the deployment files are ready in a folder and contains the "index.html" file directly under the deployment folder.

@GAM3RG33K
GAM3RG33K / main.dart
Last active December 30, 2021 03:39
Dart implementation for Filter Duplicate numbers
void main() {
/// Mock list of contacts
final _rawContacts = [
// Actual Number: 9000000000
"+919000000000",
"+9190000 00000",
"+91900-000-0000",
"919000000000",
"9190000 00000",
"91900-000-0000",
@GAM3RG33K
GAM3RG33K / offline_sync_manager.dart
Created December 14, 2021 12:57
[Basic] Manage Data to Sync when Offline
import 'package:async/async.dart';
import 'package:dartz/dartz.dart';
/// Pub Packages if not already install
///
/// # Utility Extensions to existing dart classes & methods
/// dartz: ^0.10.1
///
/// # Asynchronous Operation Utilities
/// async: ^2.8.1
@GAM3RG33K
GAM3RG33K / image_process_utils.dart
Created December 3, 2021 12:18
Find Brightness from the image provider
import 'package:flutter/material.dart';
// Add this to pubspec.yaml of your flutter project
// palette_generator: ^0.3.2
// get packages to download the package
import 'package:palette_generator/palette_generator.dart';
/// This method will find & return the most dominant color from the image
@GAM3RG33K
GAM3RG33K / ReadMe.md
Created December 1, 2021 07:20
flutter clean on a collection of projects

Python program to clean all flutter projects from where the script is called

Date: 01-12-2021 Author: Harshvardhan Joshi

Requirements:

  • flutter installed & accessible from cmd
  • python3 installed & accessible from cmd
  • navigate to directory that contains multiple flutter projects

Notes:

@GAM3RG33K
GAM3RG33K / pagination_view.dart
Created November 18, 2021 09:50
Pagination View implementation for Big data source
import 'package:flutter/material.dart';
class PaginationView extends StatefulWidget {
final int maxCountPerPage;
final int totalCount;
final Widget Function(BuildContext context, int start, int end) builder;
final VoidCallback? onNext;
final VoidCallback? onPrevious;
@GAM3RG33K
GAM3RG33K / demo.js
Created October 28, 2021 10:33
Conditional number formatting in Javascript
function conditionalFormatting(value) {
var input = Math.abs(value)
var formatLegth = 2;
if(input == 0) {
formatLegth = 2;
} else if(input > 0 && input <= 1) {
formatLegth = 4;
} else if(input > 1 && input <= 10) {
formatLegth = 3;