I have (Chat) Flutter mobile app which uses Lumen as backend. However, I want to cache some things and would like to use Redis for this purpose. Is there a way how Flutter app can speak with Redis? Should I install some package for this or make HTTP request for every caching?
My goal is to store last conversation message.
On backend side I can do something like this:
Redis::hSet('chat1', 'message', 'hello');
But I am not sure how this is going to affect performance... Therefore it would be better to have Redis client on Frontend side (Flutter).
You can use package https://pub.dev/packages/redis
This package is Redis client for Dart
code snippet
import 'package:redis/redis.dart';
...
RedisConnection conn = new RedisConnection();
conn.connect('localhost',6379).then((Command command){
command.send_object(["SET","key","0"]).then((var response)
print(response);
)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With