pub package

Provides all basic info about your application. App flavor, Version, Device size, Flavor specific environment variables, and more.


flutter pub add info_kit


Here are small examples that show you how to use the package, there are more examples in the examples folder.


  flavorEnabled: true,
  flavors: DefaultInfoFlavor.flavors,
  fallbackFlavor: DefaultInfoFlavor.fallbackFlavor,
  sizes: DefaultInfoSize.sizes,
  fallbackSize: DefaultInfoSize.fallbackSize,
  envEnabled: true,
  envFlavorEnabled: true,
  envFlavorPerPlatformEnabled: true,
  envFolder: 'env', // set to '' to use the root folder

Available getters

// size of the device, based on a list of supported sizes
InfoSize size = InfoKit.size;

// origin url on web platform, otherwise an empty string
String origin = InfoKit.origin;

// device's language
Locale locale = InfoKit.locale;

// device platform, (ios app, web app, macos app), etc
InfoPlatform platform = InfoKit.platform;

// device's operating system
InfoOS os = InfoKit.os;

// build flavor
InfoFlavor flavor = InfoKit.flavor;

// if release build or debug
InfoMode mode = InfoKit.mode;

int buildNumber = InfoKit.buildNumber;

String version = InfoKit.version;

String packageName = InfoKit.packageName;

String appName = InfoKit.appName;


Here are the main "features" of the package:


Provides access to the current flavor of the application.

  1. Set the list of supported flavors with the flavors parameter. There is a default list of flavors that can be used, but you can add more or create your own.
  2. Define the current flavor with a build argument flutter run --dart-define=flavor=<flavor> (this package ignores the --flavor flag, because that flag is not accessible in web builds).
  3. Anywhere in your application, you can access the current flavor with the flavor getter.


  1. Wrap the root of your project with a LayoutBuilder and use the constraints property to get the size.
      builder: (context, constraints) {
        return Text('${constraints.maxWidth} x ${constraints.maxHeight}');
  2. The returned size by the size getter is one from a list of predefined sizes.
  3. There is a default list of sizes that can be used, but you can add more or create your own.


Set different environment variables for different flavors and different flavors!

  1. The file structure should look like this:
    - env
      - .env
      - .env.flavor1
      - .env.flavor2
      - .env.flavor3
      - ios
        - .env.flavor1
        - .env.flavor2
        - .env.flavor3
      - android
        - .env.flavor1
        - .env.flavor2
        - .env.flavor3
      - web
        - .env.flavor1
        - .env.flavor2
        - .env.flavor3
  2. The merging of the environment variables is done so that the more specific environment variable overrides the less specific environment variable. Don't forget to add the folders as assets to your pubspec.yaml file.
  3. The variables can now be accessed using the flutter_dotenv package.