simple_status_bar 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

simple_status_bar #

A new flutter plugin project.

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

simple_status_bar #

0.0.1 #

  • Toggle status bar.
  • Default toggle behaviour for android and IOS

0.0.2 #

  • Added SimpleDrawer widget with callback, which can identify drawer open and close state

0.0.2+1 - 04-10-2020 #

  • Fixed some bugs

0.0.2+2 #

  • Cleanup

0.0.2+3 #

  • Android embeded version bug fixed

0.0.3 #

  • Get System Ui Mode -> Android(ok) and Ios(ok)

0.0.4 #

  • Change system brightness

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:simple_status_bar/simple_status_bar.dart';
import 'package:simple_status_bar/simple_drawer.dart';

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

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

class _MyAppState extends State<MyApp> {
  //

  SystemUiMode systemTheme;
  Brightness brightness = Brightness.light;

  final List<Color> colors = [
    Colors.blue.shade50,
    Colors.green,
    Colors.cyan,
    Colors.yellow.shade200,
    Colors.grey,
    Colors.pink.shade100,
    Colors.black,
    Colors.white,
    Colors.lightBlue,
    Colors.brown,
    Colors.deepOrange,
    Colors.indigo.shade300,
    Colors.teal,
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Simple status bar'),
        ),
        drawer: SimpleDrawer(
          drawerCallback: (bool isOpened) {
            SimpleStatusBar.toggle(hide: isOpened, animation: StatusBarAnimation.SLIDE);
          },
          background: Colors.green,
          child: Column(children: <Widget>[]),
        ),
        body: Column(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            // Container(
            //   color: Colors.grey.shade300,
            //   padding: EdgeInsets.all(12.0),
            //   child: Wrap(
            //     alignment: WrapAlignment.spaceBetween,
            //     runSpacing: 16.0,
            //     spacing: 16.0,
            //     children: colors
            //         .map((Color color) => GestureDetector(
            //               onTap: () {
            //                 SimpleStatusBar.changeStatusBarColor(color: color);
            //                 print(color.value);
            //               },
            //               child: CircleAvatar(
            //                 backgroundColor: color,
            //               ),
            //             ))
            //         .toList(),
            //   ),
            // ),
            SizedBox(height: 30.0),
            Text(systemTheme.toString()),
            Text(brightness.toString()),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: <Widget>[
                RaisedButton(
                  onPressed: () async {
                    final result = await SimpleStatusBar.getSystemUiMode();
                    setState(() {
                      systemTheme = result;
                    });
                  },
                  child: Text("Get theme"),
                ),
                RaisedButton(
                  onPressed: _toggleBrightnessPressed,
                  child: Text("Toggle Brightness"),
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }

  void _onGetThemePressed() async {
    final result = await SimpleStatusBar.getSystemUiMode();
    setState(() {
      systemTheme = result;
    });
  }

  void _toggleBrightnessPressed() async {
    print("Toogle brightness clicked");
    final Brightness bright =
        this.brightness == Brightness.light ? Brightness.dark : Brightness.light;
    await SimpleStatusBar.changeStatusBarBrightness(brightness: bright);
    setState(() {
      this.brightness = bright;
    });
    print("Brightness toggled");
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  simple_status_bar: ^0.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:simple_status_bar/simple_status_bar.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
50
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:simple_status_bar/simple_status_bar.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:simple_status_bar/simple_status_bar.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:simple_status_bar/simple_status_bar.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:simple_status_bar/simple_status_bar.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • simple_status_bar that is a package requiring null.

Health suggestions

Fix lib/simple_status_bar.dart. (-1 points)

Analysis of lib/simple_status_bar.dart reported 2 hints:

line 12 col 23: The value of the field '_GET_STATUS_BAR_BRIGHTNESS_METHOD' isn't used.

line 59 col 29: This function has a return type of 'Future

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-10 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test