Skip to content

Instantly share code, notes, and snippets.

@PlugFox
PlugFox / main.dart
Last active June 11, 2025 10:11
A simple declarative navigation system for Flutter.
/*
* Declarative Navigation
* A simple declarative navigation system for Flutter.
* https://gist.github.com/PlugFox/aaa2a1ab4ab71b483b736530ebb03894
* https://dartpad.dev?id=aaa2a1ab4ab71b483b736530ebb03894
* Mike Matiunin <[email protected]>, 14 March 2025
*/
import 'dart:async';
import 'dart:collection';
@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 May 13, 2025 17:17
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(
@PlugFox
PlugFox / dependencies.dart
Last active March 2, 2024 09:23
Log collector and application initialization with dependencies
/// Dependencies
abstract interface class Dependencies {
/// The state from the closest instance of this class.
factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context);
/// Database
abstract final Database database;
}
final class $MutableDependencies implements Dependencies {
@PlugFox
PlugFox / database.dart
Last active March 18, 2024 11:32
Key Value extension for SQLite (Drift)
import 'package:database/src/platform/io.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'package:database/src/platform/js.dart';
import 'package:database/src/queries.dart';
import 'package:drift/drift.dart';
import 'package:meta/meta.dart';
part 'database.g.dart';
/// Key-value storage interface for SQLite database

General Purpose

part 'theme.g.dart';

@ThemeGen(name: 'Light')
class _$AppThemeLight {}

@ThemeGen(name: 'Dark')
class _$AppThemeDark {}