flutter_heyteacher_text_to_speech 2.0.13+152 copy "flutter_heyteacher_text_to_speech: ^2.0.13+152" to clipboard
flutter_heyteacher_text_to_speech: ^2.0.13+152 copied to clipboard

The flutter heyteacher text-to-speech (TTS) utilities localized in six languages

flutter_heyteacher_text_to_speech #

A Flutter package for managing Text-to-Speech (TTS) functionalities, specifically designed for the Flutter HeyTeacher ecosystem. This package provides view models for controlling TTS output and UI components for user settings.

Features #

  • TTS Management: Control text-to-speech output using TTSViewModel.
  • UI Components: Ready-to-use widgets like EnableTTSChoiceCard for enabling/disabling TTS.
  • Localization: Integrated localization support via FlutterHeyteacherTextToSpeechLocalizations.

The components in this packages are implemented following Model-View-ViewModel (MVVM) architecture and Singleton pattern.

Getting started #

Add the package to your pubspec.yaml:

dependencies:
  flutter_heyteacher_text_to_speech: ^2.0.4

Usage #

Parameters #

Configuration is set during TTSViewModel.instance(bool? defaultEnabled, int? thresholdInSeconds) initialization.

  • defaultEnabled: if is enabled by default (true by default)
  • thresholdInSeconds: the minimum interval in seconds between messages speaked (5 by default)

TTS Control #

Use TTSViewModel to handle speech operations.

import 'package:flutter_heyteacher_text_to_speech/text_to_speech.dart';

void main() async {
  // Example: Speak a sentence
  await TTSViewModel.instance().speak('Hello, welcome to HeyTeacher!');
}

UI Components #

Use EnableTTSChoiceCard to allow users to toggle TTS settings within your application.

import 'package:flutter/material.dart';
import 'package:flutter_heyteacher_text_to_speech/text_to_speech.dart';

class SettingsScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: EnableTTSChoiceCard(),
      ),
    );
  }
}
0
likes
160
points
12
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

The flutter heyteacher text-to-speech (TTS) utilities localized in six languages

Repository
View/report issues

Topics

#flutter #text-to-speech #tts

Funding

Consider supporting this project:

liberapay.com

License

BSD-3-Clause (license)

Dependencies

clock, flutter, flutter_heyteacher_locale, flutter_heyteacher_platform, flutter_localizations, flutter_tts, intl, logging, shared_preferences

More

Packages that depend on flutter_heyteacher_text_to_speech