native_widgets 1.3.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 60

Buy Me A Coffee Donate

Native Widgets #

pub package

A Flutter plugin to show the correct widgets for iOS and Android.

Avoid duplicating code and just write once for supported widgets.

Android will use Material Design and iOS will use Cupertino style widgets.

Usage #

To use this plugin, add native_widgets as a dependency in your pubspec.yaml file.

Look at the example for various ways to use this plugin!

1.3.2 - 05.0629.2019 #

  • Upgrading Packages
  • Working with Flutter dev channel

1.2.1 - 05.06.2019 #

  • Upgrading Packages

1.3.0 - 05.03.2019 #

  • Adding Support for Desktop
  • Updating Example
  • Adding Desktop Targets to Example

1.2.0 - 04.06.2019 #

  • Making Example Desktop Aware

[1.0.1]

  • Added current index to NativeScaffold's PlatformNavBar.
  • Added automaticallyImplyLeading to allow hidden leading element in AppBar.
  • Thank you to @amadejkastelic for the PR

[1.0.0] - Major Update

  • Refactored Library to use Platfrom Widgets plugin in the backend
  • Added Layout (Mobile, Tablet, Desktop)
  • Added Detailed Example
  • Added Folder Structure to Library for Easy Documentaion
  • Added Cupertino TableViewController, Cell and Search Bar
  • Updated Picker
  • Added Toolbar
  • Added App Bar
  • Added Scaffold
  • Added Text Button
  • Added Icon Button
  • Added Routing
  • Added Segmented Select
  • Updated Bottom Tabs
  • Added Top Navigation
  • Added Main App
  • Added Text Label
  • Added Search Widget
  • Updated Switch
  • Added Confirmation Dialog
  • Updated iOS Dialog with Actions

[0.1.2] - Updated Example

  • Updated Example and New Dart Support

[0.1.1] - Bug Fixes and Breaking Changes

  • Native button will now default to 16.0 padding internal

[0.1.0] - Bug Fixes and Breaking Changes

  • Native button will now use Material Button on Android instead of raised button
  • You can specify android specific options and cupertino ios options
  • There is now internal and external paddign for buttons

[0.0.4] - Bug Fixes

  • Bug Fix for Center Loading Indicator

[0.0.3] - Adding Components

  • Bug Fix for App Bar

[0.0.2] - Adding Components

  • Added App Bar and optional text for Loading Indicator

[0.0.1] - Adding Components

  • Added Button, Switch, Dialog, Loading Indicator, and Tab Bar

example/README.md

native_widgets #

import 'package:flutter/material.dart';
import 'package:native_widgets/native_widgets.dart';

import '../utils/pop_up.dart';

class Page1 extends StatefulWidget {
  @override
  _Page1State createState() => _Page1State();
}

class _Page1State extends State<Page1> {
  bool _active = false;
  int _selected = 0;
  String _value = "Apple";
  bool _switch = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: NativeAppBar(
        leading: Container(
          padding: EdgeInsets.only(top: 10.0),
          child: NativeTextButton(
            label: "Cancel",
            onPressed: () {
              FocusScope.of(context).requestFocus(new FocusNode());
            },
          ),
        ),
        title: const Text("Input Form"),
        actions: <Widget>[
          Container(
            padding: EdgeInsets.only(top: 10.0),
            child: NativeTextButton(
              label: "Save",
              style: TextStyle(fontWeight: FontWeight.bold),
              onPressed: () {
                FocusScope.of(context).requestFocus(new FocusNode());
              },
            ),
          ),
        ],
      ),
      body: SingleChildScrollView(
        child: ListBody(
          children: <Widget>[
            ListTile(
              title: const Text("Loading Indicator..."),
              trailing: NativeLoadingIndicator(),
            ),
            ListTile(
              title: const Text("Switch"),
              trailing: NativeSwitch(
                value: _active,
                onChanged: (bool value) => setState(() => _active = value),
              ),
            ),
            Container(height: 20.0),
            NativeGroupSelect<int>(
              groupValue: _selected,
              children: <int, Widget>{
                0: Text('Midnight'),
                1: Text('Viridian'),
                2: Text('Cerulean'),
              },
              onValueChanged: (int value) {
                setState(() {
                  _selected = value;
                });
              },
            ),
            NativeSelection(
              value: _value,
              items: [
                "Apple",
                "Orange",
                "Pineapple",
                "Cherry",
              ],
              onChanged: (String value) {
                setState(() {
                  _value = value;
                });
              },
            ),
            NativeListTile(
              title: const Text("Power Saver"),
              // subtitle: Text("Puts Device into Low Power Mode"),
              // hideLeadingIcon: true,
              ios: CupertinoListTileData(
                style: CupertinoCellStyle.basic,
              ),
              trailing: <Widget>[
                NativeSwitch(
                    value: _switch,
                    onChanged: (bool value) {
                      setState(() {
                        _switch = value;
                      });
                    }),
              ],
            ),
            Container(
              padding: const EdgeInsets.all(20.0),
              child: NativeButton(
                child: const Text("Submit"),
                // padding: const EdgeInsets.all(20.0),
                color: Colors.blue,
                onPressed: () => showAlertPopup(context,
                    title: "Native Dialog", detail: "Button Submitted!"),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  native_widgets: ^1.3.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:native_widgets/native_widgets.dart';
  
Version Uploaded Documentation Archive
1.3.2 May 29, 2019 Go to the documentation of native_widgets 1.3.2 Download native_widgets 1.3.2 archive
1.3.1 May 6, 2019 Go to the documentation of native_widgets 1.3.1 Download native_widgets 1.3.1 archive
1.3.0 May 3, 2019 Go to the documentation of native_widgets 1.3.0 Download native_widgets 1.3.0 archive
1.2.0 Apr 6, 2019 Go to the documentation of native_widgets 1.2.0 Download native_widgets 1.2.0 archive
1.0.1 Mar 1, 2019 Go to the documentation of native_widgets 1.0.1 Download native_widgets 1.0.1 archive
1.0.0+4 Feb 19, 2019 Go to the documentation of native_widgets 1.0.0+4 Download native_widgets 1.0.0+4 archive
1.0.0+2 Feb 7, 2019 Go to the documentation of native_widgets 1.0.0+2 Download native_widgets 1.0.0+2 archive
1.0.0+1 Feb 7, 2019 Go to the documentation of native_widgets 1.0.0+1 Download native_widgets 1.0.0+1 archive
0.1.1+1 Jul 27, 2018 Go to the documentation of native_widgets 0.1.1+1 Download native_widgets 0.1.1+1 archive
0.1.1 Jul 27, 2018 Go to the documentation of native_widgets 0.1.1 Download native_widgets 0.1.1 archive

All 15 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
91
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jun 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms:

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter pub upgrade failed with the following output:

ERR: The current Flutter SDK version is 1.5.4-hotfix.2.
 
 Because native_widgets depends on flutter_sticky_header >=0.4.0 which requires Flutter SDK version >=1.5.9-pre.94 <2.0.0, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0