Pokemon App
Pokemon App with animations, beautiful UI and network call.
YouTube Tutorials
Hindi
English
Screenshots
Getting Started
For help getting started with Flutter, view our online documentation.
Pokemon App with animations, beautiful UI and network call.
For help getting started with Flutter, view our online documentation.
The app crashed when opening the details about a pokemon who was already in the final stage. Added a conditional statement so that the section is displayed only when the pokemon is not in final form.
my code is :
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:pokemon/pokemon_list_modal.dart'; import 'dart:convert';
void main() => runApp(MaterialApp( title: "Pokemon", theme: ThemeData(primarySwatch: Colors.teal), debugShowCheckedModeBanner: false, home: HomePage(), ));
//MARK:- This is our first Page. class HomePage extends StatefulWidget { // This widget is the root of your application. @override _HomePageState createState() => _HomePageState(); }
class _HomePageState extends State
PokemonList pokemonList;
@override void initState() { super.initState(); getPokemonList(); // fetchData(); }
getPokemonList() async { var res = await http.get(url); var decodedValue = jsonDecode(res.body); pokemonList = PokemonList.fromJson(decodedValue);
print(pokemonList.pokemon[0].name);
}
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Pokemons"),
centerTitle: true,
),
body: pokemonList == null
? Center(
child: CircularProgressIndicator(),
)
: GridView.count(
crossAxisCount: 2,
// children:
Try this :)
Text("Next Evolution", style: TextStyle(fontWeight: FontWeight.bold),), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: pokemon.nextEvolution?.map((n) => FilterChip( backgroundColor: Colors.green, label: Text(n.name, style: TextStyle(color: Colors.white),), onSelected: (b){} ))?.toList() ?? [Text('No more evolutions')] )
Your image file size has been reduced!
| File | Before | After | Percent reduction | |:--|:--|:--|:--| | /ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected] | 10.85kb | 10.68kb | 1.62% | | /ss.png | 323.52kb | 321.17kb | 0.73% | | | | | | | Total : | 334.38kb | 331.85kb | 0.76% |
📝docs | :octocat: repo | 🙋issues | 🏅swag | 🏪marketplace
I was following the code. I got an error. PokeDetail should be a widget so I don't understand why I have this error. here is the code :
import 'pokemonddetail.dart'
Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Poke App"), backgroundColor: Colors.cyan, ), body: pokeHub == null ? Center( child: CircularProgressIndicator(), ) : GridView.count( crossAxisCount: 2, children: pokeHub.pokemon .map((poke) => Padding( padding: const EdgeInsets.all(2.0), child: InkWell( onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => PokeDetail( pokemon: poke, ))); },
the error is :
MaterialPageRoute( builder: (context) => PokeDetail( pokemon: poke, )));
I followed your code and Im getting this Error I/flutter (12085): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter (12085): The following NoSuchMethodError was thrown building HomePage(dirty, state: _HomePageState#4f655): I/flutter (12085): The getter 'pokemon' was called on null. I/flutter (12085): Receiver: null I/flutter (12085): Tried calling: pokemon I/flutter (12085): I/flutter (12085): When the exception was thrown, this was the stack: I/flutter (12085): #0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5) I/flutter (12085): #1 _HomePageState.build package:poke_dex/main.dart:49 I/flutter (12085): #2 StatefulElement.build package:flutter/…/widgets/framework.dart:3825 I/flutter (12085): #3 ComponentElement.performRebuild package:flutter/…/widgets/framework.dart:3736 I/flutter (12085): #4 Element.rebuild package:flutter/…/widgets/framework.dart:3559 I/flutter (12085): #5 ComponentElement._firstBuild package:flutter/…/widgets/framework.dart:3716 I/flutter (12085): #6 StatefulElement._firstBuild
theCode main.dart: import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'pokemon.dart';
void main() => runApp(MaterialApp( title: "PokeDex", home: HomePage(), debugShowCheckedModeBanner: false, ));
class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); }
class _HomePageState extends State
var url ="https://raw.githubusercontent.com/Biuni/PokemonGO-Pokedex/master/pokedex.json";
pokeData pkData ;
@override void initState() {
super.initState();
pullData();
}
pullData() async { var output = await http.get(url); print(output); var decodedJson = jsonDecode(output.body); pkData=pokeData.fromJson(decodedJson) ; }
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("PokeDex"), backgroundColor: Colors.cyan, ), body: GridView.count( crossAxisCount: 2, children: pkData.pokemon.map((poke)=>Card()).toList() ),
drawer: Drawer(child: FlutterLogo(),),
floatingActionButton: FloatingActionButton(onPressed: (){
print(Text("ScrollDown"));
},child: Icon(Icons.search),
backgroundColor: Colors.red,
),
bottomNavigationBar: BottomAppBar(
color: Colors.cyan,
child: Container(height: 50.0,
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
);
} }
flutter_web_nike A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started
Source Code for the App Used in The Flutter Festival Saudi Arabia Session (Arabic) & The Flutter Festival Valsad & Surat Session (English) Inside The
A demonstration of basic Flutter transition animations with Hydro-SDK
BMI_Calculator_Flutter A fully responsive BMI calculator app made using flutter and dart with beautiful minimalistic user interface design and easy to
Use dynamic and beautiful card view pagers (horizontal direction) to help you create great apps. Preview Mobile Vertical Card Pager Web Web Link Insta
TutorialCoachMark Create a beautiful and easy tutorial for your application. Example 1 Example 2 Usage To use this plugin, add tutorial_coach_mark as
Wiwa Chat - A WhatsApp Clone in Flutter A beautiful and fully functional WhatsAp
fluttercocktail A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started
Flutter Tutorial - Quiz App UI Let's create a complete Flutter Quiz App UI from scratch with a beautiful design. Social Media Preview Watch Video ⚡
notice: 豆瓣接口已全部无法使用,本项目也无法正常运行,近期打算更换为 imdb 的接口 ?? Morec - Flutter 版电影应用 English 这是一个非常精美的 Flutter 版电影客户端,利用豆瓣现有的 Api,打造了一个完整的电影展示 App。细节十分完善,是一个经过完整设
Medito App Meditation can positively transform people's lives. We believe no one should have to pay for it. We are the Medito Foundation, and we've bu
(Complete flutter application) Exam and training app as social media, prepared with Firebase backend services, Bloc State management, Singleton design pattern, Unit and widget tests, firebase mocking, Custom local libraries, etc.
travell_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t
Real short video app with firebase and pixels API.Where you can create a short video with pixels' stock videos and also merge your audio.
Chat App Development Front-End and Back-End using Flutter, SocketIo, and NodeJS. (Limited code) ( You can buy the full code on $30 (mail me): devstack
Todioapp A todo and accomplishment app built with Flutter Getting Started This project is a starting point for a Flutter application. A few resources
AnimSearch AnimSearch an App for searching Anime and Manga created with Flutter with data from Jikan API UI Design UI Design inspired by : Crunchyroll
News_Application A new Flutter project. Getting Started This project is a starting point for a Flutter application. Google Sing In. Internet Connctivi
MovieDB Find The Latest trending and upcoming movies and tv shows with MovieDB app. The app contains all info about movies and tv shows. find similar