Skip to content

A banner that shows the current version or flavour of the app

License

Notifications You must be signed in to change notification settings

FaganOoi/flutter_version_banner

 
 

Repository files navigation

Version Banner

An app Banner Widget that shows the current app version. Can be used with App Flavors to show what flavor of the app is currently being used.

Getting Started

This widget should wrap MaterialApp or CupertinoApp.

Example

VersionBanner(
          text: "Yay!",
          packageExtensions: [".dev"],
          extensionHandling: VersionBannerExtensionHandling.packageContainDev,
          child: MaterialApp(
                       debugShowCheckedModeBanner: false,
                       title: 'Flutter Demo',
                       theme: ThemeData(
                         primarySwatch: Colors.blue,
                       ),
                       home: MyHomePage(title: 'Flutter Demo Home Page'),
                     )
      );

packageExtensions will check the app's package name with the given array based on value of extensionHandling.

[Original/Default Behavior] If extensionHandling is VersionBannerExtensionHandling.packageContainDev and the package name contains part of the String in the array, then the banner is visible.

If extensionHandling is VersionBannerExtensionHandling.packageSuffixDev and the package name ends with any of the String in the array, then the banner is visible.

The following properties can be changed:

  • color - Banner's color
  • textStyle - Banner's text style
  • text - The text to appear. If set to null will show the pubspec version
  • location - the banner's location on the screen, based on the class BannerLocation
  • packageExtensions - will check the app's package name with the given array and decide the banner's visibility
  • extensionHandling - will control the behavior for packageExtensions to work
  • visible - decides if the banner is visible or not. If set to false, it overrides the packageExtensions attribute

About

A banner that shows the current version or flavour of the app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 40.9%
  • Dart 20.8%
  • CMake 20.0%
  • HTML 9.6%
  • Ruby 3.3%
  • Shell 2.2%
  • Other 3.2%