flutterttsfull 0.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

flutterttsfull #

A new Flutter plugin. support long text tts readding

Getting Started #

支持长文本的tts阅读,并且有相应的回调。

0.0.1 初始版本 #

0.0.2 修复bug,增加播放状态查询 #

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutterttsfull/flutterttsfull.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  Future<void> initPlatformState() async {
    String platformVersion;
    try {
      platformVersion = await Flutterttsfull().platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    _change() async {
      var tts = Flutterttsfull();
      tts.onPlaying = (tag, content, index) => {print('$tag,$content,$index')};
      tts.onStart = (it) => {print('onStart'+it)};
      tts.onNext = (it) => {print('onNext'+it)};
      tts.onFinish = (it) => {print('onFinish'+it)};
      print(await tts.isPlaying());
      await tts.proper(
          "123", "更何况怀里的关怀你电话给谁来电话。"
          "发给i给华盛顿国会山打发撒旦按分阿。"
          "斯蒂芬噶发噶啥大会睡的很阿斯顿", 0);
      tts.start();
      print(await tts.isPlaying());
      setState(() {
        _platformVersion = '123';
      });
    }

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _change,
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutterttsfull: ^0.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutterttsfull/flutterttsfull.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
11
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
82
Overall:
Weighted score of the above. [more]
51
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Linux

Because:

  • package:flutterttsfull/flutterttsfull.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Web

Because:

  • package:flutterttsfull/flutterttsfull.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Windows

Because:

  • package:flutterttsfull/flutterttsfull.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform macOS

Because:

  • package:flutterttsfull/flutterttsfull.dart that declares support for platforms: Android, iOS

Package not compatible with SDK dart

Because:

  • flutterttsfull that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

21 out of 21 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/flutterttsfull.dart. (-1 points)

Analysis of lib/flutterttsfull.dart reported 2 hints:

line 2 col 8: Unused import: 'dart:ffi'.

line 3 col 8: Unused import: 'dart:ui'.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test