Home > Software engineering >  Want to create different gif icon profile for different profession users in flutter
Want to create different gif icon profile for different profession users in flutter

Time:10-12

I need help with one scenario, I want to create a flutter app where user can have gif icon based on their professions. Example: if I have an Electric user then program will automatically provide Electrician gif icon for that user profile. Please help me finding this solution.

CodePudding user response:

This is not possible for Flutter to do it automatically. That's why you should add logic to your app which detects the professions and define the profile picture according to their occupation. You can use this free resource to get your assets: https://www.flaticon.com/

CodePudding user response:

One of the solutions is that you can create enum JOB_OCCUPATION= {DOCTOR, ENGINEER,...}. After that you can create the switch methode which will check witch jobOccupation for that specific user (you need to add JOB_OCCUPATION to your user model) is selected like for instance:

switch(user.jobOccupation){
case DOCTOR:
user.gif = 'your gif for doctor'
break;
case ENGINEER:
user.gif = 'your gif for engineer'
break;
.
.
.
default:
user.gif = 'your gif for default'
break;}
  • Related