flutter_xsteps 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

flutter_xsteps #

A new Flutter package project.

Getting Started #

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

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

[0.0.2] - Delete useless code, optimize code format. #

example/example.dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';

import '../lib/flutter_xsteps.dart';

class ExamplePage extends StatefulWidget {
  final resultData = {
    {
      "title": "step1",
      "subTitle": "05-08-2020  12:00",
      "content": "In person meeting"
    },
    {
      "title": "step2",
      "subTitle": "05-05-2020  15:10",
      "content": "Phone call"
    },
    {
      "title": "step3",
      "subTitle": "05-05-2020  15:06",
      "content": "Accepted from \"Covid 19 Promotion\""
    },
  };

  @override
  State<StatefulWidget> createState() {
    return ExampleState();
  }
}

class ExampleState extends State<ExamplePage> {
  @override
  Widget build(BuildContext context) {
    List<Widget> mChildrens = List();
    for (var feedDataItem in widget.resultData) {
      mChildrens.add(_buildRStepsItemView(feedDataItem));
    }
    return Container(
      child: Xsteps(
        current: 1,
        childrens: mChildrens,
      ),
      margin: EdgeInsets.only(
          top: ScreenUtil().setWidth(36),
          bottom: ScreenUtil().setWidth(60),
          left: ScreenUtil().setWidth(19)),
    );
  }

  _buildRStepsItemView(itemData) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Offstage(
            child: Container(
              margin: EdgeInsets.only(
                  top: ScreenUtil().setWidth(0),
                  bottom: ScreenUtil().setWidth(10)),
              child: Text(
                itemData['title'],
                style: TextStyle(
                    fontSize: ScreenUtil().setSp(14),
                    color: Color(0xff2F80ED),
                    fontWeight: FontWeight.bold),
              ),
            ),
            offstage: itemData['title'] == '',
          ),
          Container(
            margin: EdgeInsets.only(
                top: ScreenUtil().setWidth(0),
                bottom: ScreenUtil().setWidth(10)),
            child: Text(
              itemData['subTitle'],
              style: TextStyle(
                fontSize: ScreenUtil().setSp(14),
                color: Color(0xff828282),
              ),
            ),
          ),
          Container(
            child: Text(
              itemData['content'],
              style: TextStyle(
                fontSize: ScreenUtil().setSp(16),
                color: Color(0xff201A3D),
              ),
            ),
          )
        ],
      ),
      margin: EdgeInsets.only(
          bottom: ScreenUtil().setWidth(20),
          left: ScreenUtil().setWidth(29),
          top: ScreenUtil().setWidth(1)),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_xsteps: ^1.0.2

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_xsteps/flutter_xsteps.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]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [flutter_xsteps] that is in a package requiring null.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (flutter_screenutil).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
flutter_screenutil ^1.1.0 1.1.0 2.2.0
vector_math ^2.0.8 2.0.8
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
Dev dependencies
flutter_test