Flutter Heroes
26.1K subscribers
272 photos
2 videos
31.1K links
Download Telegram
New post on /r/flutterdev subreddit:

Flutter Challenge is back on the 1st of February!
/r/FlutterChallenges/comments/sbkpfu/flutter_challenge_is_back_on_the_1st_of_february/

January 24, 2022 at 01:04PM by dtengeri
https://ift.tt/3FPVxrC
New post on /r/flutterdev subreddit:

<b>Tried to implements clean architecture but getting error List<dynamic> is not a subtype of Map<String, dynamic></b>
Hey, Guy's I working on my projects where I tried to implement a clean architecture with the bloc for that I follow <a href="https://devmuaz.medium.com/flutter-clean-architecture-series-part-1-d2d4c2e75c47">this article</a> which can explain each and every step very clear and easy way but it was the first time to follow that pattern for use packages like <a href="https://pub.dev/packages/retrofit">retrofit</a> <a href="https://pub.dev/packages/dio">dio</a> <a href="https://pub.dev/packages/json_serializable">json_serializable</a> and generated models and services.Issue:<pre>Unhandled Exception: DioError [DioErrorType.other]: type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>' in type cast </pre>every time I call to get the user function to get the user data (JSON file below) it shows the above error.JSON Response:<pre>[ { "id": 3, "uid": "aoUXxUVkLlgP1jswYM3JTW0f02H3", "display_name": "Kevin Rebort", "email": "kevinrebort@gmail.com", "password": "", "phone_number": "", "photo": "", "email_verified": true, "is_anonymous": false, "is_active": true, "provider": "google.com", "language": "hindi", "dark_theme": false, "layout": "card", "refresh_token": "", "tenant_id": "", "created_at": "2022-01-20T11:55:58.839138+00:00", "last_login": "2022-01-20T11:55:58.839138+00:00" } ] </pre>Note: For every request-response is the same (CURD) or thus is the only response.User Param: core/param/user_param.dart<pre>class UserRequestParam { final String userId; UserRequestParam(this.userId); } </pre>Core Usecases: Core/usecases/usecases.dart<pre>abstract class UseCase<T, P> { Future<T> call({P params}); } </pre>User Entities: data/entities/user.dart<pre>import 'package:equatable/equatable.dart'; class User extends Equatable { final int? id; final String uid; final String? displayName; final String? email; final String? password; final String? phoneNumber; final String? photo; final bool? emailVerified; final bool? isAnonymous; final bool? isActive; final String? provider; final String? language; final bool? darkTheme; final String? layout; final String? refreshToken; final String? tenantId; final String? createdAt; final String? lastLogin; const User({ this.id, required this.uid, this.displayName, this.email, this.password, this.phoneNumber, this.photo, this.emailVerified, this.isAnonymous, this.isActive, this.provider, this.language, this.darkTheme, this.layout, this.refreshToken, this.tenantId, this.createdAt, this.lastLogin, }); @override bool get stringify => true; @override List<Object?> get props { return [ id, uid, displayName, email, password, phoneNumber, photo, emailVerified, isAnonymous, isActive, provider, language, darkTheme, layout, refreshToken, tenantId, createdAt, lastLogin, ]; } } </pre>UserModel: data/model/user_model.dart<pre>import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'user.g.dart'; @JsonSerializable() class UserModel extends Equatable { final int? id; final String? uid; @JsonKey(name: 'display_name') final String? displayName; final String? email; final String? password; @JsonKey(name: 'phone_number') final String? phoneNumber; final String? photo; @JsonKey(name: 'email_verified') final bool? emailVerified; @JsonKey(name: 'is_anonymous') final bool? isAnonymous; @JsonKey(name: 'is_active') final bool? isActive; final String? provider; final String? language; @JsonKey(name: 'dark_theme') final bool? darkTheme; final String? layout; @JsonKey(name: 'refresh_token') final String? refreshToken; @JsonKey(name: 'tenant_id') final String? tenantId; @JsonKey(name: 'created_at') final String? createdAt; @JsonKey(name: 'last_login') final String? lastLogin; const UserModel({ this.id, this.uid, this.displayName, this.email, this.password, this.phoneNumber, this.photo, this.emailVerified, this.isAnonymous, this.isActive, this.provider, this.language, this.darkTheme…
New post on /r/flutterdev subreddit:

Flutter Tap Weekly Newsletter Week 119 - Tutorials, videos, packages, and much more!
https://ift.tt/3KDOuG8

January 24, 2022 at 03:07PM by vensign
https://ift.tt/3KPH3Mj
New post on /r/flutterdev subreddit:

How to Upload Flutter Project on GitHub | Bring Remote Repo Locally
https://ift.tt/3nVRWCm

January 24, 2022 at 05:54PM by rrtutors
https://ift.tt/3rLBgyn
New tweet from FlutterDev:

👾 Have you joined our Hackathon? Try your hand at a fun coding project and see what you can do with Flutter! Submit your solutions with us for a chance to be featured. #FlutterPuzzleHack 🥳 Get started 👉 https://t.co/fH3oUV69UE https://t.co/MyOuxBofGD— Flutter (@FlutterDev) Jan 24, 2022

January 24, 2022 at 06:00PM
https://twitter.com/FlutterDev/status/1485658662790217734
New post on /r/flutterdev subreddit:

fast_ui | An alternative to GetX
https://ift.tt/3Asryow

January 24, 2022 at 06:35PM by Rexios80
https://ift.tt/3GWLbHW
New post on /r/flutterdev subreddit:

Tell me why would I have to use a third party package to handle the state
Don't get me wrong, I'm not challenging anyone, it's just that I've heard of so many libraries to handle the state that so far I don't find them very useful, they contaminate the code at the end it seems that you weren't coding for Flutter.
// Global App State class AppState extends ChangeNotifier { AppState(); bool _isInitializing = true; User user; // ..... } // Use this to manipulate state to prevent rebuilds. class AppScope extends InheritedWidget { const AppScope({ Key? key, required this.state, required this.service, required Widget child, }) : super(key: key, child: child); final AppState state; final AppService service; static AppScope of(BuildContext context) { final result = context.dependOnInheritedWidgetOfExactType<AppScope>(); assert(result != null, 'No AppScope found in context'); return result!; } @override bool updateShouldNotify(AppScope oldWidget) => false; } // If I need an updated reference, every time the state changes I can get the last value class AppNotifier extends InheritedWidget<AppState> { const AppNotifier({ Key? key, AppState? notifier, required Widget child, }) : super(key: key, child: child, notifier: notifier); static AppState of(BuildContext context) { final result = context.dependOnInheritedWidgetOfExactType<AppNotifier>(); assert(result != null, 'No AppNotifier found in context'); return result!.notifier!; } } 


January 24, 2022 at 07:36PM by andrefedev
https://ift.tt/3ogc2Yf
New post on /r/flutterdev subreddit:

How to increase app speed
I'm new to Mobile app development and I created my first app. It's just a simple app that basically just fetches data from my WordPress blog. Currently, I'm hosting my WordPress blog on Hostinger and paying Web Hosting Premium plan (https://www.hostinger.com/pricing)Let's say I release the app on App Store and play store and got a lot of Users. I heard that when there are a lot of users using the app at the same time, the data might be slow and it might crash the app so I'm just wondering how to prevent that or handle it immediately when it happens in the future.If data is taking too long to load on the app for every user then, can I just go to Hostinger and upgrade a plan?. Do you know if this going to fix this kind of issue?I'm just wondering what kind of scenario should I be expecting to happen and how to be ready to fix those kind of issue.

January 24, 2022 at 11:42PM by aase_nomad
https://ift.tt/347GAUs
New post on /r/flutterdev subreddit:

Ashlar Code Editor - made with Flutter
Announcement: Ashlar Code - an editor made with Flutter. Compatible with most Visual Studio Code textmate-based syntax or language grammars and themes.Please support the Android app. It has basic GIT integration with SFTP coming next.https://play.google.com/store/apps/details?id=com.munchyapps.ashlarFree versions are available. Opensource variants of the app are also available:https://github.com/icedman/ashlar-code/Some nice features:Minimap - which make a lot of sense in mobile devices.Multi-Cursor editingUses Flutter API - with heavy Native::FFI. Uses no webkit, no electron, or cordova.Can open sqlite3.c (200K lines of code)

January 25, 2022 at 11:34AM by 1cedm4n
https://ift.tt/3IENwrt
New post on /r/flutterdev subreddit:

Flutter Challenges: Challenge 04
https://ift.tt/3AvvwwI

January 25, 2022 at 02:04PM by __RGgt__
https://ift.tt/3Atcfw1