flutter_package_training 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

flutter package training #

This is a training to learn how to conceive a package Flutter

Getting Started #

add to your pubspec.yaml:

dependencies:
  flutter_package_training: ^1.0.4

Usage #

import the package in your dart file

import 'package:flutter_package_training/flutter_package_training.dart';

[1.0.4] - 2020-06-23 #

  • adding pedantic and effective analysis_options.yalm

[1.0.3] - 2020-06-23 #

  • reducing to 60 or less than 180 characters the description field of pubspec.yaml

[1.0.2] - 2020-06-23 #

  • adding more detail to the description field of pubspec.yaml

[1.0.1] - 2020-06-23 #

  • adding getting start readme correct version

[1.0.0] - 2020-06-23 #

  • adding dart doc comments

[0.0.1] - 2020-06-22 #

  • initializing the package
  • learning how to create a package
  • Scaffold
  • Text
  • Alert
  • Button

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

/// Set the widget which is the root of the application.
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

/// Make the app itself a widget
class MyHomePage extends StatefulWidget {
  ///Constructor
  MyHomePage({Key key, this.title}) : super(key: key);

  /// Fields in a Widget subclass are always marked "final".
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return IosAndroid.scaffold(
      string: 'Test',
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            IosAndroid.text(
                string: '${IosAndroid.isIOS()}', color: Colors.pink),
            IosAndroid.button(
                child: IosAndroid.text(string: 'error'),
                onPressed: () {
                  IosAndroid.alert(
                      context: context,
                      callback: () {
                        print('success');
                        Navigator.of(context).pop();
                      });
                })
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_package_training: ^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:flutter_package_training/flutter_package_training.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
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]
50
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 not compatible with SDK dart

Because:

  • flutter_package_training that is a package requiring null.

Package not compatible with runtime flutter-web on web

Because:

  • package:flutter_package_training/flutter_package_training.dart that imports:
  • dart:io

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.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
effective_dart ^1.2.3
flutter_test
pedantic ^1.9.0