Domain-Driven Design + Firebase Flutter Course

Overview

Domain-Driven Design + Firebase Flutter Course

The whole accompanying tutorial series is available at πŸ‘‰ this link πŸ‘ˆ .

Find more tutorials on resocoder.com


DDD Architecture Proposal




Reso Coder
Be prepared for real app development

Comments
  • NoteFailure.unexpected: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'List<dynamic>' in type cast

    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 (:

    opened by derhelge 4
  • [Question] SignInFormBloc.mapEventToState() issue

    [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() call image

    Any thoughts on it? I'm on Flutter v1.13.6 and Dart v2.8.0

    opened by sQuark23 4
  • The getter 'key' was called on null.

    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

    opened by amitsingh6391 3
  • state.copyWith not overriding properties

    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

    opened by BrianMwas 2
  • "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.

    opened by woodsoul507 1
  • Classes can only mix in mixins and classes.

    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.

    opened by Burak-Yavas 1
  • Error getting notes

    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.

    opened by jamontes79 1
  • firebase_auth 0.18.0+1 (Current Lastest) Breaks on Firebase Auth Facade

    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.
    opened by A1000carZ 1
  • NoteRepository.watchAll() hangs

    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());
          }
        });
      }
    
    opened by chstrong 1
  • How To Access The Failed Value From Either?

    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?

    opened by Ezirius 1
  • [Question] about state in BLoC

    [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

    opened by jpiabrantes 1
  • Updated Version of Flutter DDD Firebase Course (2022) - ResoCoder

    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

    efe4

    opened by alperefesahin 2
  • Unhandled Exception: type 'Freezed' is not a subtype of type 'ValueObject<String>' of 'other'

    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??

    opened by Jordanus123 0
  • Refactor AutoRoute according to new implementatiaon

    Refactor AutoRoute according to new implementatiaon

    1. Replace builder ExtendedNavigator with AutoRouterDelegate and routeInformationParser in app_widget.dart.
    2. Deleted generateNavigationHelperExtension in router.dart.
    3. Replaced MaterialRoute with AutoRoute in router.dart.
    4. Replaced ExtendedNavigator.of(context).replace with context.router.replace in splash_page.dart.
    5. Update auto_route version in pubspec.yaml.
    opened by NestorBurma1 0
  • Json serialization with with deep class object Id and JsonKen(ignore:true)

    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 ?

    opened by excellencemichel 3
  • Lot of issues with Flutter 2 Null Satefy

    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 :-)

    opened by SinaArdehali 6
Owner
Reso Coder
Transforming your Flutter app dev skills at http://resocoder.com 🎯
Reso Coder
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

Selim Üstel 9 Dec 27, 2022
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

Kabo 90 Dec 18, 2022
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

MJ Montes 0 Jan 2, 2022
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

Majid Hajian 324 Dec 25, 2022
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

Selim Üstel 7 Dec 27, 2022
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.

Tomas B Sarmiento Abella 1 Jan 5, 2022
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

AlΓ­cia Foureaux 1 Jan 3, 2022
Flutter course chatapp - A Flutter Course Chat App Starter

flutter_course_chat_app_starter Getting Started Firebase installations 1- Open F

Dhari 0 Jan 5, 2022
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

Flyer Chat 173 Jan 2, 2023
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

Li plum 4 Dec 21, 2022
Lightweight internet connection test, lookup a domain.

palestine_connection Lightweight internet connection test, lookup Google domain. Part of PalestineDevelopers project Features Periodic internet connec

Palestine Developers 5 Jun 26, 2022
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

Mike Zolotarov 5 May 10, 2022
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

Sandip Pramanik 4 Aug 4, 2022
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

Halil İbrahim Durmuş 21 Jan 4, 2023
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

Pascal Welsch 257 Jan 3, 2023
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

Namesh Kushantha 0 Jan 8, 2022
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

Andrea Bizzotto 193 Dec 30, 2022
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

rosie 22 Dec 17, 2022
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

Heliomar P. Marques 1 Dec 19, 2021