flutter w10抓包
Flutter is “Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.”
Flutter是“ Google的UI工具包,可通过单个代码库为移动,Web和桌面构建漂亮的,本机编译的应用程序。”
Flutter is based on the Dart programming language. It has a large and lively community on Dart.dev, offering both officially supported and third-party packages to make Flutter development even more productive.
Flutter基于Dart编程语言。 它在Dart.dev上拥有一个庞大而活跃的社区,同时提供官方支持和第三方软件包,从而使Flutter开发更加高效。
This article lists the most promising and most popular packages to give you an idea of Flutter’s maturity as a platform.
本文列出了最有前途和最受欢迎的软件包,以使您了解Flutter作为平台的成熟度。
If you haven’t done so already, read my introductory article first. It will get you set up and running with a basic Flutter project in no time. This allows you to try out the packages you like most quickly!
如果您还没有这样做, 请先阅读我的介绍性文章 。 它使您立即设置并运行基本的Flutter项目。 这使您可以最快地试用自己喜欢的软件包!
(1. HTTP)
URL: https://pub.dev/packages/httpWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/http适用于:iOS,Android,Web
Everything is web-based these days, so a robust HTTP library is a must-have. This Dart package contains a set of high-level functions and classes that make it easy to consume HTTP resources. It’s well developed and actively maintained by the Dart team. It has been around since 2012, so it should be rock-solid!
如今,所有内容都基于网络,因此必须具有强大的HTTP库。 该Dart程序包包含一组高级函数和类,可轻松使用HTTP资源。 它是Dart团队精心开发并积极维护的。 自2012年以来一直存在,因此应该坚如磐石!
The library offers top-level functions that make it easy to work with HTTP:
该库提供了顶级功能,可轻松使用HTTP:
import 'package:http/http.dart' as http;# Posting data
var url = 'https://example.com/whatsit/create';
var data = {'name': 'Jack', 'age': 38};var response = await http.post(url, body: data);print('Response status: ${response.statusCode}');
print('Response body: ${response.body}');# A simple GET request
print(await http.read('https://example.com/foobar.txt'));
(2. flutter_slidable)
URL: https://pub.dev/packages/flutter_slidableWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/flutter_slidable 适用于:iOS,Android,Web
source) 源 )
The flutter_slidable plugin adds a feature-rich slider widget to your project. Sliders like this are often seen in scrollable lists. The Gmail app is a notable example, in which sliding list items offer a significant productivity enhancement.
flutter_slidable插件向您的项目添加了功能丰富的滑块小部件。 这样的滑块经常出现在可滚动列表中。 Gmail应用程序是一个著名的例子,其中滑动列表项显着提高了工作效率。
This plugin is packed with features and ready for use, but also highly customizable if needed. Some of the listed features are:
该插件具有很多功能,可以立即使用,但是如果需要,还可以高度自定义。 列出的一些功能包括:
- Accepts primary (left/top) and secondary (right/bottom) widget lists as slide actions
- Can be dismissed
- Four built-in action panes
- Two built-in slide action widgets
- Built-in dismiss animation
- Easily create custom layouts and animations
- Closes when a slide action has been tapped (overridable)
- Closes when the nearest Scrollable starts to scroll (overridable) 当最近的Scrollable开始滚动(可覆盖)时关闭
- Option to disable the slide effect easily
(3. Shared Preferences)
URL: https://pub.dev/packages/shared_preferencesWorks on: iOS, Android, Web, Linux
网址: https : //pub.dev/packages/shared_preferences适用于:iOS,Android,Web,Linux
This package wraps platform-specific persistent storage libraries. It’s indented for simple data, like user preferences, and it uses:
该软件包包装了特定于平台的持久性存储库。 它缩进用于简单数据,例如用户首选项,并且使用:
- NSUserDefaults on iOS and macOS iOS和macOS上的NSUserDefaults
- SharedPreferences on Android Android上的SharedPreferences
- LocalStorage on websites 网站上的LocalStorage
- A JSON file on the local filesystem for Linux
Data may be persisted to disk asynchronously, and there is no guarantee that writes will be persisted to disk after returning, so this plugin is not meant for storing critical data. For that look into sqflite (see below).
数据可能 异步存储到磁盘上,并且不能保证返回后将写操作保留到磁盘上,因此此插件不用于存储关键数据。 为此,请查看sqflite(请参阅下文)。
(4. sqflite)
URL: https://pub.dev/packages/sqfliteWorks on: iOS, Android, MacOS
网址: https : //pub.dev/packages/sqflite适用于:iOS,Android,MacOS
This is the SQLite plugin for Flutter. It supports iOS, Android, and MacOS. The web is not supported since there is no SQL-based persistence system in web browsers. Some of its features are:
这是 FlutterSQLite插件。 它支持iOS,Android和MacOS。 不支持Web,因为Web浏览器中没有基于SQL的持久性系统。 它的一些功能是:
- Support for transactions and batches
- Automatic version management
- Helpers for insert/query/update/delete queries
- Operations are executed in a background thread on iOS and Android to prevent the UI from locking up
If you need more than basic (shared_preferences) data storage, look no further.
如果您需要的不仅仅是基本( shared_preferences )数据存储,那就别shared_preferences 。
(5. url_launcher)
URL: https://pub.dev/packages/url_launcherWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/url_launcher适用于:iOS,Android,Web
This plugin helps you launch a URL. URLs can be of the following types:
此插件可帮助您启动URL。 URL可以是以下类型:
- HTTP: http://example.org and https://example.org HTTP: http : //example.org和https://example.org
- E-mail: mailto:<e-mail address>
- Phone numbers: tel:<phone number>
- SMS text message: sms:<phone number>
Basic usage is very straightforward:
基本用法非常简单:
const url = 'https://flutter.dev';if (await canLaunch(url)) {await launch(url);
} else {throw 'Could not launch $url';
}
(6. video_player)
URL: https://pub.dev/packages/video_playerWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/video_player适用于:iOS,Android,Web
pub.dev pub.dev的图像和示例视频
Many formats are supported, but it all depends on the platform you’re running. For example, the backing libraries differ for iOS and Android. Also, on the web, the supported formats depend on the browser you’re using.
支持多种格式,但这都取决于您正在运行的平台。 例如,iOS和Android的后备库不同。 另外,在网络上,支持的格式取决于您使用的浏览器。
Note that even though it’s called video_player, this plugin can also play audio. Since the plugin is pretty mature and has reached API stability, it’s not a bad idea to use this for audio over some of the alternatives.
请注意,即使它名为video_player,该插件也可以播放音频。 由于该插件已经相当成熟并且已经达到API的稳定性,因此在一些替代方案中使用它来进行音频播放并不是一个坏主意。
This plugin can play video from a local file (assets) and a remote server (e.g., a website). For some example code, head over to this page.
该插件可以播放来自本地文件(资产)和远程服务器(例如网站)的视频。 有关一些示例代码,请转到此页面 。
(7. crypto)
Works on: All platforms
适用于:所有平台
Comping from the Dart team itself, this is a set of cryptographic hashing functions implemented in pure Dart. This means you don’t need external libraries to make this work.
由Dart团队本身进行比较,这是一组在纯Dart中实现的加密哈希函数。 这意味着您不需要外部库即可完成这项工作。
The following hashing algorithms are supported:
支持以下哈希算法:
- SHA-1
- SHA-224
- SHA-256
- SHA-384
- SHA-512
- MD5
- HMAC (i.e. HMAC-MD5, HMAC-SHA1, HMAC-SHA256)
Since this is not a GUI tool but simply a crypto library, it works on all supported platforms.
由于这不是GUI工具而是一个加密库,因此它可在所有受支持的平台上使用。
(8. carousel_slider)
URL: https://pub.dev/packages/carousel_sliderWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/carousel_slider适用于:iOS,Android,Web
Sample carousel from pub.dev 来自 pub.dev的样 本轮播
A carousel slider is part of many apps and websites. The carousel_slider plugin offers an excellent and customizable carousel that works on multiple platforms.
轮播滑块是许多应用程序和网站的一部分。 carousel_slider插件提供了可在多个平台上运行的出色且可自定义的轮播。
Because the carousel accepts widgets as content, you can slide anything that can be a widget.
由于轮播接受小部件作为内容,因此您可以滑动任何可以成为小部件的东西。
For live examples, you can visit this website, which uses Flutter web to demo the plugin.
有关实时示例,您可以访问此网站 , 该网站使用Flutter网站演示了该插件。
Here’s an example of how to create a carousel in your app:
这是有关如何在应用中创建轮播的示例:
CarouselSlider(
options: CarouselOptions(height: 400.0),
items: [1,2,3,4,5].map((i) {
return Builder(
builder: (BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
color: Colors.amber
),
child: Text('text $i', style: TextStyle(fontSize: 16.0),)
);
},
);
}).toList(),
)
The carousel has several configurable options, like:
轮播有几个可配置的选项,例如:
- the height and aspect ratio
- enabling infinite scrolling
- reversing the carousel
- enabling autoplay with a configurable interval, animation duration
- defining the scroll direction (vertical, horizontal)
(9. path)
URL: https://pub.dev/packages/pathWorks on: iOS, Android, Web
网址: https : //pub.dev/packages/path适用于:iOS,Android,Web
Paths are both easy and incredibly complex because they differ from platform to platform. To make sure you don’t introduce bugs or security vulnerabilities in your code, always use the path library when dealing with paths. To join a directory and a file with the file separator for the current OS, use:
路径既简单又难以置信,因为各个平台的路径不同。 为确保您不会在代码中引入错误或安全漏洞,请在处理路径时始终使用路径库。 要使用当前操作系统的文件分隔符将目录和文件联接在一起,请使用:
import 'package:path/path.dart' as p;p.join('directory', 'file.txt');
(10. location)
URL: https://pub.dev/packages/locationWorks on: iOS, Android, Web, MacOS
网址: https : //pub.dev/packages/location适用于:iOS,Android,Web,MacOS
One of the great things about phones is their mobility combined with the ability to accurately track location. This has already given us many useful applications. The location plugin for Flutter makes it easy to get access to the current location. It provides callbacks when the location has changed. It also offers API endpoints to properly request access to a user’s location.
手机的一大优点是其移动性以及准确跟踪位置的能力。 这已经给了我们许多有用的应用程序。 Flutter的位置插件可轻松访问当前位置。 位置更改后,它将提供回调。 它还提供API端点,以正确请求访问用户位置。
source) 源 )
This is my top ten. What are your favorite Flutter packages? Let me know in the comments!
这是我的前十名。 您最喜欢的Flutter套件是什么? 在评论中让我知道!
翻译自: https://medium.com/better-programming/the-10-best-and-most-liked-flutter-packages-f5813822e118
flutter w10抓包