fluct 1.0.3 copy "fluct: ^1.0.3" to clipboard
fluct: ^1.0.3 copied to clipboard

outdated

A command-lint tool for help develop flutter application.

fluct #

pub package

A command-lint tool for help develop flutter application.

Installation #

fluct is not meant to be used as a dependency,Instead,it should be "activated".

$ pub global activate fluct
# or
$ flutter pub global activate fluct

or you can get it form github.

$ pub global activate -sgit https://github.com/rhymelph/fluct
# or
$ flutter pub global activate -sgit https://github.com/rhymelph/fluct

Learn more about activating and using packages (here)[https://dart.dev/tools/pub/cmd/pub-global]

Usage #

fluct provides two commands:create,gen-assets.

  • create create a new file about widget.
  • gen-assets autogenerated assets file to a.dart

fluct create #

Help Flutter application create a new file

Usage: fluct create [arguments] <path>
-h, --help            Print this usage information.
-t, --type            
          [custom]    Create a new file about custom widget in 'fluct.yaml'
          [stful]     Create a new file about StatefulWidget
          [stless]    Create a new file about StatelessWidget

-a, --arg             create a new file about your custom widget use arg in 'fluct.yaml'

Run "fluct help" to see global options.

example

create a new file about StateFulWidget.

$ fluct create -t stful home_page
Create a new file about StatefulWidget
create class HomePage
create success
exit 0

End,you can find ./home_page.dart

import 'package:flutter/material.dart';

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

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Container();
  }
}

custom widget

Create a new file about custom widget in 'fluct.yaml'

inh: |
  import 'package:flutter/material.dart';

  class $NAME$ extends InheritedWidget {
    const $NAME$({
      Key key,
      @required Widget child,
    })  : assert(child != null),
          super(key: key, child: child);

    static $NAME$ of(BuildContext context) {
      return context.dependOnInheritedWidgetOfExactType(aspect: $NAME$) as $NAME$;
    }

    @override
    bool updateShouldNotify($NAME$ old) {
      return false;
    }
  }

inh: is your arg. import..: is your custom widget,use $NAME$ will replace your name by file name,and the first word will uppercase,such as: home_page will become HomePage

as last, you can use this command-line.

fluct create -t custom -a inh home_page_inherited

fluct gen-assets #

Auto generate assets to dart file

Usage: fluct gen-assets [arguments] <path>
-h, --help      Print this usage information.
-a, --assets    your asset directory path -- default ./assets

-o, --output    your output directory path -- default ./lib/generated

Run "fluct help" to see global options.

Running it.

tip: assets directory path in `./assets`
tip: output directory path in `./lib/generated`
waiting: generate running...           0.0s
success: generate complete,new file in `./lib/generated/a.dart`
You can add it in your `pubspec.yaml` file 
...............................
flutter:
  assets:
    - assets/village/
    - assets/pay/
    - assets/message/
    - assets/mine/
    - assets/login/
...............................
All done exit 0

In your ./lib/generated/a.dart,you can find...

// fluct gen-assets command generated.
// author:  rhyme_lph
// github:  https://github.com/rhymelph
// version: 1.0.3
class A {
  static final String  assetsVillageMyMsg = 'assets/village/my_msg.png';
  static final String  assetsVillageVRepair = 'assets/village/v_repair.png';
  static final String  assetsVillageVPropertyFee = 'assets/village/v_property_fee.png';
  static final String  assetsVillageVVoting = 'assets/village/v_voting.png';
  static final String  assetsVillageIcCompany = 'assets/village/ic_company.png';
  static final String  assetsVillageIcRightArrow = 'assets/village/ic_right_arrow.png';
  static final String  assetsVillageVComplain = 'assets/village/v_complain.png';
  static final String  assetsVillageIcLaw = 'assets/village/ic_law.png';
  static final String  assetsVillageIcSearch = 'assets/village/ic_search.png';
  static final String  assetsVillageIvFamilyNorepair = 'assets/village/iv_family_norepair.png';
  static final String  assetsVillageIcUploadPic = 'assets/village/ic_upload_pic.png';
  static final String  assetsVillageIvFamilyNocomplaint = 'assets/village/iv_family_nocomplaint.png';
  static final String  assetsVillageIvFamilyNoad = 'assets/village/iv_family_noad.png';
  static final String  assetsVillageIcGovernment = 'assets/village/ic_government.png';
  static final String  assetsVillageVHouse = 'assets/village/v_house.png';

  static final String  assetsPayPayTypeWx = 'assets/pay/pay_type_wx.png';
  static final String  assetsPayPayTypeAbc = 'assets/pay/pay_type_abc.jpg';
  static final String  assetsPayPayTypeAli = 'assets/pay/pay_type_ali.png';

  static final String  assetsMessageArticle4 = 'assets/message/article_4.jpg';
  static final String  assetsMessageArticle1 = 'assets/message/article_1.jpg';
  static final String  assetsMessageArticle3 = 'assets/message/article_3.jpg';
  static final String  assetsMessageArticle2 = 'assets/message/article_2.jpg';
  static final String  assetsMessageMReturn = 'assets/message/m_return.png';

  static final String  assetsMineDefaultAvatar = 'assets/mine/default_avatar.png';
  static final String  assetsMineMyMsg = 'assets/mine/my_msg.png';
  static final String  assetsMineHwpushIcToolbarRefresh = 'assets/mine/hwpush_ic_toolbar_refresh.png';
  static final String  assetsMineArrowRight = 'assets/mine/arrow_right.png';
  static final String  assetsMineWhiteRight = 'assets/mine/white_right.png';
  static final String  assetsMineIvCardEmblem = 'assets/mine/iv_card_emblem.png';
  static final String  assetsMineHomeCenterNormal = 'assets/mine/home_center_normal.png';
  static final String  assetsMineUserCenterNormal = 'assets/mine/user_center_normal.png';
  static final String  assetsMineVideoCamera = 'assets/mine/video_camera.png';
  static final String  assetsMineShare = 'assets/mine/share.png';
  static final String  assetsMineIconCamera = 'assets/mine/icon_camera.png';
  static final String  assetsMineIvCardFace = 'assets/mine/iv_card_face.png';
  static final String  assetsMineMySetting = 'assets/mine/my_setting.png';
  static final String  assetsMineUmiIdentity = 'assets/mine/umi_identity.png';
  static final String  assetsMineUmiModfiyPwd = 'assets/mine/umi_modfiy_pwd.png';
  static final String  assetsMineMyBill = 'assets/mine/my_bill.png';

  static final String  assetsLoginIcClose = 'assets/login/ic_close.png';
  static final String  assetsLoginIcLauncher = 'assets/login/ic_launcher.png';
  static final String  assetsLoginIcLoginBg = 'assets/login/ic_login_bg.png';
  static final String  assetsLoginIcEyesClose = 'assets/login/ic_eyes_close.png';
  static final String  assetsLoginIcEyesOpen = 'assets/login/ic_eyes_open.png';
}

Have a nice day 。

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A command-lint tool for help develop flutter application.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, cli_util, completion, io, path, yaml

More

Packages that depend on fluct