fam 1.1.5 copy "fam: ^1.1.5" to clipboard
fam: ^1.1.5 copied to clipboard

Fam is a scripting service for flutter project asset management.

icon.png

pub like pub version core time

πŸ‡ΊπŸ‡Έ English | πŸ‡¨πŸ‡³ Chinese

1.1.3

Click here( Update Content ) for details of fam's update.

1.1.2

The update method of fam version is as follows:

  1. Users whose fam version is less than 1.0.5 use flutter pub global activate fam command to upgrade.
  2. Users whose fam version is greater than or equal to 1.0.5 use fam --update or fam --update x.x.x or flutter pub global activate fam to update.

1. Introduction #

At present, for the asset management service work of flutter project, the development tool (ide) recommended by flutter also provides corresponding plug-ins to handle this function.

There are also some great-level developers Handwritten script or software for managing services written using dart's automatic generation function. I have been a flutter developer for several years, and currently I think the best project asset management service is fam.

2. Fam Service #

1. Introduction to Fam

Fam is a dart script service for flutter project asset management service, it relies on pub.dev platform for version control. It supports a variety of platforms, simple operation, beautiful interface, easy to use and so on.

2. Fam Showcase

  1. Asset management file under fam service fam.png

    As can be seen from the figure above, fam divides asset files into directories, making the location of project asset files clear and easy to find.

  2. pubspec.yaml file configuration under fam service

    fam_pub.png

    As can be seen from the above figure, fam only configures the asset file directory path in the pubspec.yaml file, avoiding the configuration of the absolute path of a large asset file.

  3. Asset usage under fam service

    fam_use.png

    As can be seen from the above figure, fam uses asset management class names and dot syntax to obtain asset files, which makes it easier to use asset files in projects.

  4. Asset usage tips under fam service

    fam_tiip.png

    As can be seen from the picture above, when fam uses the asset management file, the prompts of the development editor can be fully read, rather than the prompts of some plug-ins are not fully read, resulting in the final choice may not necessarily be what you want asset file.

Summary : From the above, you can see some basic demonstrations of fam. At the same time, I believe that developers also have an understanding and evaluation of various asset management plug-ins or scripts at this time.

3. Fam Configuration #

Fam is based on pub.dev for version management. So you can use the following command for fam configuration. The command is as follows:

flutter pub global activate fam.

If you have never configured the path of .pub-cache globally, you will be prompted to configure the path of .pub-cache/bin after running the above command. The prompts of each system are as follows:

  1. MacOS users

    pub-catch.png

  2. Windows users

    WechatIMG33.png Note:

    Windows users are advised to use the dart pub global activate fam command to install fam due to system differences. Because pub-cache\bin path is also deleted when deleting flutter file and using other management tools in window system. The Pub\Cache\bin path generated by the dart pub global activate fam command will not be deleted.

After configuring the .pub-cache/bin path according to the above prompts, enter fam help or fam -h in the terminal to check whether fam is installed successfully. fam successful installation is displayed as follows:

fam_help.png

If fam installation fails, it will prompt zsh: command not found: fam.

4. Fam Use #

The fam asset management service script provides many commands, and we will introduce them one by one below.

  1. fam init & fam -i

    Function: Perform the initial configuration of flutter project asset management fam service. Interaction: After the command is executed:

    1. Allows you to enter the file name of the project asset management, the default is fam.dart .

    2. Allows you to enter the class name of the project asset management, the default is FamManager .

      Note:

      1. The naming rules of the file name are composed of lowercase letters and underscores, and the first letter cannot be an underscore, such as fam, fam_file, fam_name_file, etc.

      2. The naming rules of the class name are composed of uppercase letters, lowercase letters and underscores, and the first letter must be an uppercase letter, such as Fam, FamManager, Fam_Name, etc.

    Effect: Execution effect

    fam_init.png

  2. fam run & fam -r

    Function : When a new resource file is added to the project, use this execution order to manage the newly added assets.

    Effect: Execution Effect

    fam_run.png

  3. fam fix & fam -fi

    Function : Repair the fam configuration service of the project, for example: fam asset management files are deleted by mistake or fam record files are deleted by mistake, etc.

    Effect: Execution effect

    fam_fix.png

  4. fam filter size

    Function : Check whether all asset files in the project exceed the specified size, the default is 200KB.

    Effect: Default size instruction 200KB

    fam_filter_200.png

    Effect: Specify size 10 B

    fam_filter_b.png

    You can use the fam filter size -h command to get help, as follows:

    fam_filter_size_h.png

    You can use fam filter size -b 10 or fam filter size -k 10 or fam filter size -m 10 or fam filter size -g 10 etc.

  5. fam filter unused

    Role : Check for unused asset files in the project.

    Effect: Execution effect

    fam_filyer_unused.png

  6. fam filter unused --delete & fam filter unused -d

    Role : Check for unused asset files in the project and delete them at the same time.

    Effect: Execution effect

    fam_filter_unused_d.png

  7. fam release & fam version

    Role : Get fam online version and local installation version

    Effect: Execution effect

    fam_v.png

  8. fam rename class Assets

    Role : Rename the class name of the asset management class of Fam service.

    Effect: Execution effect

    • Before change:

      fam_rename_class.png

    • Management class changes after change:

      fam_rename_class_1.png

    Changes in where items are used after the change:

    fam_rename_class_2.png

  9. fam delete

    fam's deletion service, we can use fam delete -h to view the usage instructions:

    fam_delete.png

    From the above, we can know that fam delete has two instructions, which are fam delete file xx single asset file deletion instruction and fam delete mfile xx multiple asset file deletion instructions.

    • Before deleting files:

      fam_delete_file_1.png

    • After deleting the file: fam delete file assets/name.webp

      fam_delete_flie_2.png

  10. flutter pub global activate fam

    Installation and upgrade instructions for fam.

    1. Installation see fam configuration

    2. Upgrade fam_update.png

5. Update Fam 1.0.5 #

New command added:

  • fam --version

    Get the version of Fam currently installed.

  • fam --releases

    Get all installable stable releases of Fam.

  • fam --update & fam --update x.x.x

    Fam upgrades to the latest version, or you can specify a version upgrade.

6. Added support for native shader resource files #

Shader file type is .frag.

7. Added support for some file types #

Compressed file type: .zip And .rar; Font type: .ttf.

8. Summary #

The above is the basic introduction of Fam. Fam's pub.dev address is Fam address and Git address is Fam address. Welcome everyone to like and like.

11
likes
160
points
73
downloads

Publisher

unverified uploader

Weekly Downloads

Fam is a scripting service for flutter project asset management.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

args, dio, io, path

More

Packages that depend on fam