Domain-Driven Design + Firebase Flutter Course
Overview
The whole accompanying tutorial series is available at
Comments
-
NoteFailure.unexpected: type '_InternalLinkedHashMap
' is not a subtype of type 'List ' in type cast Hi there,
first things first: A million thanks for the great tutorial.
I'm currently running into a bug that seems to affect this repository as well:
A call after login generates an unexpected error: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List
' in type cast It seems that a feature in freezed is missing here? https://github.com/rrousselGit/freezed/issues/292
I cant figure out a clean way to solve this issue.... Maybe its also a completely different problem (:
-
[Question] SignInFormBloc.mapEventToState() issue
Hi, I'm facing with next error:
error: The type 'Stream
' implied by the 'yield' expression must be assignable to Stream<Null> and it's appearing for every
state.copyWith()
callAny thoughts on it? I'm on Flutter v1.13.6 and Dart v2.8.0
-
The getter 'key' was called on null.
ββββββββ Exception caught by widgets library βββββββββββββββββββββββββββββββββββ The following NoSuchMethodError was thrown building Builder(dirty): The getter 'key' was called on null. Receiver: null Tried calling: key
-
state.copyWith not overriding properties
Hi I have been trying to find out the problem for a whole two days and I still haven't found what the problem is When writing the property_form_bloc with initialNote the state does not update no matter what I do here's the code
`class PropertyFormBloc extends Bloc<PropertyFormEvent, PropertyFormState> { final IPropertyFacade _propertyFacade; PropertyFormBloc(this._propertyFacade) : super(PropertyFormState.initial());
@override Stream
mapEventToState( PropertyFormEvent event, ) async* { yield* event.map( initialized: (e) async* { e.initialPropertyOption.fold( () => state, (initialProperty) => state.copyWith( isEditing: true, property: initialProperty ) ); print("current state is now $state"); }, nameChanged: (e) async* { print("name changed ${e.name}"); yield state.copyWith( property: state.property.copyWith(name: PropertyName(e.name)), saveFailureOrSuccessOption: none() ); }, descriptionEvent: (e) async* { yield state.copyWith( property: state.property.copyWith(description: e.description), saveFailureOrSuccessOption: none() ); }, saved: (e) async* { Either<ClassFailure, String> failureOrSuccess; yield state.copyWith( isSaving: true, saveFailureOrSuccessOption: none() ); if(state.property.name.isValid() && state.property.description.length > 5) { failureOrSuccess = state.isEditing ? await _propertyFacade.updateProperty(state.property) : await _propertyFacade.createProperty(state.property); } yield state.copyWith( isSaving: false, showErrorMessages: true, saveFailureOrSuccessOption: optionOf(failureOrSuccess) ); } );
} }` Am I missing something? When I log out the initial property in this case it logs out the initialPropertyOption but is unable to update the state. Any answer is welcome
-
"signInWithEmailAndPasswordPressed()" asking for an argument in "sign_in_form.dart" file
Hello. Any help on updating this snippet of code since "context.bloc" is deprecate already.
FlatButton( onPressed: () { context.bloc
().add( const SignInFormEvent .signInWithEmailAndPasswordPressed(), ); I tried with "context.read" instead but ".signInWithEmailAndPasswordPressed()," asks for an argument then. Thanks your help.
-
Classes can only mix in mixins and classes.
Hi, I just finished the 4th video of the series, I am facing these problems and I cant quite find the solution, am I missing out something? ` part of 'sign_in_form_bloc.dart';
@freezed abstract class SignInFormState with _$SignInFormState { const factory SignInFormState({ @required EmailAddress emailAddress, @required Password password, @required bool showErrorMessages, @required bool isSubmitting, @required Option<Either<AuthFailure, Unit>> authFailureOrSuccessOption, }) = _SignInFormState;
factory SignInFormState.initial() => SignInFormState( emailAddress: EmailAddress(''), password: Password(''), showErrorMessages: false, isSubmitting: false, authFailureOrSuccessOption: none(), ); }
`
error: Classes can only mix in mixins and classes. error: The name '_SignInFormState' isn't a type and can't be used in a redirected constructor. Try redirecting to a different constructor.
-
Error getting notes
I'm getting an error in the watchAll method because the mapping is not working.
It's seems to be something related with the kt_dart package.
The exception is "type 'DartList
' is not a subtype of type 'KtList '" when I call to the method: toImmutableList() I used the latest version (0.8.0) and the same like this repository: ^0.7.0+1
Any idea about the error?
Thanks in advance.
-
firebase_auth 0.18.0+1 (Current Lastest) Breaks on Firebase Auth Facade "getSignedInUser()" Method
- Hello, Thanks for this video series of a clean arquitecture in flutter, I have an issue on
@override Future<Option<User>> getSignedInUser() => ...
- When update to firebase 0.18.0+1 this method breaks
_firebaseAuth.currentUser().then((firebaseUser) => optionOf(firebaseUser?.toDomain()));
- Because access to current user via currentUser () is now synchronous via currentUser in the new update.
-
NoteRepository.watchAll() hangs
I have a strange bug. In below code of the NoteBloc:
- the NoteWatcherState.loadInProgress is fired.
- I also see that the _noteRepository.watchAll function is executed.
- But it stays in the NoteWatcherState.loadInProgress and doesn't continue.
- There is no error at all.
- All the Authentication code works by the way, and I could retrieve a document from firestore directly from the notes_overview_page.
I built the app two times from scratch following the tutorial. I tried to debug, but the debug simply ignores everything after this line: _noteStreamSubscription = _noteRepository.watchAll().listen(
Does anybody know what could cause this? I'm somehow stuck without any errors or debug capabilities.
NoteWatcherBloc
yield* event.map( watchAllStarted: (e) async* { yield const NoteWatcherState.loadInProgress(); await _noteStreamSubscription?.cancel(); _noteStreamSubscription = _noteRepository.watchAll().listen( // <-- debug doesn't go into here and simply ignores it (failureOrNotes) => add(NoteWatcherEvent.notesReceived(failureOrNotes)), // <-- this is not executed, no idea why, no error. ); },
NoteRepository
@override Stream<Either<NoteFailure, KtList<Note>>> watchAll() async* { final userDoc = await _firestore.userDocument(); print("Its listening"); // <-- I see that this is printed when i reload yield* userDoc.noteCollection // <-- no idea if this is actually done .orderBy('serverTimeStamp', descending: true) .snapshots() .map((snapshot) => right<NoteFailure, KtList<Note>>( snapshot.documents .map((doc) => NoteDto.fromFirestore(doc).toDomain()) .toImmutableList(), ) ) .onErrorReturnWith((e) { // <-- no error here. if(e is PlatformException && e.message.contains('PERMISSION_DENIED')) { print("platformexception"); return left(const NoteFailure.insufficientPermission()); } else { // log.error(e.toString()) print("unexpected"); return left(const NoteFailure.unexpected()); } }); }
-
How To Access The Failed Value From Either?
A good description of the issue can be found here:
In the example below, we have:
- Type:
Either<RangedNumberValueFailuresAbstract<int>, int>
- If No Error:
right(number)
- If Error:
left(RangedNumberValueFailuresAbstract.invalidNumber(failedNumberValue: number))
If we need to access the failedNumberValue in (failedNumberValue: number), how would we do it?
- Type:
-
[Question] about state in BLoC
I don't see where the variables
state
is declared in the code. How does this work?https://github.com/ResoCoder/flutter-ddd-firebase-course/blob/66102ccc14122893bd5b9ba35dbff2faeb813da8/lib/application/auth/sign_in_form/sign_in_form_bloc.dart#L39
-
Updated Version of Flutter DDD Firebase Course (2022) - ResoCoder
Hello all, I wanted to update this repository while I learned it.
You can find updated codes from the repository link: https://github.com/alper-efe-sahin/flutter_firebase_ddd_bloc_2022
Also, you can read about it from the Medium story here: https://medium.com/@sahinefe/updated-version-2022-flutter-firebase-ddd-course-domain-driven-design-principles-by-reso-5ebe906a449d
-
Unhandled Exception: type 'Freezed' is not a subtype of type 'ValueObject
' of 'other' i am getting an error on the emailChanged event. when i type in the textformfield i get Unhandled Exception: type 'Freezed' is not a subtype of type 'ValueObject
' of 'other'. the error points me to the freezed bloc file, specifically:
@override $Res call({ Object? emailAddress = freezed, Object? password = freezed, Object? isSubmitting = freezed, Object? showErrorMessages = freezed, Object? authFailureOrSuccessOption = freezed, }) { return then($_SignInFormState( emailAddress: emailAddress == freezed ? _value.emailAddress : emailAddress // ignore: cast_nullable_to_non_nullable as EmailAddress, password: password == freezed ? _value.password : password // ignore: cast_nullable_to_non_nullable as Password,
When i change the emailAddress: emailAddress == freezed ? _value.emailAddress into something like emailAddress: emailAddress == bool ? _value.emailAddress. the error changes to Unhandled Exception: type 'bool' is not a subtype of type 'ValueObject
' of 'other'. is there something wrong with freezed?? -
Refactor AutoRoute according to new implementatiaon
- Replace builder ExtendedNavigator with AutoRouterDelegate and routeInformationParser in app_widget.dart.
- Deleted generateNavigationHelperExtension in router.dart.
- Replaced MaterialRoute with AutoRoute in router.dart.
- Replaced ExtendedNavigator.of(context).replace with context.router.replace in splash_page.dart.
- Update auto_route version in pubspec.yaml.
-
Json serialization with with deep class object Id and JsonKen(ignore:true)
I want to moving the code to Flutter 2.2 When I attempt to go on the note detail, I same the TodoListItem Id is null (but it is not null on firebase firestore), it happen when the TodoListItem Dto is in the toDomain method; I got this error
CastError (Null check operator used on a null value)
Anyone can help me ? -
Lot of issues with Flutter 2 Null Satefy
Hello, I am struggling a lot since 1 week, to make the whole code compatible with Flutter null safety and new versions of packages. Can you please make a little video or write a little thing explaining how we can do that ? Thanks a lot Resocoder :-)
Crypto Loss Gain Calculator App build with Flutter. It developed with DDD (Domain Driven Design) principles.
Crypto Loss Gain Calculator Crypto Loss Gain Calculator App build with Flutter. It developed with DDD (Domain Driven Design) principles. Domain-Driven
Flutter_ddd - Experimental Flutter project with Domain-Driven Design
flutter_ddd Notes app sample in Dart / Flutter with DDD. This is an outcome of my attempt to understand Domain-Driven Design and consider how I can in
Flutter starter project - boilerPlate for Clean Architecture with Domain-Driven-Design with commonly used dependencies
flutter_starter_project A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you
Flutter Architecture inspired by Domain Driven Design, Onion and Clean Architecture
Inspiring Domain Driven Design Flutter Architecture Please take a look at my slides to learn more Strategic Domain Driven Design For Improving Flutter
Multi Translator build with Flutter, It developed with DDD (Domain Driven Design) principles.
Multi Translator App An app utilizes to translate any text to multiple languages. Features Localization Multiple Translation Single Translation Deep L
This project follows the Reso Coder course for flutter test-driven-development with clean architecture and BloC state management for a random trivia simple app.
This project follows the Reso Coder course for flutter test-driven-development with clean architecture and BloC state management for a random trivia simple app.
Flutter-course - Projects of the course to learn Flutter!
?? Flutter Course Projects of the course to learn Flutter! ?? What is it? Repo with all projects made during the Flutter Course provided by Daniel Cio
Flutter course chatapp - A Flutter Course Chat App Starter
flutter_course_chat_app_starter Getting Started Firebase installations 1- Open F
Actively maintained, community-driven Firebase BaaS for chat applications with an optional chat UI.
Flutter Firebase Chat Core Actively maintained, community-driven Firebase BaaS for chat applications with an optional chat UI. Flyer Chat is a platfor
The domain specific language in dart for flutter widgets.
Rettulf !esrever ni stegdiw etirW Getting started import 'package:rettulf/rettulf.dart'; void main() => const MyApp().runAsApp(); class MyApp extend
Lightweight internet connection test, lookup a domain.
palestine_connection Lightweight internet connection test, lookup Google domain. Part of PalestineDevelopers project Features Periodic internet connec
A Dart-native lightweight Apache Pulsar client primarily focused on the IoT telemetry domain
pulsar_iot_client A lightweight Apache Pulsar client primarily focused on the IoT telemetry domain. This project aims to improve the resulting perform
COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with JSON.
Covid App COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with
A community-driven hot deals sharing app developed with Flutter.
hotdeals-app hotdeals-app is an online marketplace app developed with Flutter. The app's Backend can be found here. Table of Contents Screenshots Feat
An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Lint for Dart/Flutter lint is a hand-picked, open-source, community-driven collection of lint rules for Dart and Flutter projects. The set of rules fo
Flutter mvvm archi - Flutter Advanced Course - Clean Architecture With MVVM
flutter_mvvm_archi A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start
All projects from my Flutter Animations Course
Flutter Animations Course | Code With Andrea This repo contains all the projects from my Flutter Animations Course. The main project for this course i
Introductory course to learn Dart/Flutter
Flutter Workshop About Introductory course to learn mobile development using Dart/Flutter. The course is structured to allow you to select the content
App that simulates a flow of screens for the course of navigation and routes with nuvigator through Flutter
Rotas app App que simula um fluxo de telas para o curso de navegação e rotas com