Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Fluttering

Erick Ghaumez rxlabz

🤖
Fluttering
View GitHub Profile
@rxlabz
rxlabz / snake.dart
Last active Oct 28, 2021
Flutter snake
View snake.dart
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 Oct 9, 2021
Flutter Canvas - CANDY#021.1
View waves.dart
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
View flutter large download crash
% 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
View plugin_demo.swift
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);
}
View plugin_demo.dart
static const MethodChannel _channel = const MethodChannel('plugin_demo');
String platformVersion = await _channel.invokeMethod('getPlatformVersion');
View grid_test.dart
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
FRP with flutter ?
View flurp.dart
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() {
View const_error_demo.dart
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();
}
View gist:0064a29160f8418a34d1437b5df93376
[ ] /usr/local/bin/idevice_id
[ ] which ideviceinfo
[ +3 ms] Exit code 0 from: which ideviceinfo
[ ] /usr/local/bin/ideviceinfo
[ ] which iproxy
[ +3 ms] Exit code 0 from: which iproxy
[ ] /usr/local/bin/iproxy
[ ] which idevicedebug
[ +4 ms] Exit code 0 from: which idevicedebug
[ ] /usr/local/bin/idevicedebug
@rxlabz
rxlabz / gist:7bb9de93b919ef5f7531be7251265995
Created Feb 21, 2017
Flutter : cannot debug over wifi
View gist:7bb9de93b919ef5f7531be7251265995
[ +891 ms] /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
[ +126 ms] Exit code 0 from: /usr/bin/defaults read /Applications/Android Studio.app/Contents/Info CFBundleShortVersionString
[ ] 2.2
[ +11 ms] /Users/rxlabz/Library/Android/sdk/platform-tools/adb devices -l
[ +11 ms] Exit code 0 from: /Users/rxlabz/Library/Android/sdk/platform-tools/adb devices -l
[ ] List of devices attached
622004271815 device usb:336592896X product:a3-a40_ww_gen1 model:A3_A40 device:acer_jetfirefhd
[ +3 ms] idevice_id -h
[ +5 ms] which idevice_id
[ +3 ms] Exit code 0 from: which idevice_id