Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Roi Peker roipeker

🏠
Working from home
View GitHub Profile
@roipeker
roipeker / main.dart
Created Jun 29, 2022
sample for nir orientation
View main.dart
/// 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 Jun 12, 2022
illustration error lamp robot
View figma.dart
// 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
Flubber Shader
View main.dart
/// 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 Sep 22, 2021
Simple Flutter particles with Stack + Transform
View manu_particles.dart
/// 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;
@roipeker
roipeker / main.dart
Created Sep 14, 2021
GraphX sunburst chart concept.
View main.dart
/// made by roipeker 2021.
/// demo: https://graphx-sunburst-chart.surge.sh
import 'package:flutter/material.dart';
import 'package:graphx/graphx.dart';
import 'sunburst.dart';
void main() {
runApp(const MyApp());
@roipeker
roipeker / main.dart
Created Sep 6, 2021
radio slider widget sample.
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
@roipeker
roipeker / about_page.dart
Last active Sep 1, 2021
sample reactive ValueNotifier + StateWidget( Widget build() inside Widget)
View about_page.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:redo_provider/notifier/notifier.dart';
import 'package:redo_provider/state_widget.dart';
class AboutPage extends StateWidget<AboutPageState> {
const AboutPage({Key? key}) : super(key: key);
@roipeker
roipeker / main.dart
Last active Aug 21, 2021
TextFields components variants for drop downs and calendar selection
View main.dart
/// "actionable" TextField samples for Calendar and DropDown.
import 'package:flutter/material.dart';
/// -- main --
void main() {
runApp(
MaterialApp(
theme: ThemeData(
primaryColor: kDarkBlueColor,
@roipeker
roipeker / main.dart
Last active Aug 19, 2021
Rect area tween.
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const MaterialApp(
@roipeker
roipeker / main.dart
Last active Aug 17, 2021
sample keyboard
View main.dart
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {