Skip to content

Instantly share code, notes, and snippets.

View PlugFox's full-sized avatar
🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@PlugFox
PlugFox / main.dart
Last active November 19, 2025 18:06
InkyIcon widget
/*
* InkyIcon widget.
* https://gist.github.com/PlugFox/097c35feb4cc3da7a4bce2d902b3a75b
* https://dartpad.dev?id=097c35feb4cc3da7a4bce2d902b3a75b
* Mike Matiunin <[email protected]>, 19 November 2025
*/
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@PlugFox
PlugFox / main.dart
Last active November 19, 2025 14:43
Superellipse Input Border for Flutter
/*
* Superellipse Input Border for Flutter
* https://gist.github.com/PlugFox/73fdd4f3d366a8f3e8662768226af36f
* https://dartpad.dev?id=73fdd4f3d366a8f3e8662768226af36f
* Mike Matiunin <[email protected]>, 19 November 2025
*/
import 'package:flutter/material.dart';
void main() => runApp(
@PlugFox
PlugFox / pdf.dart
Created November 12, 2025 18:58
Simple PDF Example
// dart run bin/make_pdf.dart
import 'dart:io';
import 'dart:typed_data';
void main() async {
final pdf = _PdfBuilder();
// Register built-in Type1 fonts (Base-14): Helvetica & Helvetica-Bold
final fontRegular = pdf.addRawObject(
'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>',
@PlugFox
PlugFox / main.dart
Created November 11, 2025 20:18
dart linked list ffi benchmark
// ignore_for_file: avoid_print
import 'dart:ffi' as ffi;
import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:ffi/ffi.dart';
// ============================================================================
// Pure Dart LinkedList Implementation
// ============================================================================
@PlugFox
PlugFox / main.dart
Last active October 21, 2025 13:03
Dart disposable
void Function() dispose = () {dispose = () {};};
void disposable(void Function() fn) {
final $ = dispose;
dispose = () {
try {
fn();
} finally {
$();
}
};
@PlugFox
PlugFox / main.dart
Last active October 16, 2025 14:29
Deep Copy Map
/*
* Deep copy of Map in Dart.
* https://gist.github.com/PlugFox/d651661f465199195edd1c08834b04e8
* https://dartpad.dev?id=d651661f465199195edd1c08834b04e8
* Mike Matiunin <[email protected]>, 16 October 2025
*/
import 'dart:convert' show JsonEncoder;
extension type const CopyMap<K, V>._(Map<K, V> _source) implements Map<K, V> {
@PlugFox
PlugFox / main.dart
Last active October 15, 2025 05:33
Dots Loading Indicator
/*
* Dots Loading Indicator
* https://gist.github.com/PlugFox/e486dcaf99d958973a1f1b1cddea789b
* https://dartpad.dev?id=e486dcaf99d958973a1f1b1cddea789b
* Mike Matiunin <[email protected]>, 14 October 2025
*/
// ignore_for_file: curly_braces_in_flow_control_structures
import 'dart:typed_data';
@PlugFox
PlugFox / drop_zone.dart
Last active October 9, 2025 08:17
Flutter Web Drop Zone
import 'dart:typed_data' show Uint8List;
import 'package:meta/meta.dart' show immutable;
import 'drop_zone_stream_vm.dart'
// ignore: uri_does_not_exist
if (dart.library.js_interop) 'drop_zone_stream_js.dart';
/// {@template drop_zone_event}
/// Events emitted by the [DropZone] stream.
@PlugFox
PlugFox / consent_text.dart
Last active October 2, 2025 19:33
Consent rich text
import 'package:doctorina/src/profile/model/profile_data_codecs.dart';
import 'package:flutter/foundation.dart';
typedef ProfileId = String;
@immutable
class Profile {
const Profile({
required this.id,
required this.name,