bitmio 0.0.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

bitmio #

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.

Developing #

Best to use Android Studio for Flutter.

Run the app either directly in Android Studio or via commands:

flutter run ios

Release mode:

flutter run ios --release

Pushing a package update:

flutter pub publish

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:bitmio/bitmio.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    final background = Image.asset(
      'images/background.png',
      fit: BoxFit.cover,
    );

    final logoImage = Image.asset('images/logo.png');

    return MaterialApp(
      theme: ThemeData(
          brightness: Brightness.light,
          primaryColor: Colors.lightBlue[800],
          accentColor: Colors.cyan[600],
          fontFamily: 'Montserrat',
          textTheme: TextTheme(
              display2: TextStyle(fontSize: 45),
              button: TextStyle(fontSize: 14.0),
              subhead: TextStyle(fontSize: 16.0) // input text
              ),
          inputDecorationTheme: InputDecorationTheme(
              labelStyle: TextStyle(fontSize: 16.0),
              helperStyle: TextStyle(fontSize: 16.0),
              hintStyle: TextStyle(fontSize: 16.0)),
          buttonTheme: ButtonThemeData(
            padding: EdgeInsets.only(left: 60, right: 60, top: 15, bottom: 15),
            buttonColor: Colors.lightBlue[800], //  <-- dark color
            textTheme: ButtonTextTheme
                .primary, //  <-- this auto selects the right color
          )),
      darkTheme: ThemeData(
          brightness: Brightness.dark,
          primaryColor: Colors.orange,
          accentColor: Colors.blueAccent,
          buttonTheme: ButtonThemeData(
            padding: EdgeInsets.only(left: 60, right: 60, top: 15, bottom: 15),
            buttonColor: Colors.orange, //  <-- dark color
            textTheme: ButtonTextTheme
                .primary, //  <-- this auto selects the right color
          )),
      initialRoute: '/',
      routes: {
        '/': (context) => Bits(),
        '/welcome': (context) => WelcomeWidget(
              backgroundImage: background,
              logo: logoImage,
            ),
        '/login': (context) => HeaderDetailWidget(
            detail: MyLogin(), background: background, logo: logoImage),
        '/signup': (context) => HeaderDetailWidget(
            detail: MySignup(), background: background, logo: logoImage),
        '/webview-auth': (context) => WebviewAuth(
            authUrl: 'https://bitmio.com/demo/login',
            onCompletion: (result) => {print('Auth success $result')}),
        '/onboarding': (context) {
          final model = [
            OnboardingPageModel(
                backgroundImage: Image.asset('images/onboarding1.png'),
                title: 'Be in control.',
                description: 'Own your app and define the roadmap.'),
            OnboardingPageModel(
                backgroundImage: Image.asset('images/onboarding2.png'),
                title: 'Control your budget.',
                description: 'Own your app and define the roadmap. Own your app and define the roadmap. Own your app and define the roadmap.'),
            OnboardingPageModel(
                backgroundImage: Image.asset('images/onboarding3.png'),
                title: 'Follow best-practices.',
                description: 'Own your app and define the roadmap.')
          ];
          return Onboarding(
            model: model,
            completionRoute: '/',
          );
        },
        '/card': (context) {
          final model = CardModel(
              title: 'My Card with a pretty long title across multiple lines',
              description: 'Create your own cards and theme them.',
              date: 'Dec 20',
              background: Image.asset('images/background.png'),
              person: PersonModel(
                  name: 'Liza Li',
                  image: Image.asset('images/face2.jpeg').image));

          final checklistModel = ChecklistModel(name: 'My Checklist', items: [
            ChecklistItemModel(id: '1', name: 'Do this first'),
            ChecklistItemModel(id: '2', name: 'Do this next'),
            ChecklistItemModel(id: '3', name: 'Do this last')
          ]);

          final checklist = ChecklistWidget(model: checklistModel);

          return CardDetailWidget(
            model: model,
            widgets: <Widget>[checklist],
          );
        }
      },
    );
  }
}

