flutter_text_sniffer 1.2.0 copy "flutter_text_sniffer: ^1.2.0" to clipboard
flutter_text_sniffer: ^1.2.0 copied to clipboard

A widget that detects specific patterns within a text and makes them interactive.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_text_sniffer_example/custom_text_widgets.dart';
import 'package:flutter_text_sniffer_example/default_text_sniffer.dart';
import 'package:flutter_text_sniffer_example/many_own_patterns.dart';
import 'package:flutter_text_sniffer_example/own_pattern.dart';

void main() {
  runApp(
    const MaterialApp(
      home: MainApp(),
    ),
  );
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          centerTitle: true,
          title: const Text("Text sniffer examples"),
        ),
        body: SizedBox(
          width: double.infinity,
          height: double.infinity,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                  onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) => const DefaultTextSniffer(),
                    ));
                  },
                  child: const Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text("Default text sniffer"),
                      Icon(Icons.arrow_right),
                    ],
                  )),
              ElevatedButton(
                  onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) => const CustomTextWidget(),
                    ));
                  },
                  child: const Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text("Custom text widgets"),
                      Icon(Icons.arrow_right),
                    ],
                  )),
              ElevatedButton(
                  onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) => const OwnPattern(),
                    ));
                  },
                  child: const Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text("Own pattern"),
                      Icon(Icons.arrow_right),
                    ],
                  )),
              ElevatedButton(
                  onPressed: () {
                    Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) => const ManyOwnPatterns(),
                    ));
                  },
                  child: const Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                      Text("Own many patterns"),
                      Icon(Icons.arrow_right),
                    ],
                  )),
            ],
          ),
        ));
  }
}
6
likes
150
points
145
downloads

Publisher

unverified uploader

Weekly Downloads

A widget that detects specific patterns within a text and makes them interactive.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_text_sniffer