分类标签归档:Flutter

flutter插件keyboard_actions


以简单的方式向Android / iOS键盘添加功能。因为我们在数字模式下专门为Android / iOS提供了键盘,所以不带按钮来隐藏键盘。这会给用户带来很多不便,因此该软件包允许为现有键盘添加功能。

实例

import  'package:flutter/material.dart';
import  'package:keyboard_actions/keyboard_actions.dart';

 //...
  FocusNode _nodeText1 = FocusNode();
  FocusNode _nodeText2 = FocusN...

阅读全文...

flutter插件flutter_offline


一个整洁的实用程序来处理像Boss一样的离线/在线连接。它为iOS和Android平台(offcourse)提供支持。

添加依赖

dependencies:
  flutter_offline: "^0.2.4"

实例

import 'package:flutter/material.dart';
import 'package:flutter_offline/flutter_offline.dart';

class DemoPage extends StatelessWidget {
  @override
  Widget build(BuildCo...

阅读全文...

flutter插件flutter_staggered_grid_view


一个flutter交错的网格视图,支持多列不同大小的行。

添加依赖

dependencies:
  ...
  flutter_staggered_grid_view: "^0.2.7"

实例

new StaggeredGridView.countBuilder(
  crossAxisCount: 4,
  itemCount: 8,
  itemBuilder: (BuildContext context, int index) => new Container(
      color: Colors.green,
      child: new Center(
     ...

阅读全文...

flutter插件bubble_tab_indicator


一个Flutter库,用于向TabBar添加气泡选项卡指示器。

添加依赖

dependencies:
    bubble_tab_indicator: "^0.1.4"

实例

import 'package:bubble_tab_indicator/bubble_tab_indicator.dart';
new TabBar(
  indicatorSize: TabBarIndicatorSize.tab,
  indicator: new BubbleTabIndicator(
    indicatorHeight: 25.0,
    indicatorColo...

阅读全文...

flutter插件fast_qr_reader_view


适用于iOS和Android的Flutter插件,允许访问设备摄像头以扫描多种类型的代码.

添加依赖

dependencies:
  fast_qr_reader_view: ^0.1.5

安装

flutter packages get

实例

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:fast_qr_reader_view/fast_qr_reader_view.dart';

List<CameraDescription&...

阅读全文...

flutter插件flutter_tts


一个flutter的文本到语音插件(Swift,Java)

添加依赖

dependencies:
  flutter_tts: ^0.2.4

安装

flutter packages get

实例

// 实例化
FlutterTts flutterTts = new FlutterTts();
// speak, stop, getLanguages, setLanguage, setSpeechRate, setVolume, setPitch, isLanguageAvailable
Future _speak() async{
    var result = await flutt...

阅读全文...

flutter插件sensors


一个Flutter插件,用于访问加速度计和陀螺仪传感器。

添加依赖

dependencies:
  sensors: ^0.4.0+1

安装

flutter packages get

实例

import 'package:sensors/sensors.dart';

accelerometerEvents.listen((AccelerometerEvent event) {
 // Do something with the event.
});

gyroscopeEvents.listen((GyroscopeEvent event) {
 // Do somet...

阅读全文...

flutter插件fluttertoast


Flutter的Android和iOS Toast Library

添加依赖

dependencies:
  fluttertoast: ^3.0.1

安装

flutter packages get

使用

import 'package:fluttertoast/fluttertoast.dart';
Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: To...

阅读全文...

flutter插件flutter_custom_tabs


自定义标签仅支持Chrome for Android。因此,界面相同,但行为如下:

  • Android

如果已安装Chrome,请在自定义标签中打开您自定义某些外观的网址。如果未安装,请在其他浏览器中打开。

  • iOS

使用url_launcher打开SFSafariViewController,并忽略启动时的所有选项。

添加依赖

dependencies:
  flutter_custom_tabs: "^0.5.0"

实例

import 'package:flutter/material.dart';
import 'package:flutter_custo...

阅读全文...

flutter插件localstorage


简单的基于json文件的存储,用于颤振

添加依赖

dependencies:
  localstorage: ^1.2.0

安装

flutter packages get

实例

class SomeWidget extends StatelessWidget {
  final LocalStorage storage = new LocalStorage('some_key');

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: stor...

阅读全文...