flutter_process_text 1.1.2 copy "flutter_process_text: ^1.1.2" to clipboard
flutter_process_text: ^1.1.2 copied to clipboard

Flutter plugin to listen the process text stream to get continuous process text intent data.

example/lib/main.dart

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

import 'package:flutter_process_text/flutter_process_text.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({
    Key? key,
  }) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  late final Stream<String> _processText;
  String? refreshedData = '';

  @override
  void initState() {
    super.initState();
    FlutterProcessText.initialize(
      showConfirmationToast: true,
      showRefreshToast: true,
      showErrorToast: true,
      confirmationMessage: "Text Added",
      refreshMessage: "Got all Text",
      errorMessage: "Some Error",
    );
    _processText = FlutterProcessText.getProcessTextStream;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Process Text Plugin'),
        actions: [
          refreshedData != null
              ? IconButton(
                  icon: Icon(Icons.refresh),
                  onPressed: () async {
                    dynamic result =
                        await FlutterProcessText.refreshProcessText;
                    setState(() {
                      refreshedData = result;
                    });
                  },
                )
              : SizedBox(),
        ],
      ),
      body: Column(
        children: [
          SizedBox(height: 100),
          Center(
            child: StreamBuilder<String?>(
              stream: _processText,
              builder: (context, snapshot) {
                return Text('Fetched Data: ${snapshot.data}');
              },
            ),
          ),
          SizedBox(height: 150),
          Text("Refreshed Data: ${refreshedData.toString()}"),
        ],
      ),
    );
  }
}
33
likes
160
pub points
45%
popularity

Publisher

verified publisherhackthedeveloper.com

Flutter plugin to listen the process text stream to get continuous process text intent data.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_process_text