floating_text 0.2.0 copy "floating_text: ^0.2.0" to clipboard
floating_text: ^0.2.0 copied to clipboard

A light weight flutter package that provides beautiful floating text animations.

example/lib/main.dart

//Author : Pradeep Tintali
//github : github.com/pktintali

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'FloatingText Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: CustomCardsExample(),
    );
  }
}

class CustomCardsExample extends StatefulWidget {
  @override
  _CustomCardsExampleState createState() => _CustomCardsExampleState();
}

class _CustomCardsExampleState extends State<CustomCardsExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: const Text(
          'FloatingText Example',
        ),
      ),
      body: Center(
        //Using Floating Text as a Widget
        child: FloatingText(
          onAnimationComplete: () {
            print('Animation Completed');
          },
          repeat: true,
          repeatCount: 3,
          text: 'Congratulations',
          duration: Duration(milliseconds: 150),
          //Customize your text
          textStyle: const TextStyle(
            fontSize: 40,
            color: Colors.black54,
          ),
          //Customize your Floating text
          floatingTextStyle: const TextStyle(
            color: Colors.red,
            fontSize: 50,
            shadows: const [
              BoxShadow(
                color: Colors.yellow,
                blurRadius: 10,
              )
            ],
          ),
        ),
      ),
    );
  }
}
35
likes
130
pub points
69%
popularity

Publisher

verified publisherstudentmitra.in

A light weight flutter package that provides beautiful floating text animations.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on floating_text