Skip to content

Instantly share code, notes, and snippets.

View GAM3RG33K's full-sized avatar

GAM3RG33K

View GitHub Profile
/**
* Split a single string into multiple paragraphs based on the last
* punctuation found in the substring while iterating.
*
* @param dataString long string which is to be divided into paragraphs
* @param maxAllowedLength number of maximum characters allowed in one
* paragraph.
* @return list of paragraphs
*/
private static List<String> splitParagraph(String dataString, int maxAllowedLength) {
@GAM3RG33K
GAM3RG33K / How I Do PlantUML.md
Created October 1, 2019 12:09 — forked from jerieljan/How I Do PlantUML.md
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist details how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • The stylesheet.iuml file keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
@GAM3RG33K
GAM3RG33K / ReadMe.md
Last active December 3, 2019 09:01
Image asset Theme color Issue

#prerequisite

  • Flutter SDK : master branch
    Flutter 1.12.15-pre.26 • channel master • https://github.com/flutter/flutter.git
    Framework • revision 1b835a722b (6 days ago) • 2019-11-26 23:48:51 -0500
    Engine • revision e3e5f8dabc
    Tools • Dart 2.7.0
    

#setup

@GAM3RG33K
GAM3RG33K / main.dart
Created December 24, 2019 11:13
Cutom Thumb shape Gist
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@GAM3RG33K
GAM3RG33K / main.dart
Created December 28, 2019 16:47
Flutter's Overlay Feature Demo
import 'package:flutter/material.dart';
/*
Overlay allows you to show your desired widget above everything.
All you have to do is pass a `context` and your `widget`. **It will be shown even above the Dialogs as well.**
When using `overlay`, your given widget will be shown above all the widgets.
However, **Keep in mind that the position of the `Overlayed` widget will be in reference to the parent widget area.**
So, **Do not forget to position the widget accordingly.**
@GAM3RG33K
GAM3RG33K / main.dart
Created March 6, 2020 09:56
flutter dialog and option menu dispose issue
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
@echo off
:: ======= Script to restart the adb with new port(5050) and connect a fixed ip through it =======
:: ======= Author: Harshvardhan Joshi =======
:: ======= Date: 28-11-2019 =======
:: set /A port=%1
:: set client_ip=%2
set /A port=5050
set /p client_ip="Enter Mobile device's IP address: "
@GAM3RG33K
GAM3RG33K / custom_gesture_detector.dart
Last active April 29, 2020 11:45
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 / main.dart
Last active July 24, 2020 09:49
[Flutter] Show progress bar based on the response of a method using streams and stream builder
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@GAM3RG33K
GAM3RG33K / master_detail_container.dart
Created January 22, 2021 05:25
Master Detail layout
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
const masterItemTileUnselectedColor = Color(0xFFECEEF0);
const masterItemTileColor = Color(0xFFFFFFFF);
class MasterDetailContainer extends StatefulWidget {
final Map<EntryTileData, EntryViewData> viewData;