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 / main.dart
Created April 11, 2023 00:02
Creating Particles with Flutter and GraphX #short
/// roipeker 2023.
///
/// #short tutorial: https://youtu.be/I8Yo9jq4hXs
///
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
void main() {
runApp(const MyApp());
@roipeker
roipeker / signal.dart
Last active March 29, 2023 15:16
signal concept in dart
import 'package:flutter/cupertino.dart';
abstract class Entity {
late final onDispose = Signal0();
late bool _disposed = false;
bool get disposed => _disposed;
@mustCallSuper
@roipeker
roipeker / particles.dart
Last active February 25, 2023 22:29
Simple particles system in Graphx.
/// Author: roipeker 2023.
///
/// Particles in GraphX
///
/// video example:
/// https://giphy.com/gifs/VXZ0GvQSRh49AUYX9b
///
Future<void> addParticles() async {
@roipeker
roipeker / lerper.dart
Last active March 20, 2023 01:31
linear interpolation utils (+ easings)
/// Copyright 2022 roipeker
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
@roipeker
roipeker / responsive_graphx_example.dart
Last active October 2, 2022 23:09
responsive concept for graphx.
void main() {
runApp(
MaterialApp(
home: GameWrapper(),
debugShowCheckedModeBanner: false,
),
);
}
@roipeker
roipeker / main.dart
Last active September 30, 2022 03:05
Graphx puzzle grid demo. Image mapping, useful for jigsaw puzzles.
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
/// Live demo:
/// https://graphx-puzzle-ref.surge.sh/
/// Remember, add graphx to your pubspec!
/// You can get the image used in the demo here
/// https://graphx-puzzle-ref.surge.sh/assets/assets/ath.jpg
@roipeker
roipeker / main.dart
Created June 29, 2022 11:23
sample for nir orientation
/// in puspec dependency: native_device_orientation: ^1.1.4
// sample for nir.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:native_device_orientation/native_device_orientation.dart';
@roipeker
roipeker / figma.dart
Last active June 12, 2022 19:19
illustration error lamp robot
// use a CustomPaint and pass the Canvas.
// sample https://ibb.co/TH35KcB
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'dart:ui' as ui;
void drawFigma(Canvas canvas){
Path path;
@roipeker
roipeker / main.dart
Created May 22, 2022 12:52
Flubber Shader
/// roipeker 2022.
///
/// Original Tweet:
/// https://twitter.com/roipekr/status/1527026419649454081
///
///
/// This code uses "shader" package to simplify testing.
/// Add it with: `flutter pub add shader`
///
/// If you want to compile locally, get "shaderc" for your platform [https://github.com/google/shaderc/blob/main/downloads.md]
@roipeker
roipeker / manu_particles.dart
Last active September 22, 2021 00:14
Simple Flutter particles with Stack + Transform
/// roipeker 2021
/// live demo at:
/// https://roi-particles-manu.surge.sh
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:vector_math/vector_math_64.dart' hide Matrix4, Colors;