suesitran / public_chat

A simple public chat for anyone to chat with Gemini
25 stars 40 forks source link

fix chat_bubble_widget: change to stf, extract methods and mixin AutomaticKeepAliveClientMixin #34

Open duong2417 opened 16 hours ago

duong2417 commented 16 hours ago

Fix issue #33

  1. Use "CachedNetworkImage" (from the cached_network_image library) instead of "ImageNetwork":

    • Utilize caching to store images loaded from URLs. Once an image is loaded, it won't need to be fetched from the network again but will instead be retrieved from the cache.
    • Automatically manage cache storage and deletion.
    • Ideal for applications that display multiple or recurring images, saving network data and improving display speed.
  2. ChatBubble:

    • Extract methods for better code readability.
    • Use AutomaticKeepAliveClientMixin: This mixin helps widgets retain their state when they go off-screen, avoiding unnecessary rebuilds.