swipe_through_text 0.0.1 copy "swipe_through_text: ^0.0.1" to clipboard
swipe_through_text: ^0.0.1 copied to clipboard

retracted

Flutter widget that allows users to swipe through a text.

example/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'SwipeThroughText Demo',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('SwipeThroughText Demo'),
        ),
        body: Container(
          alignment: Alignment.center,
          padding: const EdgeInsets.all(24),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SwipeThroughText(
                text: 'Swipe Through me! limited to 1 line',
                textStyle: const TextStyle(fontSize: 24),
                strikethroughColor: Colors.red,
                strikethroughLineHeight: 4,
                swipeThreshold: 0.5,
                onSwipeComplete: (fraction) {
                  debugPrint('Swipe completed at $fraction');
                },
                onSwipeCancel: (fraction) {
                  debugPrint('Swipe cancelled at $fraction');
                },
                dashArray: const [], // for dotted line use: const [10, 5],
              ),
              const SizedBox(
                height: 10,
              ),
              SwipeThroughText(
                text: 'Swipe Through me! limited to 1 line',
                textStyle: const TextStyle(fontSize: 24),
                strikethroughColor: Colors.green,
                strikethroughLineHeight: 4,
                swipeThreshold: 0.5,
                onSwipeComplete: (fraction) {
                  debugPrint('Swipe completed at $fraction');
                },
                onSwipeCancel: (fraction) {
                  debugPrint('Swipe cancelled at $fraction');
                },
                dashArray: const [10, 5],
              ),
              const SizedBox(
                height: 10,
              ),
              SwipeThroughText(
                text: 'Swipe Through me! limited to 1 line',
                textStyle: const TextStyle(fontSize: 24),
                strikethroughColor: Colors.purple,
                strikethroughLineHeight: 4,
                swipeThreshold: 0.5,
                onSwipeComplete: (fraction) {
                  debugPrint('Swipe completed at $fraction');
                },
                onSwipeCancel: (fraction) {
                  debugPrint('Swipe cancelled at $fraction');
                },
                dashArray: const [], // for dotted line use: const [10, 5],
              ),
            ],
          ),
        ),
      ),
    );
  }
}
7
likes
0
pub points
0%
popularity

Publisher

verified publisherpanarastudios.in

Flutter widget that allows users to swipe through a text.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on swipe_through_text