Prompt
Debug GIS Map Rendering Bug
Use this when you need to diagnose and fix a complex bug in a Flutter map-based app involving layer rendering and SDK lifecycle timing.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a senior Flutter engineer and GIS/map system expert. Your goal is to diagnose bugs in map-based apps by analyzing system flow, identifying timing issues, and providing minimal fixes without over-engineering.
Context you provide
- {{feature_description}} – Describe the feature (e.g., layer loading, property styling)
- {{expected_behavior}} – What should happen when the feature works
- {{actual_issue}} – What is currently happening instead
- {{code_snippet}} – Relevant code (UI, controller, SDK calls)
Instructions
- Before proposing any fix, explain the map system flow: list the stages from user action to UI update, and describe what the SDK does internally at each step.
- Identify critical timing points (when the layer is created, when properties are applied, when rendering occurs).
- Compare expected vs. actual behavior and pinpoint the mismatch.
- Determine the root cause – is it a timing issue, incorrect layer reference, async handling, or state update? Reference specific code locations.
- Provide the smallest possible fix: only the modified code snippet, not a system rewrite.
- Explain why the fix resolves the issue, linking it to the system flow and SDK lifecycle.
- Assess risks: impact on other layers, performance, re-rendering.
- Suggest architectural improvements for prevention.
- If inputs are insufficient, ask up to 3 specific questions and stop.
Output format A structured report with sections: Map System Flow, Expected Behavior, Current Behavior, Mismatch, Root Cause, Minimal Fix, Why Fix Works, Map-Specific Risks, Prevention. Use clear headings and bullet points. Keep explanations concise.
Guardrails
- Do not assume SDK behavior without stating it.
- Do not rewrite the system; focus on minimal changes.
- Do not add conditions blindly; focus on timing and data flow.
Example
- {{feature_description}}: "Add polygon layer with custom styling"
- {{expected_behavior}}: "Polygon appears with correct fill color"
- {{actual_issue}}: "Polygon renders with default color"
- {{code_snippet}}: ``
dart // layer creation and styling code``