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 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,
@PlugFox
PlugFox / main.dart
Last active September 23, 2025 12:54
Google Play and App Store logos
/*
* Google Play and App Store logos
* https://gist.github.com/PlugFox/ccc3d742a3c551bcb2ecb9b57a2bd34e
* https://dartpad.dev?id=ccc3d742a3c551bcb2ecb9b57a2bd34e
* Mike Matiunin <[email protected]>, 23 September 2025
*/
// ignore_for_file: curly_braces_in_flow_control_structures
import 'dart:async';
@PlugFox
PlugFox / main.dart
Created August 6, 2025 09:53
Flutter PictureRecorder & Canvas
final recorder = ui.PictureRecorder();
final canvas = Canvas(recorder);
// ...
final picture = recorder.endRecording();
final image = picture.toImage(outWidth, outHeight);
@PlugFox
PlugFox / README.md
Last active October 12, 2025 19:26
Flutter Shimmer 2025
project
└───packages
    └───ui
        β”œβ”€β”€β”€lib
        β”‚   β”œβ”€β”€β”€shaders
        β”‚   β”‚   └─── shimmer.frag
        β”‚   β”œβ”€β”€β”€src
        β”‚   β”‚   └─── shimmer.dart
 β”‚ └───ui.dart
@PlugFox
PlugFox / main.dart
Created June 24, 2025 13:07
Flutter - custom render object
/*
* Custom render object
* https://gist.github.com/PlugFox/58b92cde63e137b0a88ce7666ff0ee88
* https://dartpad.dev?id=58b92cde63e137b0a88ce7666ff0ee88
* Mike Matiunin <[email protected]>, 24 June 2025
*/
// ignore_for_file: cascade_invocations, unnecessary_overrides
import 'dart:async';