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

Fam is a scripting service for flutter project asset management.

icon.png
Author VersionStar Star Purpose

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

Special Note #

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. Brief description #

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.

Four, 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: command 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: command 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: command 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: command execution effect

    fam_filter_unused_d.png

  7. fam release & fam version

    Role: Get fam online version and local installation version Effect: command execution effect

    fam_v.png

  8. fam rename class Assets

    Role: Rename the class name of the asset management class of Fam service. Effect: command 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. Summary #

The above is the basic introduction of Fam. Fam's pub.dev address is Fam address and Git address is [Fam address](https://github .com/zhoushuangjian001/fam). Welcome everyone to like and like.

11
likes
0
pub points
23%
popularity

Publisher

unverified uploader

Fam is a scripting service for flutter project asset management.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, dio, io, path

More

Packages that depend on fam