Skip to content

Commit

Permalink
docs: add more dartdoc comments to the public API
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmannZ committed Aug 20, 2020
1 parent 422380d commit 446c7d0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.0+1] - 20-08-2020.

- Added more dartdoc comments to the public API.

## [1.0.0] - 20-08-2020.

- Initial release.
1 change: 1 addition & 0 deletions lib/src/banner/flavor_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flavor_config/src/config/flavor_config.dart';
import 'package:flavor_config/src/dialog/device_info_dialog.dart';

class FlavorBanner extends StatelessWidget {
/// The child where the banner should be rendered on top of.
final Widget child;

FlavorBanner({
Expand Down
16 changes: 16 additions & 0 deletions lib/src/config/flavor_config.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import 'package:flutter/material.dart';

class FlavorConfig {
/// The name of the flavor.
final String flavorName;

/// Determains if the banner should be shown.
final bool bannerEnabled;

/// The color of the banner if enabled.
final Color color;

/// The values that belong to the flavor.
final Map<String, dynamic> values;

static FlavorConfig _instance;
Expand Down Expand Up @@ -35,9 +42,18 @@ class FlavorConfig {
this.values,
);

/// Gets the name of the flavor.
static String getFlavorName() => _instance.flavorName;

/// Returns `true` if the banner will be shown.
static bool isBannerEnabled() => _instance.bannerEnabled;

/// Gets the color of the banner if enabled.
static Color getColor() => _instance.color;

/// Gets the values that belong to the flavor.
static Map<String, dynamic> getValues() => _instance.values;

/// Gets a value given a key.
static dynamic getValue(String key) => _instance.values[key];
}
3 changes: 3 additions & 0 deletions lib/src/utils/device_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum BuildMode {
}

class DeviceUtils {
/// Returns the current build mode.
static BuildMode currentBuildMode() {
if (const bool.fromEnvironment('dart.vm.product')) {
return BuildMode.RELEASE;
Expand All @@ -23,12 +24,14 @@ class DeviceUtils {
return result;
}

/// Returns a [Future] resolving into [AndroidDeviceInfo].
static Future<AndroidDeviceInfo> androidDeviceInfo() async {
final plugin = DeviceInfoPlugin();

return plugin.androidInfo;
}

/// Returns a [Future] resolving into [IosDeviceInfo].
static Future<IosDeviceInfo> iosDeviceInfo() async {
final plugin = DeviceInfoPlugin();

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flavor_config
description: An easy to use package for creating flavors for any environment.
version: 1.0.0
version: 1.0.0+1
homepage: https://github.com/zino-hofmann/flavor-config-flutter

environment:
Expand Down

0 comments on commit 446c7d0

Please sign in to comment.