infinity_ui 0.2.5

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

Infinity Ui #

demo

     

A flutter plugin for remove status & navigation bar padding.

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.

  • Add this to your pubspec.yaml

    dependencies:
    infinity_ui: ^0.2.5
    
    
  • Get the package from Pub:

    flutter pub get
    
  • Import it in your file

    import 'package:infinity_ui/infinity_ui.dart';
    

Usage #

  • Infinity Ui just need to enable.
 ...

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await InfinityUi.enable(); // you can enable it anywhere
  runApp(MyApp());
}

...
  • Now for get height just using InfinityUi class.
...

  @override
  Widget build(BuildContext context) {
    return Container(
        margin: EdgeInsets.only(
            bottom: InfinityUi.navigationBarHeight,
            top: InfinityUi.statusBarHeight
        ),
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        child: child, // your code
    ),
  }

...
  • Or if you are lazy, you can use SafeInfinityUi.
...

  @override
  Widget build(BuildContext context) {
    return SafeInfinityUi(
        background: background, // Anything you like.
        child: child, // your code
        navigationBarColor: Colors.transparent,
        statusBarColor: Colors.transparent,
    );
  }

...

Enjoy full transparent navigation bar in flutter😉 #

navigation

Contributing #

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

0.2.5 #

  • Fix wrong status bar size in android 10

  • Fix wrong navigation bar size

  • Fix android 10 gestures

  • Change methods names to enable & disable

0.2.2 #

  • Add disableStatus property

0.2.1+1 #

  • Replace color with Widget

0.2.0 #

  • Remove scaffold border
  • Add navigationBarWidth on some devices size of navigation Bar in landscape and portrait mode is different.
  • Fix wrong size.

0.1.2 #

Improve README.md

  • Fix SafeInfinityUi work badly in rotation screen

0.1.1 #

Improve README.md

  • Fix SafeInfinityUi bug

0.1.0 #

Initial plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:infinity_ui/infinity_ui.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await InfinityUi.enable();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  ImageProvider iran, usa;
  Brightness brightness;

  @override
  void initState() {
    super.initState();
    brightness = Brightness.dark;
    iran = AssetImage('assets/iran.jpg');
    usa = AssetImage('assets/usa.jpg');
  }

  _switch(_) async {
    if (InfinityUi.isEnable) {
      await InfinityUi.disable();
      brightness = Brightness.light;
    } else {
      await InfinityUi.enable();
      brightness = Brightness.dark;
    }
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {

    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarIconBrightness: brightness,
      statusBarBrightness: brightness,
      systemNavigationBarIconBrightness: brightness,
    ));

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeInfinityUi(
        background: Image(
          image: InfinityUi.isEnable ? usa : iran,
          fit: BoxFit.cover,
        ),
        child: Scaffold(
          backgroundColor: Colors.transparent,
          body: Container(
            alignment: Alignment.bottomCenter,
            child: Container(
              width: 300,
              padding: EdgeInsets.all(20),
              margin: EdgeInsets.only(bottom: 50),
              color: Colors.white.withOpacity(0.8),
              child: Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: <Widget>[
                  Text(
                    InfinityUi.isEnable ?
                    'Enjoy freedom.'
                    :
                    '''You can also enjoy freedom here.
                    (ا سر بغل)''',
                    textScaleFactor: 2,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Text('Switch InfinityUi'),
                      Switch(
                        activeColor: Colors.black,
                        value: InfinityUi.isEnable,
                        onChanged: _switch,
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  infinity_ui: ^0.2.5

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:infinity_ui/infinity_ui.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
66
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]
83
Learn more about scoring.

We analyzed this package on Jul 11, 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:infinity_ui/infinity_ui.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

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

Package does not support Flutter platform web

Because:

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

Package does not support Flutter platform windows

Because:

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

Package not compatible with SDK dart

Because:

  • infinity_ui that is a package requiring null.

Health suggestions

Format lib/infinity_ui.dart.

Run flutter format to format lib/infinity_ui.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
native_device_orientation ^0.3.0 0.3.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