morphing_text 1.0.0-nullsafety.1 copy "morphing_text: ^1.0.0-nullsafety.1" to clipboard
morphing_text: ^1.0.0-nullsafety.1 copied to clipboard

outdated

Text animations inspired by https://github.com/lexrus/LTMorphingLabel

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:morphing_text/morphing_text.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Morhing text',
      theme: ThemeData(
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key}) : super(key: key);

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

class _MyHomePageState extends State<MyHomePage> {
  static const List<String> text = [
    "Design",
    "Design is not just",
    // "what it looks like",
    // "and feels like.",
    // "Design",
    // "Design is how it works.",
    // "- Steve Jobs",
  ];

  List<Widget> animations = [
    EvaporateMorphingText(
      texts: text,
      loopForever: true,
      onComplete: () {
        print("Completed");
      },
      textStyle: TextStyle(fontSize: 30.0),
    ),
    ScaleMorphingText(
      texts: text,
      loopForever: true,
      onComplete: () {
        print("Completed");
      },
      textStyle: TextStyle(fontSize: 30.0),
    ),
  ];

  int index = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: animations[index % animations.length],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            index++;
          });
        },
        child: Icon(Icons.arrow_forward_ios),
      ),
    );
  }
}
55
likes
0
pub points
59%
popularity

Publisher

verified publisherdarshanrander.com

Text animations inspired by https://github.com/lexrus/LTMorphingLabel

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on morphing_text