dev_menu 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

dev_menu #

DevMenu - flutter plugin.

Package made to make team members (Dev,QA,PM) life easier while in development. Easily find out device/app info, turn certain features on and off, and preview your WIP Widgets in Test Playground.

Dev_menu gif

Installation #

Add dev_menu: 1.0.3 as a dependency in your pubspec.yaml file.

Information #

packageName (Mandatory) is package name (Android: applicationId). For example: "com.example.dev_menu_example"

Note: This is not needed for iOS, since there is no way of using this String to get the application data.

flags is list of maps, contaning title, and description. They are used to turn certain features/test on and off. Working with the help of Shared preferences.

Example:

[
  {
    'title': 'Is Environment button enabled?',
    'description': 'Determine if Environment button should work.',
  },
]

Using flags in your app:

bool isButtonEnabled = await DevMenuHelper()
  .getSharedPreferenceBool('Is Environment button enabled?'); -> matches "title" from above.
print('Is button enabled? ' + isButtonEnabled);

Or use bool to show Widget with combination of FutureBuilder

return FutureBuilder<bool>(
  future: DevMenuHelper()
    .getSharedPreferenceBool('Should show recent transactions?'),
  builder: (context, snapshot) {
    if (snapshot.connectionState == ConnectionState.done &&
    snapshot.hasData) {
      bool shouldShowTransactions = snapshot.data;
      return shouldShowTransactions ? TransactionsWidget() : Container();
    } else {
      return Container();
    }
  },
);

testWidgets is list of widgets provided for Test playground screen of plugin. Usually widgets which are not yet connected with the Apps flow, or work in progress stuff.

Example:

[
  {
    'name': 'Alert dialog',
    'widget': AlertDialog(
      title: Text('Title'),
      content: Text('Content'),
      actions: <Widget>[
        FlatButton(
          onPressed: () {},
          child: Center(
            child: Text('Button 1'),
          ),
        ),
        FlatButton(
          onPressed: () {},
          child: Center(
            child: Text('Button 2'),
          ),
        )
      ],
    ),
  },
  {
    'name': 'Sized box',
    'widget': SizedBox(
      width: 300,
      height: 400,
      child: Container(
        color: Colors.red,
        child: Text('I am text in sized box'),
      ),
   )
  }
]

Application info:

NameLabeliOSAndroid
Application nameappNamenot availableandroid app name
Package namepackageNamenot availableandroid package name
VersionversionNamenot availableandroid version

Here you can also see any custom application info, provided by customAppInfo

customAppInfo is list of custom informations regarding the app. Contains title, initially selected option, and list of all options. Using Shared preferences, selected will be read on the first run, afterwards selected is read from the phone memory.

Example:

[
  {
    'title': 'Environment',
    'selected': 'QA',
    'options': ['QA', 'DEV', 'PROD', 'STAGING']
  },
]

Device info:

Android:

Namedescription
version.securityPatchThe user-visible security patch level
version.sdkIntThe user-visible SDK version of the framework
version.releaseThe user-visible version string
version.codenameThe current development codename, or the string "REL" if this is a release build
version.baseOsThe base OS build the product is based on
deviceThe name of the industrial design
manufacturerThe manufacturer of the product/hardware
modelThe end-user-visible name for the end product
productThe name of the overall product
androidIdThe Android hardware device ID that is unique between the device + user and app signing

iOS:

Namedescription
nameDevice name
systemNameThe name of the current operating system
systemVersionThe current operating system version
modelDevice model
identifierForVendorUnique UUID value identifying the current device
utsname.sysnameOperating system name
utsname.nodenameNetwork node name
utsname.releaseRelease level
utsname.versionVersion level
utsname.machineHardware type

1.0.4 #

  • Add more examples for Flags

1.0.3 #

  • Fixed text errors

1.0.2 #

  • Updated description

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:dev_menu_example/home_screen.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomeScreen(),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dev_menu: ^1.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dev_menu/dev_menu.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
17
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
device_info ^0.4.1+5 0.4.2+1
flutter 0.0.0
shared_preferences ^0.5.6+2 0.5.6+3
Transitive dependencies
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
shared_preferences_macos 0.0.1+6
shared_preferences_platform_interface 1.0.3
shared_preferences_web 0.1.2+4
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test