I want to create a cookie for storage for a post request but i am facing challlenges on what to understand
I tried creating a cookie class and a handle cookie method but the creation doesnt seem to work and it stops my login from working
For saving any data to local storage of the device you can use several solutions in flutter.
the most basic solution is shared preferences. You can store primitive data types and String lists with this. https://pub.dev/packages/shared_preferences
If you want to encrypt the storing data you can use https://pub.dev/packages/flutter_secure_storage.
For storing more complex data you can use a library like hive. Hive provides features for storing model classes. https://pub.dev/packages/hive. Also, you can encrypt stored data by hive and flutter_secure_storage combination.
As another option you can use sql database with sqflite plugin. https://pub.dev/packages/sqflite. If you are not going to manage really large amount of data, I recommend using hive instead of sqflite.
Especially for your problem I recommend flutter_secure_storage. It is a good option for storing simple and sensitive data.