Skip to content

Instantly share code, notes, and snippets.

View mohamedrashad102's full-sized avatar

Mohamed Rashad Abdel Aziz Abdel Monem Abdel Aziz mohamedrashad102

View GitHub Profile

How to Show a Snackbar Above a Dialog in Flutter

If you've ever built a complex Flutter app, you've probably run into this annoying UX issue: You open a Dialog, perform an action (like a network request), and trigger a success or error Snackbar. But instead of appearing on top, the Snackbar hides behind the dark overlay of the Dialog!

Here is why this happens and how to fix it permanently.

The Problem: ScaffoldMessenger

By default, Flutter developers use this to show Snackbars:

@mohamedrashad102
mohamedrashad102 / core_reference_prompt.md
Created February 26, 2026 09:17
Prompt template to auto-generate Flutter lib/core reference documentation using AI assistants like Claude or OpenCode.

Prompt Template: Generate Core Reference Documentation

Use this prompt with an AI coding assistant to generate a core library reference document for any Flutter project.


Prompt

Explore and document the lib/core/ directory of this Flutter project to create a quick reference guide for the presentation layer.
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
/// Callback function for token refresh
typedef TokenRefreshCallback =
Future<TokenResponse> Function(String refreshToken);
/// Token response model
class TokenResponse {
final String accessToken;
@mohamedrashad102
mohamedrashad102 / commit-message.toml
Last active October 8, 2025 14:40
Generate professional, standardized Git commit messages following the Conventional Commits format and save them automatically to commit_message.txt.
description = "Generate professional git commit messages following Conventional Commits format and save to txt file"
system = """You are a senior software engineer expert in writing professional Git commit messages. You follow industry best practices and write clear, meaningful commit messages that help teams understand code changes."""
prompt = """
Run git diff --cached to see the staged changes, then generate a commit message following these strict professional guidelines:
**FORMAT REQUIREMENTS:**
- Use Conventional Commits format: `<type>(<scope>): <description>`
- Use imperative mood (e.g., "add", "fix", "update", not "added", "fixed", "updated")
- Capitalize the first letter of the description
import 'dart:ui';
import 'package:flutter/material.dart';
class LetterTracing extends StatefulWidget {
final String letter;
final TextStyle textStyle;
final double coloredStrokeWidth;
final double strokeWidth;
final Color color = Colors.black;