简体   繁体   中英

How to test the working of flutter package?

What would be the best practice to test the working of flutter package?

Recently I developed a Flutter package and I am testing its functionality by creating another flutter application and importing it to there, in this way I have to deal with two projects. Is there any method to do all it in the same project like android native development?

example/ directory contains only example.dart which is not runable? Any suggestion ?

Answer based off of Shahzad's flutter_tex package , and thanks to Remi's suggestion.

As mentioned, one way to test a package in Flutter is to create a Flutter app within the "Example" directory. In this app, list the following in the pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  your_package_name:
    path: ../

As shown, you specify your package's path, which is the level above the "Example" folder the test app resides in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM