Giter Site home page Giter Site logo

flyerhq / flutter_chat_types Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 84.0 117 KB

Utility library for the flutter_chat_ui and flutter_firebase_chat_core libraries which contains shared type declarations.

License: MIT License

Dart 100.00%
chat dart flutter

flutter_chat_types's People

Contributors

alihen avatar arsamme avatar demchenkoalex avatar felixgabler avatar jkronlachner avatar marinkobabic avatar voidozzer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flutter_chat_types's Issues

Retrieving images from private endpoints (ImageMessage)

In ImageMessage, is it possible to add the possibility of adding headers for the uri.
Indeed, I wish to retrieve images from an endpoint that requires authentication, which means i have to pass a header such as "Authorization: Bearer ".
Alternatively, is it possible to create an ImageMessage that takes a NetworkImage as an image (and not a path or an URI)?
Thank you very much,

[Bug] User copyWith constructor does not copy existing fields from old object

Consider the code -

user = types.User(
    id: Uuid().v4(),
    firstName: "Test",
    imageUrl: "https:// .... ", 
);

updatedUser = user.copyWith(
    lastSeen: DateTime.now()
);

The newUser contains only id and lastSeen fields. Other fields are null.

Expectation -
updatedUser should also contain all existing non-null fields from the previous User object

Private constructors

Hi,

I'm using your plugin and added some attributes to User and Room by extending them. However I can't do that now with the new update since the constructors are private. Only the factory constructor is available.

Br,
Rippan

Definition of all atributes posibilities

Hello,

I am wondering if there is any file where each atribute is described. For example, I cannot find what an "agent" role for a room is.

Congratulations, good library, Thanks,

Pablo

Question: Extending Message Types

We are evaluating using Flyer (it looks fantastic so far) for a project we are working on. I have one question about Message Types... I see that currently File, Image, and Text are supported. Can the Types be extended easily if we plan to add additional features and use our own backend? If so, is there a suggested way of doing this that will fall in line with future updates to the package?

Thanks for taking the time to answer this :)

Writing Custom Types

writing custom types is a pain currently for me how can it do that can someone reference me please?

copyWith sets roomId to null

General

What bug do you experience? ๐Ÿž

When copyWith is used on a Message Object, the roomId gets set to null.

How can it be reproduced? ๐Ÿค”

  1. Create a TextMessage or ImageMessage Object with a roomId set
  2. use copyWith on this TextMessage
  3. roomId is set to null

This seems to occur because of the way copyWith is implemented:

 @override
  Message copyWith({
    User? author,
    dynamic createdAt = _Unset,
    String? id,
    dynamic metadata = _Unset,
    dynamic previewData = _Unset,
    dynamic remoteId = _Unset,
    dynamic repliedMessage = _Unset,
    dynamic roomId,
    dynamic showStatus = _Unset,
    dynamic status = _Unset,
    String? text,
    dynamic updatedAt = _Unset,
  }) => _TextMessage(
        author: author ?? this.author,
        createdAt: createdAt == _Unset ? this.createdAt : createdAt as int?,
        id: id ?? this.id,
        metadata: metadata == _Unset
            ? this.metadata
            : metadata as Map<String, dynamic>?,
        previewData: previewData == _Unset
            ? this.previewData
            : previewData as PreviewData?,
        remoteId: remoteId == _Unset ? this.remoteId : remoteId as String?,
        repliedMessage: repliedMessage == _Unset
            ? this.repliedMessage
            : repliedMessage as Message?,
        roomId: roomId == _Unset ? this.roomId : roomId as String?,
        showStatus:
            showStatus == _Unset ? this.showStatus : showStatus as bool?,
        status: status == _Unset ? this.status : status as Status?,
        text: text ?? this.text,
        updatedAt: updatedAt == _Unset ? this.updatedAt : updatedAt as int?,
      );

When used, roomId is null and not _Unset. In that case it gets set to null.

What behavior is expected? ๐Ÿ’ก

roomId should not be set to null when copyWith is used.

Environment info

Please specify the flutter, flutter-chat-ui versions.

flutter: 3.19.4
flutter-chat-ui: 1.6.12


Platform

All Platforms


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.