dg_tools 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 38

dg_tools #

A new Flutter plugin.

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.

0.0.2 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:dg_tools/packages.dart';
import 'package:dg_tools/static/enums.dart';
import 'package:dg_tools_example/page2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Plugin example app',
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  GlobalKey keyA = GlobalKey();
  GlobalKey keyB = GlobalKey();
  GlobalKey keyC = GlobalKey();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 750, height: 1380, allowFontScaling: true);
    return MaterialApp(
        home: Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Stack(
        children: [
          Positioned(
            top: 200,
            left: 0,
            child: RepaintBoundary(
              key: keyA,
              child: Container(
                  width: 100.0,
                  height: 100.0,
                  child: Image.network(
                    'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=2393912978,721795803&fm=26&gp=0.jpg',
                    fit: BoxFit.cover,
                  )),
            ),
          ),
          Positioned(
            top: 0,
            right: 0,
            child: RepaintBoundary(
              key: keyB,
              child: ClipOval(
                child: Container(
                  width: 100.0,
                  height: 100.0,
                  color: Colors.blue,
                ),
              ),
            ),
          ),
          Positioned(
            bottom: 40,
            right: 250,
            child: RepaintBoundary(
              key: keyC,
              child: ClipOval(
                child: Container(
                  width: 30.0,
                  height: 30.0,
                  color: Colors.blue,
                ),
              ),
            ),
          ),
          Positioned(
            bottom: 200,
            left: 200,
            child: InkWell(
              onTap: () {
                // DgAnimations.moveAnimation(
                //     metaKey: keyA,
                //     targetKeys: [keyB, keyC],
                //     endOpacity: 0.2,
                //     moveType: MoveType.linear,
                //     transientTime: Duration(seconds: 1),
                //     rotate: true,
                //     oval: true);
                DgTools.showLoadingDialog(context,
                    ballColor: Colors.green,
                    backgroundColor: Colors.yellow,
                    pathColor: Colors.black,
                    widthAndHeight: ScreenUtil().setWidth(200));

                // Navigator.push(context, PageRouteBuilder(
                //     // transitionDuration: Duration(seconds: 1),
                //     pageBuilder: (BuildContext context, Animation animation,
                //         Animation secondaryAnimation) {
                //   return Stack(
                //     alignment: Alignment.center,
                //     children: <Widget>[
                //       Positioned(
                //         top: 1000 - 50.0 * animation.value,
                //         left: 1000 - 50.0 * animation.value,
                //         child: SizedBox(
                //           height: 50 * 2 * animation.value,
                //           width: 50 * 2 * animation.value,
                //           child: ClipOval(
                //             child: Align(
                //               alignment: Alignment.center,
                //               child: Container(
                //                 color: Colors.red,
                //               ),
                //             ),
                //           ),
                //         ),
                //       ),
                //     ],
                //   );
                // }));
              },
              child: Icon(Icons.add),
            ),
          )
        ],
      ),
    ));
  }
}

Use this package as a library

1. Depend on it

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


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

We analyzed this package on Jul 9, 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

Health issues and suggestions

Fix lib/dg_tools.dart. (-25 points)

Analysis of lib/dg_tools.dart failed with 1 error:

line 13 col 9: The named parameter 'barrierColor' isn't defined.

Fix lib/widgets/loading_dialog.dart. (-0.50 points)

Analysis of lib/widgets/loading_dialog.dart reported 1 hint:

line 3 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: LoadingDialog.ballColor, LoadingDialog.backgroundColor, LoadingDialog.pathColor, LoadingDialog.widthAndHeight

Format lib/animations/route_animations.dart.

Run flutter format to format lib/animations/route_animations.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/packages.dart (Run flutter format to format lib/packages.dart.)
  • lib/static/enums.dart (Run flutter format to format lib/static/enums.dart.)
  • lib/widgets/widget_image.dart (Run flutter format to format lib/widgets/widget_image.dart.)

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

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.1.0 <3.0.0
flutter 0.0.0
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
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test