2

I use retrofit to generate my api client in dart/flutter.

I have a version of the server on my local machine and a version hosted.

I want to use the local machine as the base url during development and testing, and a different base url when I build for deploy.

I don’t want to manually change it every time.

How can I do this?

Nelson
  • 43
  • 4

1 Answers1

0

if you use this plugin you can retrofit

Api(dio, baseUrl: RunConfig().apiBaseUrl)

and you can also use flavor and create 2 different main.dart

linkkader
  • 155
  • 1
  • 9