Flutter how to manage user memberhip plan for UI?

Viewed 42

In my case, I have an app which it contains 3 user membership type. I know I'm gonna implement the app purchase but that's not what i mean. Let's take a look at the example.

We got 3 memberhsip. Bronze, Gold and Premium. Let's say someone bought Gold membership. And I want to give him access to all Bronze and Gold's features and don't allow for *Premium's features*.

This logic is new for me. How can I handle with this ?

1 Answers

You can simply manage the user role enum on your app side and while using the app every user will have one of the enum cases as current membership.

According to that enum, you can hide/show or grant access to the features in the application.

So for example your enum will be as below.

enum MemberShips {
  gold, 
  premium, 
  broze, 
  none// by default
}

By using the above enum you can manage visibility and access to features and functionality in your application.

Let me know if you need more information or understanding on the same.

Related