Skip to content

Instantly share code, notes, and snippets.

@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';
@PlugFox
PlugFox / main.dart
Last active November 11, 2025 22:26
Mutex in Dart
import 'dart:async';
import 'package:control/src/mutex.dart';
/// {@template linked_mutex}
/// A mutex implementation using a linked list of tasks.
/// This allows for synchronizing access to a critical section of code,
/// ensuring that only one task can execute the critical section at a time.
/// {@endtemplate}
class LinkedMutex implements Mutex {
@PlugFox
PlugFox / app_navigator.dart
Last active September 4, 2025 06:38
A simple declarative navigation system for Flutter.
import 'dart:collection';
import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// --- Navigator --- //
/// Type definition for the navigation state.
typedef AppNavigationState = List<AppPage>;
@PlugFox
PlugFox / text.dart
Last active October 17, 2024 07:15
Flutter Text Wrappers
import 'package:flutter/material.dart';
import 'package:ui/src/theme/extensions/typography.dart';
/// Helper widget to display text with the App's typography.
///
/// https://docs.flutter.dev/ui/design/text/typography
/// https://m3.material.io/styles/typography/overview
/// https://api.flutter.dev/flutter/material/Typography-class.html
/// https://api.flutter.dev/flutter/widgets/Text-class.html
class AppText extends StatelessWidget {
@PlugFox
PlugFox / index.js
Last active December 30, 2024 13:20
Tampermonkey Auto Scroll Toggle for comick.io
// ==UserScript==
// @name Auto Scroll Toggle for comick.io
// @namespace plugfox
// @version 1.3
// @description Toggle auto scroll on and off with a hotkey, and stop on page blur
// @author @plugfox
// @run-at document-idle
// @homepage https://gist.github.com/PlugFox/7315cad8ef028e2751f4a971ca9d59e9
// @homepageURL https://gist.github.com/PlugFox/7315cad8ef028e2751f4a971ca9d59e9
// @match *://comick.io/*
/* Extension to the Kagi CSS */
/* https://gist.github.com/joshellington/51765a15d8f780089619b638fc6aea6b */
.logo svg, .app-logo, .doggo_sit_a, .footer { display: none }
.m-h .m-app-logo { display: none }
.top_nav_links, #accountContainer .header_links { display: none }
.search-form .search-submit-wrapper .search-submit-wrapper-inner { display: none }
@joshellington
joshellington / kagi-darkmustard-theme.css
Last active July 13, 2025 20:07
A slightly refined, dark-focused, mobile-supported Kagi theme. Works best using Dark Theme, and either Moon Dark or Royal Blue.
:root {
--font-main: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--font-lufga: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
.theme_dark, .theme_moon_dark, .theme_moon_dark_conditional {
--app-bg: #181715;
--page-text: #F2E6D7;
--app-text: #F2E6D7;
--primary: #F2E6D7;
@PlugFox
PlugFox / adaptive_widget.dart
Created June 20, 2023 07:52
Sizer and AdaptiveWidget
import 'package:flutter/widgets.dart';
import 'sizer.dart';
class AdaptiveWidget extends StatefulWidget {
const AdaptiveWidget({
required this.compactChild,
required this.extendedChild,
this.alignment = Alignment.center,
super.key,
});
@PlugFox
PlugFox / example.dart
Last active November 26, 2024 15:24
Flutter Shimmer & Skeleton
void main() => runZonedGuarded<void>(
() => runApp(const App()),
(error, stackTrace) => log('Top level exception $error'),
);
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => MaterialApp(