Skip to content

Instantly share code, notes, and snippets.

View AndrewDongminYoo's full-sized avatar
๐Ÿˆ
My cat is interfering

Dongmin,Yu AndrewDongminYoo

๐Ÿˆ
My cat is interfering
View GitHub Profile
@AndrewDongminYoo
AndrewDongminYoo / frame_timing_logger.dart
Created November 30, 2025 02:19
A minimal frame timing logger that records slow frames to the console/Logcat.
// ๐ŸŽฏ Dart imports:
import 'dart:io';
import 'dart:ui';
// ๐Ÿฆ Flutter imports:
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
// ๐Ÿ“ฆ Package imports:
import 'package:logger/logger.dart';
@AndrewDongminYoo
AndrewDongminYoo / update-dart-globals.sh
Created November 29, 2025 09:20
Setting up a cron job or adding an alias to your shell profile for a shell script that mimics the exact experience of running `brew upgrade` in Homebrew to upgrade all Dart global packages is super convenient!
#!/usr/bin/env bash
# ANSI codes
BOLD="\033[1m"
GREEN="\033[32m"
YELLOW="\033[33m"
RED="\033[31m"
BLUE="\033[34m"
GRAY="\033[90m"
RESET="\033[0m"
@AndrewDongminYoo
AndrewDongminYoo / color_converter.dart
Last active November 22, 2025 00:27
A JsonConverter between Flutter Color (ARGB) and web/Figma-style hex strings using 'RRGGBBAA' (RGBA) format, optionally prefixed with '#'.
// ๐Ÿฆ Flutter imports:
import 'package:flutter/material.dart';
// ๐Ÿ“ฆ Package imports:
import 'package:json_annotation/json_annotation.dart';
/// A [JsonConverter] between Flutter [Color] (ARGB)
/// and web/Figma-style hex strings using `RRGGBBAA` (RGBA) format,
/// optionally prefixed with `#`.
///
@AndrewDongminYoo
AndrewDongminYoo / slide_down_snack_bar.dart
Created November 12, 2025 03:10
A custom snackbar widget that slides down from beneath the app bar area.
// ๐ŸŽฏ Dart imports:
import 'dart:async';
import 'dart:math' as math;
// ๐Ÿฆ Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
/// Extension on [BuildContext] that provides convenient methods for displaying
@AndrewDongminYoo
AndrewDongminYoo / sass_compiler.dart
Created September 9, 2025 10:16
Recursively compiles all '*.module.scss' files under directory into sibling '*.module.css' files.
import 'dart:io';
import 'package:path/path.dart' as p;
import 'package:sass/sass.dart' as sass;
/// Recursively compiles all `*.module.scss` files under directory into sibling `*.module.css` files.
void main(List<String> arguments) {
final src = arguments[0];
final srcDir = Directory('$src');
if (!srcDir.existsSync()) {
@AndrewDongminYoo
AndrewDongminYoo / README.md
Created August 1, 2025 01:33
The Overlay Tooltip widget is a set of widgets for implementing an โ€œOnboardingโ€ or โ€œGuided Tourโ€ feature that walks users through a feature by displaying help (tooltips) sequentially over specific UI elements in your app.

๐Ÿ’ฌ Overlay Tooltip ์œ„์ ฏ

์•ฑ์˜ ํŠน์ • UI ์š”์†Œ ์œ„์— ์ˆœ์ฐจ์ ์œผ๋กœ ๋„์›€๋ง(ํˆดํŒ)์„ ํ‘œ์‹œํ•˜์—ฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ๊ธฐ๋Šฅ์„ ์•ˆ๋‚ดํ•˜๋Š” '์˜จ๋ณด๋”ฉ(Onboarding)' ๋˜๋Š” '๊ฐ€์ด๋“œ ํˆฌ์–ด(Guided Tour)' ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•œ ์œ„์ ฏ ์„ธํŠธ์ž…๋‹ˆ๋‹ค.

โœจ ์ฃผ์š” ๊ธฐ๋Šฅ

  • ์ˆœ์ฐจ์  ํˆดํŒ ํ‘œ์‹œ: displayIndex๋ฅผ ํ†ตํ•ด ์ง€์ •๋œ ์ˆœ์„œ๋Œ€๋กœ ํˆดํŒ์„ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  • ๋™์  ์œ„์น˜ ๊ณ„์‚ฐ: GlobalKey๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋Œ€์ƒ ์œ„์ ฏ์˜ ์œ„์น˜๋ฅผ ๋™์ ์œผ๋กœ ์ฐพ์•„ ํˆดํŒ์„ ์ •ํ™•ํ•˜๊ฒŒ ๋ฐฐ์น˜ํ•ฉ๋‹ˆ๋‹ค.
  • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ์˜ค๋ฒ„๋ ˆ์ด ์ƒ‰์ƒ, ์• ๋‹ˆ๋ฉ”์ด์…˜, ํˆดํŒ ์œ„์น˜ ๋“ฑ ๋‹ค์–‘ํ•œ ์˜ต์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • ํ๋ฆ„ ์ œ์–ด: TooltipController๋ฅผ ํ†ตํ•ด ํˆดํŒ ํ‘œ์‹œ๋ฅผ ์‹œ์ž‘, ์ค‘์ง€, ์ด๋™ํ•˜๋Š” ๋“ฑ ์™„๋ฒฝํ•˜๊ฒŒ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@AndrewDongminYoo
AndrewDongminYoo / keyboard_visibility.dart
Created May 31, 2025 08:54
A subscriber class for managing keyboard visibility events.
// ๐ŸŽฏ Dart imports:
import 'dart:async';
// ๐Ÿฆ Flutter imports:
import 'package:flutter/services.dart';
/// A subscriber class for managing keyboard visibility events.
///
/// This class allows registering callbacks for keyboard visibility changes,
/// including when the keyboard is shown, hidden, or its visibility state changes.
@AndrewDongminYoo
AndrewDongminYoo / email_validation_strategy.dart
Created April 12, 2025 11:15
Dart class that uses a strategy pattern to check the validity of an email
/// Written with โ€œpowerfulโ€ inspiration from the https://pub.dev/packages/email_validator.
/// An abstract strategy for validating objects of type [T].
///
/// Implementations of this class define specific validation rules
/// for a given type, allowing flexible and reusable validation logic.
abstract class ValidationStrategy<T, E extends Exception> {
/// Validates the given [value] of type [T].
///
/// If the validation fails, an exception of type [E] is thrown.
@AndrewDongminYoo
AndrewDongminYoo / device_info.dart
Created March 21, 2025 13:40
ํ˜„์žฌ ํ”Œ๋žซํผ์„ ๊ฐ์ง€ํ•˜๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
// ๐Ÿฆ Flutter imports:
import 'package:flutter/foundation.dart';
// ๐Ÿ“ฆ Package imports:
import 'package:device_info_plus/device_info_plus.dart';
// ๐ŸŒŽ Project imports:
import 'platform_utils.dart';
/// ํ˜„์žฌ ํ”Œ๋žซํผ์„ ๊ฐ์ง€ํ•˜๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
@AndrewDongminYoo
AndrewDongminYoo / platform_utils.dart
Created March 21, 2025 13:38
ํ˜„์žฌ ํ”Œ๋žซํผ์„ ๊ฐ์ง€ํ•˜๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
// ๐Ÿฆ Flutter imports:
import 'package:flutter/foundation.dart';
/// ํ˜„์žฌ ํ”Œ๋žซํผ์„ ๊ฐ์ง€ํ•˜๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
sealed class PlatformUtil {
static TargetPlatform get current => defaultTargetPlatform;
/// ์›น ํ”Œ๋žซํผ์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
static bool get isWeb =>
kIsWeb && !isIOS && !isAndroid && !isWindows && !isMacOS && !isLinux;