flutter_simple_typewriter 1.0.2 copy "flutter_simple_typewriter: ^1.0.2" to clipboard
flutter_simple_typewriter: ^1.0.2 copied to clipboard

A Flutter package that adds a typewriter effect to text fields, enhancing user interface interactivity.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example App',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const ExampleApp(),
    );
  }
}

class ExampleApp extends StatefulWidget {
  const ExampleApp({super.key});

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Typewriter Example')),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            children: [
              const AnimatedTextFormField(
                searchQueries: ['Flutter', 'Dart', 'Typewriter Effect'],
                typeSpeed: Duration(milliseconds: 150),
                delay: Duration(seconds: 1),
                decoration: InputDecoration(
                  border: OutlineInputBorder(),
                  labelText: 'Search',
                ),
              ),
              const SizedBox(
                height: 20,
              ),
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) => const SecondScreen()),
                    );
                  },
                  child: const Text('Go to next screen'))
            ],
          ),
        ),
      ),
    );
  }
}

class SecondScreen extends StatefulWidget {
  const SecondScreen({super.key});

  @override
  State<SecondScreen> createState() => _SecondScreenState();
}

class _SecondScreenState extends State<SecondScreen> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Second Screen')),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Column(
            children: [
              const AnimatedTextFormField(
                searchQueries: ['Flutter', 'Dart', 'Typewriter Effect'],
                typeSpeed: Duration(milliseconds: 150),
                delay: Duration(seconds: 1),
                decoration: InputDecoration(
                  border: OutlineInputBorder(),
                  labelText: 'Search',
                ),
              ),
              const SizedBox(
                height: 20,
              ),
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(
                          builder: (context) => const ExampleApp()),
                    );
                  },
                  child: const Text('Go to Previous screen'))
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
150
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that adds a typewriter effect to text fields, enhancing user interface interactivity.

Repository (GitHub)
View/report issues

Topics

#animation #typewriter

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_simple_typewriter