Skip to content

Instantly share code, notes, and snippets.

View CoderNamedHendrick's full-sized avatar
🥷

Sebastine Odeh CoderNamedHendrick

🥷
View GitHub Profile
@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
@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
import '/features/architecture/logging.dart';
class CachedQuery<T> {
final Duration invalidation;
final Future<T> Function(String key) fn;
CachedQuery(
this.fn,
this.invalidation,
);
@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

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 / action.yaml
Last active March 26, 2025 09:16
Build Flutter Engine
# .github/actions/build-engine/action.yml
name: ""
description: "Build the engine with a specific gclient setup and config name"
inputs:
gclient:
description: "gclient name"
required: false
default: ""
config_name:
description: "name of a valid et config"