class Bits extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: <Widget>[
          Card(
              child: ListTile(
            title: Text('Welcome'),
            onTap: () => {Navigator.pushNamed(context, '/welcome')},
          )),
          Card(
              child: ListTile(
            title: Text('Login'),
            onTap: () => {Navigator.pushNamed(context, '/login')},
          )),
          Card(
              child: ListTile(
            title: Text('Signup'),
            onTap: () => {Navigator.pushNamed(context, '/signup')},
          )),
          Card(
              child: ListTile(
            title: Text('Webview Auth'),
            onTap: () => {Navigator.pushNamed(context, '/webview-auth')},
          )),
          Card(
              child: ListTile(
            title: Text('Onboarding'),
            onTap: () => {Navigator.pushNamed(context, '/onboarding')},
          )),
          Card(
              child: ListTile(
            title: Text('Progress'),
            onTap: () => {Navigator.pushNamed(context, '/progress')},
          )),
          Card(
              child: ListTile(
            title: Text('Card List'),
            onTap: () => {Navigator.pushNamed(context, '/cards')},
          )),
          Card(
              child: ListTile(
            title: Text('Card'),
            onTap: () => {Navigator.pushNamed(context, '/card')},
          )),
          Card(
              child: ListTile(
            title: Text('Documents'),
            onTap: () => {Navigator.pushNamed(context, '/documents')},
          )),
          Card(
              child: ListTile(
            title: Text('Contacts'),
            onTap: () => {Navigator.pushNamed(context, '/contacts')},
          )),
        ],
      ),
    );
  }
}

class MyLogin extends StatefulWidget {
  @override
  _MyLoginState createState() {
    return _MyLoginState();
  }
}

class _MyLoginState extends State<MyLogin> {
  @override
  Widget build(BuildContext context) {
    return LoginForm(
        forgotLoginUrl: 'https://bitmio.com/demo/forgot-login',
        onCompletion: (model, callback) {
          print('Login ${model.email} - ${model.password}');

          Future.delayed(const Duration(milliseconds: 1000), () {
            callback();
          });
        });
  }
}

class MySignup extends StatefulWidget {
  @override
  _MySignupState createState() {
    return _MySignupState();
  }
}

class _MySignupState extends State<MySignup> {
  @override
  Widget build(BuildContext context) {
    return SignupForm(onCompletion: (model, callback) {
      print('Signup ${model.email} - ${model.password}');

      Future.delayed(const Duration(milliseconds: 1000), () {
        callback();
      });
    });
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  bitmio: ^0.0.10

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

We analyzed this package on Apr 4, 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

Health suggestions

Fix lib/onboarding.dart. (-2.48 points)

Analysis of lib/onboarding.dart reported 5 hints:

line 17 col 7: Don't explicitly initialize variables to null.

line 18 col 7: Don't explicitly initialize variables to null.

line 21 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: Onboarding.controller, Onboarding.model, Onboarding.startLabel, Onboarding.continueLabel, Onboarding.skipLabel, Onboarding.completionHandler, Onboarding.completionRoute

line 36 col 7: Don't explicitly initialize variables to null.

line 153 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: OnboardingPage.model

Fix lib/checklist.dart. (-1.99 points)

Analysis of lib/checklist.dart reported 4 hints:

line 23 col 14: Name non-constant identifiers using lowerCamelCase.

line 25 col 48: Name non-constant identifiers using lowerCamelCase.

line 36 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: ChecklistWidget.onToggle

line 72 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: ChecklistRow.onToggle

Fix lib/webview_auth.dart. (-1.49 points)

Analysis of lib/webview_auth.dart reported 3 hints:

line 4 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: WebviewAuth.authUrl, WebviewAuth.onCompletion

line 17 col 21: The value of the field '_controller' isn't used.

line 57 col 15: Don't explicitly initialize variables to null.

Fix additional 7 files with analysis or formatting issues. (-2 points)

Additional issues in the following files:

  • lib/welcome.dart (2 hints)
  • lib/blurred_image.dart (1 hint)
  • lib/card_detail.dart (1 hint)
  • lib/bitmio.dart (Run flutter format to format lib/bitmio.dart.)
  • lib/header.dart (Run flutter format to format lib/header.dart.)
  • lib/login.dart (Run flutter format to format lib/login.dart.)
  • lib/signup_form.dart (Run flutter format to format lib/signup_form.dart.)

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/mirkokiefer/bitmio-flutter was unreachable.

The package description is too short. (-20 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.

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
url_launcher ^5.1.2 5.4.2
webview_flutter ^0.3.16 0.3.19+9
Transitive dependencies
collection 1.14.11 1.14.12
flutter_web_plugins 0.0.0
meta 1.1.8
plugin_platform_interface 1.0.2
sky_engine 0.0.99
typed_data 1.1.6
url_launcher_macos 0.0.1+4
url_launcher_platform_interface 1.0.6
url_launcher_web 0.1.1+1
vector_math 2.0.8
Dev dependencies
flutter_test