Pokedex App with BLoC Part 2 | Day 17 -
HTML-код
- Опубликовано: 9 окт 2024
- Kilo Loco shows you how to build out the navigation of the Pokedex app using the BLoC library. This tutorial will cover app navigation, working with multiple blocs, performing multithreaded networking requests.
** Show Notes and Links **
Project Files:
github.com/Kil...
Kilo Loco on Social Media:
www.kiloloco.com
Discord - / discord
Twitter - / kilo_loco
Instagram - / kilo_loco
#flutter #dartlang #30DaysOfFlutter
Man, the content is so good. It's a shame you have only 5k views
'Future.wait' didn't knew that one. Amazing. Thanks Kilo.
Great Tutorial ! Thank you for this. 😊. One thing which confused me is that, why you used Cubit for api details response why didn't you used the same BLoC pattern ? Please answer this. Thank you!
Great tutorial Kilo!!! THANK YOU VERY MUCHOUUU
Great tutorial! Now I know how Charlie Brown feels! I'm a Bloc head!
Hi, I am glad your getting into Flutter but have you used this in a real world application? Will you prefer Flutter over SwiftUI?
Great tutorial.
Please help.
But how to refresh the page and load the next page?
Thank you.
im stuck on the same step! you found a solution for that? :D
Is every navigation required separate Cubit ? Let's say if I have 10 pages, all pages would pass arguments.
Great series. New to flutter. Is it true when we use Bloc, it doesn't matter if we use StatelessWidget or StatefulWidget, because we are capturing the state in Bloc anyway. thx in advance.
Great tutorial!!
Plz make a video on pagination.
Aweosme video👌👌
Great, tutorial, Thank you so much. I have some small questions, at 46:00, there are errors of null state from the constructor: super (null) and the function popToPokedex() which the emit cannot pass the null state. Here is the error message "The argument type 'Null' can't be assigned to the parameter type 'int'". Please let me know if any ways to fix it because the first running, it shows the index 0 on the detail page if I set null to 0 (cast to integer). Thank you for your help.
fixed: change int to int? for who didn't solve. that take me ages to research only the ? mark. so crazy. Thank @kilo anyway
@@tuann2507 where did you change int to int?
Re: PokemonDetailsView - I used a static Map and function to get the type color (the 'normal' color was reused, I guess it was 'electric')
class PokemonDetailsView extends StatelessWidget {
static const Map kTypeColors = {
'normal': Color(0xFFBDBEB0),
'poison': Color(0xFF995E98),
'psychic': Color(0xFFE96EB0),
'grass': Color(0xFF9CD363),
'ground': Color(0xFFE3C969),
'ice': Color(0xFFAFF4FD),
'fire': Color(0xFFE7614D),
'rock': Color(0xFFCBBD7C),
'dragon': Color(0xFF8475F7),
'water': Color(0xFF6DACF8),
'bug': Color(0xFFC5D24A),
'dark': Color(0xFF886958),
'fighting': Color(0xFF9E5A4A),
'ghost': Color(0xFF7774CF),
'steel': Color(0xFFC3C3D9),
'flying': Color(0xFF81A2F8),
'electric': Color(0xFFF9E65E),
'fairy': Color(0xFFEEB0FA),
};
static Color _getTypeColor(String type) => kTypeColors[type] ?? Colors.black;
...
Hi I'm a new friends here. I like your channel it's awesome. Stay safe and connected please
Nice series 👍 but you are only using material.dart. It would be great to see how to use material.dart for Android Devices and cupertino.dart for iOS devices. Any plans on this?
I managed to remove the line breaks and capitalise the names when bringing in the data!
😍😍😍
Could you make tutorial about appwrite ?
how to use filter and search method
Re: PokemonDetailsView - I used the 'strings' package to capitalize the details.name ... Text(capitalize(details.name))
... I tried the basic_utils package but it conflicted with the http package - the string package is fine.
Instead of one long String for the Pokemon stats I used adjacent Strings -
Text(
'ID: ${details.id}'
' - Weight: ${details.weight}'
' - Height: ${details.height}',
),
...
First