UniBG Pokédex with Flutter
This repository contains the source code of the demo Pokédex (ポケモン図鑑, Pokémon Zukan, lit.: Pokémon Encyclopedia) application that I made for the lecture given for the Scuola di Ingegneria at the University of Bergamo. The application allows users to view the first 151 Pokémon in both list and grid format, navigate to their dedicated page, and view statistics.
📦 Packages
Here are the most interesting packages used in the development of the application with a brief description:
- dartantic_ai: Dartantic is an agentic framework designed to make building client and server-side apps in Dart with generative AI easier and more fun
- json_serializable: Automatically generate code for converting to and from JSON by annotating Dart classes
- palette_generator_master: A powerful Flutter package for extracting prominent colors from images with advanced features and accessibility compliance
- audioplayers: A Flutter plugin to play multiple audio files simultaneously
- flutter_animate: Add beautiful animated effects & builders in Flutter, via an easy, customizable, unified API
- pinch_zoom: A widget based on Flutter's new Interactive Viewer that makes picture pinch zoom, and return to its initial size and position when released
🛠 Compile and Run
Before starting the project you need to run build_runner in order to create the .g.dart files:
dart run build_runner build --delete-conflicting-outputs
You must create a file env.json in the env folder with your Gemini API key:
{
"GEMINI_API_KEY": "YOUR_API_KEY_HERE"
}
To run the app with the environment variables:
flutter run --dart-define-from-file=env/env.json
🎞️ Video Demo
https://github.com/user-attachments/assets/5af0b9ef-92f9-4da3-9cc9-825d7b6c20e7
📱 Screenshots
| Home List | Home Grid | Settings | Single Page (1) | Single Page (2) | Team AI |
|---|
| | | | | |
| | | | | |
🤖 AI Stuff
Dartantic AI
Dartantic AI is an agentic framework that provides a unified API for generative AI integration in Dart and Flutter applications, solving the fragmentation of needing different approaches for each AI provider.
Links:
Key features:
- Multi-provider support — OpenAI, Google (Gemini), Anthropic, Mistral, Cohere, Ollama, OpenRouter, xAI and more, switchable with a single config change
- Agentic multi-step tool calling — autonomous chaining of tool calls to solve complex problems
- Streaming responses — real-time output generation
- Typed outputs — leverages Dart's type system and JSON serialization for structured responses
- Multimedia handling — text, image, and file processing
- Extended reasoning — model thinking/reasoning support across multiple providers
- MCP integration — Model Context Protocol server support
AI Generated Content
Artificial intelligence was used to create parts of the UI, in particular to generate:
- the description of the Pokémon
- the information about the Pokèmon with which it is favoured
- the information about the Pokèmon you are disadvantaged with
- the creation of the best team given the chosen Pokémon
All these prompts can be found in /lib/config/kprompts.dart.
System Instruction
You are **PokeMaster X**, an advanced Pokémon encyclopedic AI optimized for fast, structured, and accurate responses in a mobile environment.
## Core Expertise
- Complete knowledge of all Pokémon species (1–1008), including regional forms, Mega Evolutions, Paradox forms, and alternate forms.
- Detailed data on:
- Types, abilities, base stats, evolution lines, egg groups, habitats
- Move pools (level-up, TM/HM/TR, tutor, signature moves)
- Type effectiveness, weaknesses/resistances, and damage logic
- Strong understanding of:
- Battle systems (single, double, raid, competitive formats)
- Competitive play (tiers like OU/Ubers/LC, EV/IV spreads, natures, items)
- Generation-specific mechanics (Mega Evolution, Z-Moves, Dynamax, Terastal)
## Lore & World Knowledge
- Deep familiarity with all regions (Kanto → Paldea), legendary/mythical Pokémon, and worldbuilding
- Knowledge of anime, movies, and spin-offs (e.g., Legends: Arceus, Let's Go)
## Responsibilities
- Answer clearly and accurately about:
- Pokémon stats, typing, abilities, moves, and evolution
- Battle strategies and counters
- Team building and optimization
- Game progression tips (bosses, gyms, elite four)
- Lore and trivia
- Detect and resolve ambiguity:
- Ask concise clarifying questions when needed (e.g., generation/version differences)
- Prioritize correctness:
- Explicitly state uncertainty or outdated information when applicable
- Do not hallucinate missing data
## Response Style
- Default: concise, structured, mobile-friendly
- Use:
- Bullet points for lists
- Compact tables only when necessary
- Short paragraphs (max 2–3 lines)
- Tone: helpful, expert, slightly playful
## Adaptivity
- Adjust depth dynamically:
- Casual users → simple explanations (e.g., "Water beats Fire")
- Advanced users → technical precision (e.g., EV spreads, damage ranges, meta context)
## Formatting Rules
- Use Pokémon-themed emojis sparingly (e.g., 🔥 ⚡ 🌿 ❄️)
- Highlight key terms (Pokémon names, types, abilities)
- Avoid long walls of text
- Prioritize scannability on small screens
## Constraints
- Do not include unsupported speculation or fan theories unless explicitly requested
- Do not invent mechanics, stats, or moves
- Stay within official Pokémon knowledge unless stated otherwise
Pokémon Description
You chose {pokemonName} as the Pokemon to learn more about. Describe to me in natural language {pokemonName}'s main characteristics, his strengths and weaknesses, his best moves and the moves he has the most difficulty against.
Some indications:
* the strings MUST be in plain text format
* DO NOT use any special characters to handle the new line
* DO NOT include the name of {pokemonName} in the strings
* Each string MUST be a maximum of 450 characters long including spaces
Opponent Advantage
You chose {pokemonName} as the Pokèmon to fight with. Give me a Pokèmon with similar BST that {pokemonName} has an advantage with in terms of type and moves it can use.
Also explain why you chose this Pokèmon.
Some indications:
* the motivation string MUST be in plain text format and MUST contain the reason why the Pokèmon was chosen
* the id MUST be a number between 1 and 151, no leading zeros
* DO NOT use any special characters to handle the new line
* you MUST ONLY use Pokèmon from the first series, so up to number 151
* The types array MUST contain the types of the Pokèmon
* The type MUST be all lowercase
* DO NOT include the name of the chosen Pokèmon in the motivation, give ONLY the reason
* Each string MUST be a maximum of 450 characters long including spaces
* The choosen Pokèmon MUST be in the range of BST +/- 100
Opponent Disadvantage
You chose {pokemonName} as the Pokèmon to fight with. Give me a Pokèmon with similar BST that {pokemonName} is at a disadvantage with in terms of type and moves it can use.
Also explain why you chose this Pokèmon.
Some indications:
* the motivation string MUST be in plain text format and MUST contain the reason why the Pokèmon was chosen
* the id MUST be a number between 1 and 151, no leading zeros
* DO NOT use any special characters to handle the new line
* you MUST ONLY use Pokèmon from the first series, so up to number 151
* The types array MUST contain the types of the Pokèmon
* The type MUST be all lowercase
* DO NOT include the name of the chosen Pokèmon in the motivation, give ONLY the reason
* Each string MUST be a maximum of 450 characters long including spaces
* The choosen Pokèmon MUST be in the range of BST +/- 100
Team Building
You chose {pokemonName} as the Pokèmon to fight with. You have to build a team of 6 Pokèmon, including {pokemonName}, that is as balanced and strong as possible in terms of type, moves to use, weaknesses and strengths. The chosen Pokèmon must be of the same BST as {pokemonName}.
Some indications:
* the list MUST contain the 5 Pokèmon that {pokemonName} is teamed up with.
* DO NOT include {pokemonName} in the list
* the motivation string MUST be in plain text format and MUST contain the reason why the Pokèmon was chosen
* the id MUST be a number between 1 and 151, no leading zeros
* DO NOT use any special characters to handle the new line
* you MUST ONLY use Pokèmon from the first series, so up to number 151
* The types array MUST contain the types of the Pokèmon
* The type MUST be all lowercase
* DO NOT include the name of the chosen Pokèmon in the motivation, give ONLY the reason
* Each string MUST be a maximum of 450 characters long including spaces
* The choosen Pokèmon MUST be in the range of BST +/- 100
* The team MUST consist of at least these types: fire, grass, water, earth, electro, psycho
Examples of well balanced teams:
* Charizard, Lapras, Nidoking, Jolteon, Gengar, Dragonite
* Za