Skip to content

Instantly share code, notes, and snippets.

View CoderNamedHendrick's full-sized avatar
🥷

Sebastine Odeh CoderNamedHendrick

🥷
View GitHub Profile

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?

@MaherSafadii
MaherSafadii / notes.txt
Last active February 14, 2025 15:43
Cupertino fidelity notes
1. The new CupertinoSliverNavigationbar.search searchfield bar has incorrect horizontal padding and placement.
2. The Cupertino wheel picker doesn't have the fade out effect for the items when they go out of view like with native.
3. The Cupertino wheel picker doesn't make the native tick sound effect when the selected item is changed, i tried playing aroung once to try and fix it, turns out the tick sound is a system sound that you can play using the AudioToolBox (iOS framework), you play the sound by running udioServicesPlaySystemSoundWithCompletion(1157, nil), 1157 is the id of the system sound.
4. There isn't a proper up-to-date toolbar API, instead we only have just trailing and leading for Cupertino nav bars, on native there is a extensive API that allows you to specify that widgets location, including on the bottom of the screen not just the top navigation bar, since the bottom is also considered a toolbar.
5. Adding widgets to CupertinoNavigationBar's leading and trailing is a painful chore, on na
import '/features/architecture/logging.dart';
class CachedQuery<T> {
final Duration invalidation;
final Future<T> Function(String key) fn;
CachedQuery(
this.fn,
this.invalidation,
);
@AkinAguda
AkinAguda / range.ts
Last active January 26, 2024 22:53
A `Range` type in typescript that ensures that a value is within a certain range of positive values (not inclusive of the last)
// Convert string to number
type ToNumber<S> = S extends `${infer N extends number}` ? N : never;
// Creates an array with a particular length
type ArrayWithLength<
T extends number,
A extends number[] = number[],
> = A["length"] extends T ? A : ArrayWithLength<T, [...A, A["length"]]>;
// Generates a union type with all the numbers from zero -> n
@BarryDaBee
BarryDaBee / password_validator.dart
Last active March 2, 2023 13:04
A simple widget for validating password conditions like length >= 8, hasNumber etc
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
@craiglabenz
craiglabenz / chat_message_render_box.dart
Last active March 7, 2025 21:11
Demonstrates a custom RenderObject that draws chat messages like WhatsApp, where the `sentAt` timestamp is tucked into the last line if it fits
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@medwonuola
medwonuola / main.dart
Last active December 27, 2022 16:54 — forked from CoderNamedHendrick/main.dart
Quad selector widget
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@ConnerWill
ConnerWill / ANSI-escape-sequences.md
Last active March 16, 2025 07:57
ANSI Escape Sequences cheatsheet

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@jogboms
jogboms / README.md
Last active February 18, 2025 12:27
Flutter guild presentation - Demo examples
@jogboms
jogboms / space.dart
Created January 24, 2022 06:14
A low-overhead Space widget for all Flex needs
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
class Space extends LeafRenderObjectWidget {
const Space(this.space, {Key? key}) : super(key: key);
final double space;
@override
RenderObject createRenderObject(BuildContext context) => RenderSpace(space: space);