Skip to content

Instantly share code, notes, and snippets.

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

Roi Peker roipeker

🏠
Working from home
View GitHub Profile
@roipeker
roipeker / getx.dart
Last active June 8, 2021 07:56
GetX minified for DartPad or Codepen.
/// GetX v3.24.0 minified version for dartpad and codepen.io
/// roipeker 2021.
///
/// NOTES:
/// - place imports at the top of your gists.
/// - place the rest of the code at the end of it.
///
import 'dart:developer' as developer; import 'dart:async'; import 'dart:collection'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/scheduler.dart'; import 'dart:math' as math; import 'dart:ui' as ui; import 'dart:typed_data'; import 'dart:convert';
// ignore: avoid_web_libraries_in_flutter
import 'dart:html' as html;
@roipeker
roipeker / main.dart
Last active January 30, 2021 01:05
GraphX unified for dartpad...
import 'dart:ui' as ui;
import 'dart:convert';
import 'dart:typed_data';
import 'dart:math' as math;
import 'dart:collection';
import 'dart:developer' as dev;
import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
@roipeker
roipeker / main.dart
Created January 29, 2021 22:41
fixed bg scroll
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: TestPage(),
));
}
class TestPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
@roipeker
roipeker / main.dart
Created January 29, 2021 17:54
Flutter Messenger Chat Bubble Gradient.
/// roipeker 2021
///
/// video sample: https://media.giphy.com/media/qGGcEFHQMOvkijjrSb/source.mp4
///
/// Warning: ShaderMask is NOT supported on WEB.
import 'package:flutter/material.dart';
void main() {
runApp(
@roipeker
roipeker / chart.dart
Created January 26, 2021 22:47
GraphX: Mountain Chart
/// roipeker 2021
/// live demo:
/// https://graphx-mountain-chart.surge.sh/
///
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
void main() {
runApp(MaterialApp(
title: 'GraphX Mountain Chart',
@roipeker
roipeker / storage_service.dart
Created January 20, 2021 19:12
GetX StorageService with GetStorage
/// roipeker 2021
/// part of a bigger template.
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import '../services.dart';
class StorageService extends GetxService implements BaseService {
@roipeker
roipeker / mask_email.dart
Created January 20, 2021 15:42
Mask Email RegExp for Dart
import 'dart:math';
void testMaskEmail() {
final emails = [
'[email protected]',
// output: a****[email protected]
'[email protected]',
// output: a****[email protected]
'[email protected]',
// output: a****[email protected]
@roipeker
roipeker / glowing.dart
Last active January 20, 2021 16:23
Graphx: glowing widget extension (+ custom shapes)
extension MyGlowingExt on Widget {
Widget glowing({
Color color = Colors.blue,
double duration = .5,
double startScale = 0,
double endScale = 1,
double endScaleInterval = 0.8,
double circleInterval = .2,
double replayDelay = .2,
@roipeker
roipeker / root_scene.dart
Created January 17, 2021 03:22
Graphx: Sorting button
/// roipeker 2021
/// just wrap ur app with this, to emit "global" events (and close the dropdown).
///return SceneBuilderWidget(
/// builder: () => SceneController(front: RootScene()),
/// child: MaterialApp(
/// home: Scaffold(
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
@roipeker
roipeker / bookmark_button2.dart
Created January 15, 2021 23:36
GraphX: bookmark button (shorter) (compatible with >0.9.7)
/// use latest graphx 0.9.7
/// idea from: https://dribbble.com/shots/13890969-Bookmark-Button
/// demo: https://graphx-bookmark-btn.surge.sh
/// bookmark gif asset:
/// https://graphx-bookmark-btn.surge.sh/assets/assets/samples/bookmark.gif
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
class BookmarkButton2 extends Sprite {