dash_chat icon indicating copy to clipboard operation
dash_chat copied to clipboard

[Question] Does this have null safety?

Open RegisSaffi opened this issue 4 years ago • 5 comments

I know it is no longer in development, but I recently migrated my app to null safety and parsed_text which this library depends on was causing problems, My chat implementation was working properly before migrating, I want to know if there is official implementation of null safety for this library because I can't see it in pub.dev and the one I downloaded dash_chat: ^1.1.15-nullsafety has problems.

RegisSaffi avatar May 28 '21 15:05 RegisSaffi

You should try 1.1.16

fayeed avatar May 29 '21 03:05 fayeed

Also if you are interested there is a v2 branch with new changes if you are willing to try it.

fayeed avatar May 29 '21 03:05 fayeed

Hey, I wasn't willing to try new v2 just yet because I was not doing any new development, just upgrading the app to null safety, that's all.

This is the error I am getting whenever messages list is not empty:

`======== Exception caught by widgets library ======================================================= The following StateError was thrown building ParsedText(dirty):

Bad state: No element

The relevant error-causing widget was: DashChat file:///Users/regissaffi/FlutterProjects/gray/lib/views/pages/chat.dart:88:16 When the exception was thrown, this was the stack: #0 Iterable.firstWhere (dart:core/iterable.dart:516:5) #1 ParsedText.build. (package:flutter_parsed_text/src/parsed_text.dart:129:34) #2 _StringBase.splitMapJoin (dart:core-patch/string_patch.dart:824:27) #3 ParsedText.build (package:flutter_parsed_text/src/parsed_text.dart:118:15) #4 StatelessElement.build (package:flutter/src/widgets/framework.dart:4569:28) ... ====================================================================================================`

Any help to resolve this, and also, how can I try v2 in case this can't be solved just yet?

Thanks!

RegisSaffi avatar May 29 '21 05:05 RegisSaffi

Hey, I just tested this on v1.1.16 and can't reproduce this.

fayeed avatar May 29 '21 06:05 fayeed

Hey, I wasn't willing to try new v2 just yet because I was not doing any new development, just upgrading the app to null safety, that's all.

This is the error I am getting whenever messages list is not empty:

`======== Exception caught by widgets library ======================================================= The following StateError was thrown building ParsedText(dirty):

Bad state: No element

The relevant error-causing widget was: DashChat file:///Users/regissaffi/FlutterProjects/gray/lib/views/pages/chat.dart:88:16 When the exception was thrown, this was the stack: #0 Iterable.firstWhere (dart:core/iterable.dart:516:5) #1 ParsedText.build. (package:flutter_parsed_text/src/parsed_text.dart:129:34) #2 _StringBase.splitMapJoin (dart:core-patch/string_patch.dart:824:27) #3 ParsedText.build (package:flutter_parsed_text/src/parsed_text.dart:118:15) #4 StatelessElement.build (package:flutter/src/widgets/framework.dart:4569:28) ... ====================================================================================================`

Any help to resolve this, and also, how can I try v2 in case this can't be solved just yet?

Thanks!

I also encountered this problem after upgrading to 1.1.16. Plan to downgrade to 1.1.15 again after the issue has been resolved.

Dararii avatar May 31 '21 04:05 Dararii