Skip to content

Instantly share code, notes, and snippets.

View rxlabz's full-sized avatar
🤖
Fluttering

Erick Ghaumez rxlabz

🤖
Fluttering
View GitHub Profile
@rxlabz
rxlabz / main.dart
Created April 1, 2023 19:31
obsidian-diamond-9881
import 'dart:math';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/physics.dart';
const thumbSize = 52.0;
const minTemperature = 0.0;
const maxTemperature = 50.0;
@rxlabz
rxlabz / snake.dart
Last active October 28, 2021 15:59
Flutter snake
import 'dart:async';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
const size = Size(512, 512);
final rd = Random();
const gridSize = 32.0;
const tile = Offset(32, 32);
@rxlabz
rxlabz / waves.dart
Last active October 9, 2021 14:47
Flutter Canvas - CANDY#021.1
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script type="text/javascript">
% flutter run -v
[ +30 ms] [/Users/rxlabz/dev/tools/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +25 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/master
[ ] [/Users/rxlabz/dev/tools/flutter/] git ls-remote --get-url origin
[ +5 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ ] [/Users/rxlabz/dev/tools/flutter/] git log -n 1 --pretty=format:%H
[ +7 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
let controller : FlutterViewController = window?.rootViewController as! FlutterViewController;
let flutterChannel = FlutterMethodChannel.init(name: "plugin_demo", binaryMessenger: controller);
flutterChannel.setMethodCallHandler({
(call: FlutterMethodCall, result: FlutterResult) -> Void in
if ("getPlatformVersion" == call.method) {
result("iOS " + UIDevice.current.systemVersion);
} else {
result(FlutterMethodNotImplemented);
}
static const MethodChannel _channel = const MethodChannel('plugin_demo');
String platformVersion = await _channel.invokeMethod('getPlatformVersion');
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
const kSwatchSize = 36.0;
void main() {
runApp(new MaterialApp(
home: new Scaffold(
body: new Stack(children: [
new Positioned(
@rxlabz
rxlabz / flurp.dart
Last active May 22, 2017 21:55
FRP with flutter ?
import 'dart:async';
import 'dart:ui';
final double devicePixelRatio = window.devicePixelRatio;
final Size logicalSize = window.physicalSize / devicePixelRatio;
final Rect physicalBounds = Offset.zero & (logicalSize * devicePixelRatio);
void main() {
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home:new Scaffold(body:new ConstDemoApp())));
}
class ConstDemoApp extends StatefulWidget {
@override
_ConstDemoAppState createState() => new _ConstDemoAppState();
}