How to Add Items on Dropdown Button from gRPC API in Flutter

Viewed 16

how can i have a drop down with items that comes from gRPC service?

i have a fetchItem method that get the data from server

Future<GroupsStates?> fetchItemsh() async {
final client = ClientChannel(
  LoginState.ipServerController.text,
  port: ----,
  options: ChannelOptions(
    credentials: ChannelCredentials.insecure(),
  ),
);

final stub = EngineClient(client);

// await client.shutdown();
try {
  var result = (await stub.groupsStatesAll(Void()));
  return result;
} catch (e) {
  print('Cuaght error: $e');
}

}

0 Answers
Related