Skip to content

Instantly share code, notes, and snippets.

import 'dart:ui' as ui;
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
class _RiskIndicatorPainter extends CustomPainter {
final double risk;
final Color color;
const _RiskIndicatorPainter({required this.risk, required this.color});
@override
void paint(Canvas canvas, Size size) {
const strokeWidth = 8.0;
final radius = (size.shortestSide - strokeWidth) / 2;
final center = Offset(size.width / 2, size.height / 2);
@Piinks
Piinks / notable_instructions.md
Created July 25, 2025 23:31
Compiling Notable Commits

Instructions for Compiling the Weekly Notable Changes Report

This document outlines the comprehensive, step-by-step process for generating the weekly notable changes report for the Flutter repository. Follow these instructions carefully to ensure accuracy and efficiency.

Phase 1: Initial Data Gathering & Curation

  1. Fetch Latest Commits: Ensure the local repository is up-to-date by running git fetch.
  2. Get All Commits from the Last 7 Days: Get a list of all commits that have landed in the past seven days (inclusive of today). Use the following command to get the commit hash and the subject line:

git log --since="7 days ago" --pretty=format:"%H - %s"

This step by step guide uses issue RegEx: add a way to get the positions of groups #42307 as a concrete example. You can also watch associated videos:

Step 0: Ask the team

Ask Dart team before jumping into the implementation. The best place to ask is on the issue tracker, you can also try hackers-dart channel on Flutter Discord or one of the channels on Dart Community discord - but most SDK developers are not on either of them.

Why ask the team?

@jezell
jezell / o1-slides.dart
Created December 6, 2024 07:20
o1 pro slides from json test
import 'package:flutter/material.dart';
import 'package:audioplayers/audioplayers.dart';
class TextSlide {
/// Hex color for the text. Defaults to white (#ffffff) if missing or empty.
final String textColor;
/// Title of the slide. Defaults to empty string if missing.
final String title;
@hawkkiller
hawkkiller / sticky_headers.dart
Created November 23, 2024 12:00
Simple and efficient sticky headers
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
import "package:flutter/material.dart";
class FutureRegistry {
final List<Future> _futures = [];
void register(Future f) {
_futures.add(f);
f.whenComplete(() {
_futures.remove(f);
});
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:uri/uri.dart';
class PathRouteMatch {
PathRouteMatch(
{required this.parameters,
required this.route,
@NoteAfterNote
NoteAfterNote / note-after-note-2024-may-19-termux-usbredirect-qemu.md
Last active October 19, 2025 19:57
Reading and writing a USB drive connected to a Linux server using Termux, termux-usb, usbredirect, and QEMU on a smartphone that is not rooted