build_badge 0.0.2 copy "build_badge: ^0.0.2" to clipboard
build_badge: ^0.0.2 copied to clipboard

Badge to distinguish different builds. Such as staging, dev, production etc

Very simple another App Badge Library workflow #

Features #

  • Just add badge to your app's left top corner
  • You decide what to do with it
  • Depends on basic flutter widgets. No material or Cupertino dependency.
  • That is it, Very simple

Getting started #

Add dependency to pubspec.yaml #

  app_badge:
    git: git@github.com:hurelhuyag/app_badge.git

Fetch dependencies #

flutter pub get

Usage #

to /example folder.

const String env = String.fromEnvironment("env", defaultValue: "dev");

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return AppBadge(
      textColor: Colors.white,
      backgroundColor: Colors.red,
      text: env.toUpperCase(),
      visible: env != "prod",
      child: MaterialApp(
        title: 'App Badge Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const HomePage(),
      ),
    );
  }
}

When you change --dart-define="env=dev" parameter when building, your badge will change accordingly. Obviously, when the environment is the production /prod/, AppBadge will disappear.

Result #

Screencast

Additional information #

If you have idea in your mind, Feel free to open an issue or pull request.

3
likes
0
pub points
43%
popularity

Publisher

unverified uploader

Badge to distinguish different builds. Such as staging, dev, production etc

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on build_badge