当前位置:网站首页>[shutter] the shutter plug-in is used in the shutter project (shutter plug-in management platform | search shutter plug-in | install shutter plug-in | use shutter plug-in)
[shutter] the shutter plug-in is used in the shutter project (shutter plug-in management platform | search shutter plug-in | install shutter plug-in | use shutter plug-in)
2022-07-02 20:47:00 【Programmer community】
List of articles
- One 、Flutter Package and plug-in management platform
- Two 、Flutter Plug in search example
- 3、 ... and 、Flutter Plug in installation example
- 1、 add to Dart Packet dependency
- 2、 obtain Dart package
- 3、 Use Dart package
- 4、 Official instructions for importing plug-ins
- Four 、Flutter The plug-in USES
- 5、 ... and 、Flutter Application entry
- 6、 ... and 、 Related resources
One 、Flutter Package and plug-in management platform
The module function has been realized , It can be reused completely , Avoid making wheels repeatedly , These functions can be encapsulated in Flutter In bag ;
https://pub.dev/packages Website is Google Officially established management Dart Bao He Flutter Plug in platform ;

Various packages and plug-ins can be searched on this website ;
Two 、Flutter Plug in search example
Search examples : Such as searching for a color plug-in , Search directly in the search box flutter_color_plugin , Then a series of related packages or plug-ins will be searched ;

Click this Dart package , After entering the interface , There will be Instructions ( Readme ) , Update log ( Changelog ) , Example ( Example ) , Installation method ( Instanlling ) , edition ( Versions ) , score ( Scores ) Wait for the tab , Here we only care about how to use ;

3、 ... and 、Flutter Plug in installation example
Dart Package installation : be-all Dart Packages are installed in the same way , There are three steps : ① Add dependency , ② install , ③ Import and use in code ;
1、 add to Dart Packet dependency
Add package dependencies : open Flutter In the root directory of the project pubspec.yaml The configuration file ,
dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 # Add color plug-in dependency flutter_color_plugin: ^0.0.22、 obtain Dart package
Add after completion , And then click " Pub get " Button , Get the Dart package ;

3、 Use Dart package
Import the header file of the plug-in in the code :
import 'package:flutter_color_plugin/flutter_color_plugin.dart';4、 Official instructions for importing plug-ins
Official instructions for importing plug-ins :

Four 、Flutter The plug-in USES
The plug-in supports string colors such as “#FFFFFF” or “#FFFFFF” It can be interpreted as Flutter Medium Color Color objects ;
Color color1 = ColorUtil.color('#f2f2f2');Color color2 = ColorUtil.color('f2f2f2');print(color1 == color2); //trueColor color3 = ColorUtil.color('#a1FF5733');Color color4 = ColorUtil.color('a1FF5733');print(color3 == color4); //trueAt the same time, the plug-in also supports string colors such as “#FFFFFF” or “#FFFFFF” It can be interpreted as int Type color ;
//The following is the sameint colorInt1 = ColorUtil.intColor('#f2f2f2');int colorInt2 = ColorUtil.intColor('f2f2f2');int colorInt3 = ColorUtil.intColor('#fff2f2f2');int colorInt5 = ColorUtil.intColor('fff2f2f2');These usages are found on the plug-in page Readme There are descriptions in the tab ;
stay main.dart Import the color plug-in :
import 'package:flutter_color_plugin/flutter_color_plugin.dart';Set red : stay Text Set the color value of the component in the component , Use here ColorUtil.color(’#FF0000’) Generate red Color object , Set to Text Component style ;
children: <Widget>[ Text( 'You have pushed the button this many times:', // Set the Text style , In red style: TextStyle(color: ColorUtil.color('#FF0000')), ), Text( '$_counter', style: Theme.of(context).textTheme.display1, ), ],Running effect :

5、 ... and 、Flutter Application entry
stay main.dart Medium void main() => runApp(MyApp()) The code identifies the application entry ;

6、 ... and 、 Related resources
Reference material :
- Flutter Official website : https://flutter.dev/
- Flutter Developing documents : https://flutter.cn/docs ( Strongly recommend )
- official GitHub Address : https://github.com/flutter
- Flutter The Chinese community : https://flutter.cn/
- Flutter Practical tutorial : https://flutter.cn/docs/cookbook
- Flutter CodeLab : https://codelabs.flutter-io.cn/
- Dart Chinese document : https://dart.cn/
- Dart Developer website : https://api.dart.dev/
- Flutter Chinese net ( unofficial , The translation is very good ) : https://flutterchina.club/ , http://flutter.axuer.com/docs/
- Flutter Related issues : https://flutterchina.club/faq/ ( It is recommended to watch it at the introductory stage )
Blog source download :
GitHub Address : https://github.com/han1202012/flutter_cmd ( Keep updating with the progress of the blog , There may not be the source code of this blog )
Blog source snapshot : https://download.csdn.net/download/han1202012/15469197 ( The source code snapshot of this blog , You can find the source code of this blog )
边栏推荐
- Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of sound quality head simulators in the global market in 2022
- Research Report on the overall scale, major manufacturers, major regions, products and applications of sliding door dampers in the global market in 2022
- GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
- Share several map bed websites for everyone to share pictures
- What is online account opening? Is it safe to open an account online now?
- [real case] trap of program design - beware of large data
- Is it safe to buy funds on securities accounts? Where can I buy funds
- Properties of expectation and variance
- Solution to blue screen after installing TIA botu V17 in notebook
- For (Auto A: b) and for (Auto & A: b) usage
猜你喜欢

Add two numbers of leetcode

八年测开经验,面试28K公司后,吐血整理出高频面试题和答案

接口测试到底怎么做?看完这篇文章就能清晰明了

Jetson XAVIER NX上ResUnet-TensorRT8.2速度與顯存記錄錶(後續不斷補充)

Roommate, a king of time, I took care of the C language structure memory alignment

Customized Huawei hg8546m restores Huawei's original interface

【871. 最低加油次数】

Jetson XAVIER NX上ResUnet-TensorRT8.2速度与显存记录表(后续不断补充)

Activation function - relu vs sigmoid

Second hand housing data analysis and prediction system
随机推荐
Add two numbers of leetcode
Research Report on the overall scale, major manufacturers, major regions, products and applications of building automation power meters in the global market in 2022
[fluent] dart generic (generic class | generic method | generic with specific type constraints)
2021 software security report: open source code, happiness and disaster depend on each other?
When Valentine's Day falls on Monday
Interested parties add me for private chat
Roommate, a king of time, I took care of the C language structure memory alignment
C language linked list -- to be added
Sword finger offer (I) -- handwriting singleton mode
ROS learning (10): ROS records multiple topic scripts
Burp install license key not recognized
在消费互联网时代,诞生了为数不多的头部平台的话
Cron表达式(七子表达式)
在网上炒股开户安全吗?我是新手,还请指导
Select function
Sword finger offer (II) -- search in two-dimensional array
1007 maximum subsequence sum (25 points) "PTA class a exercise"
This team with billions of data access and open source dreams is waiting for you to join
Welfare | Pu Aries | liv heart co branded Plush surrounding new products are on the market!
Function, function, efficiency, function, utility, efficacy