Skip to content

Instantly share code, notes, and snippets.

View pingbird's full-sized avatar
🌺

ping pingbird

🌺
View GitHub Profile
import 'dart:math';
import 'dart:ui' as ui;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
const darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
import 'dart:ffi';
import 'package:ffi/ffi.dart';
late final _crt = DynamicLibrary.open('msvcrt.dll');
late final _setjmp = _crt.lookupFunction<
Int32 Function(Pointer<Uint8> env, Int32),
int Function(Pointer<Uint8>, int)>('setjmp');
late final context = malloc<Pointer<Pointer<Void>>>(128);
import 'dart:math';
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
@pingbird
pingbird / gulpfile.js
Created July 13, 2022 06:14
svg to flutter icons
const gulp = require('gulp');
const iconfont = require('gulp-iconfont');
const ext_replace = require('gulp-ext-replace');
const consolidate = require('gulp-consolidate')
const runTimestamp = Math.round(Date.now() / 1000);
gulp.task('default', function () {
return gulp.src(['icons/*.svg'])
.pipe(
iconfont({
import 'dart:async';
import 'package:clock/clock.dart';
/// Debounces an asynchronous operation, calling [onUpdate] after [add] is used
/// to update [value].
///
/// This class makes a few useful guarantees:
///
/// 1. [onUpdate] will not be called more frequent than [minDuration].
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
const darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
class AppScrollBehavior extends MaterialScrollBehavior {
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@pingbird
pingbird / extension_client.dart
Created March 27, 2022 18:39
Two-way communication with package:integration_test
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:async/async.dart';
import 'package:flutter/cupertino.dart';
import 'package:integration_test/integration_test.dart';
/// A [WidgetsBinding] that serves as the client of ExtensionHost.
///
#!/usr/bin/pwsh
# ADB wifi tool, works on both Windows and Linux!
#
# 1. Finds the phone's IP address on wifi through an existing adb over usb connection
# 2. Puts the phone into TCP/IP mode
# 3. Instructs adb to connect to the phone using its IP address
$interface = adb shell ip addr show wlan0 | Out-String;
if (-not $?) {
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override