Skip to content

Instantly share code, notes, and snippets.

View blaqshyd's full-sized avatar
:bowtie:
Activ like Chivita 💆🏾‍♂️

Daniel A blaqshyd

:bowtie:
Activ like Chivita 💆🏾‍♂️
View GitHub Profile
@EsinShadrach
EsinShadrach / animated_fire_icon.dart
Last active February 28, 2026 07:14
a flame icon converted to custom painter for the purpose of animation
class AnimatedFireIcon extends StatefulWidget {
final double size;
final Color color;
const AnimatedFireIcon({
super.key,
this.size = 24.0,
this.color = Colors.white,
});
@OmerFarukOruc
OmerFarukOruc / claude.md
Last active March 14, 2026 14:42
AI Agent Workflow Orchestration Guidelines

AI Coding Agent Guidelines (claude.md)

These rules define how an AI coding agent should plan, execute, verify, communicate, and recover when working in a real codebase. Optimize for correctness, minimalism, and developer experience.


Operating Principles (Non-Negotiable)

  • Correctness over cleverness: Prefer boring, readable solutions that are easy to maintain.
  • Smallest change that works: Minimize blast radius; don't refactor adjacent code unless it meaningfully reduces risk or complexity.
@chooyan-eng
chooyan-eng / main.dart
Created November 24, 2025 08:24
Demonstration for changing nested Navigator size depending on current page.
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
@hawkkiller
hawkkiller / cool_animated_switcher.dart
Last active December 12, 2025 19:40
This is a cool sliding transition for widgets. It's inspired by the wolt_modal_sheet package, which has the same animation but is coupled with the Bottom Sheet/Pages API. This implementation should be also more performant and less fragile.
import 'package:flutter/material.dart';
/// A widget that transitions between two children using a fade and slide animation.
class PageTransitionSwitcher extends StatelessWidget {
const PageTransitionSwitcher({
required this.child,
this.isForwardMove = true,
super.key,
});
import 'package:playcope/lib.dart';
extension OnWidgets on Widget {
Widget withPadding({
double all = 0,
double right = 0,
double left = 0,
double top = 0,
double bottom = 0,
double padding = 0,
@Pranav2918
Pranav2918 / extensions.dart
Created August 25, 2025 05:12
Flutter useful extension 💫
import 'package:flutter/material.dart';
/// ----------------------------
/// 🔹 Spacing Extensions
/// ----------------------------
extension SpaceExtension on num {
SizedBox get h => SizedBox(height: toDouble());
SizedBox get w => SizedBox(width: toDouble());
}
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);
@EsinShadrach
EsinShadrach / levenshtein_distance.dart
Last active March 23, 2025 22:03
If you've ever felt .contains just doens't work for your usecase in dart.
// A string search algorithm that can handle typographical errors and misspellings
// Returns true if there is a match or if strings are similar enough
bool isFound(String string, String search) {
if (search.isEmpty) return true;
final String lowerString = string.toLowerCase();
final String lowerSearch = search.toLowerCase();
// Quick check for exact substring match
if (lowerString.contains(lowerSearch)) return true;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
await NotificationService.instance.initialize();
//YOUR OTHER CODE CAN COME IN HERE
runApp(const MyApp());
@sunderee
sunderee / try_catch.dart
Created February 24, 2025 12:43
Native Dart helpers that use records to return the result or thrown error/exception object.
(T?, Object?) tryCatch<T extends Object>(T Function() function) {
try {
final result = function.call();
return (result, null);
} catch (error) {
return (null, error);
}
}
Future<(T?, Object?)> tryCatchAsync<T extends Object>(