focused_text 1.0.1 copy "focused_text: ^1.0.1" to clipboard
focused_text: ^1.0.1 copied to clipboard

A text widget that focuses on a specific paragraph or phrase. Inspired by the lyrics view in Apple Music.

example/main.dart

import 'package:flutter/material.dart';
import 'package:focused_text/src/focused_text_widget.dart';

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

/// Demo text.
const String _text = """
I had a vision of you
And just like that.
I was left to live without it
Left to live without it.
I found a version of love
And just like that.
I was left to live without it
Left to live without it.

Waiting for this storm to pass.
Waiting on this side of the glass.
But I see my reflection in you
See your reflection in me.
How could it be?.
How could it be?.

There is something between us
Between me and you.
There is something between us
I see right through
I see right through.

I had a version of home
And just like that.
I was left to live without it
Left to live without it.
I had a person I loved
And just like that.
I was left to live without him
Left to live without him.

Waiting for this storm to pass.
Waiting on this side of the glass.
But I see my reflection in you
See your reflection in me.
How can it be?.
How can it be?.

There is something between us
Between me and you.
There is something between us
I see right through
I see right through.

There is something between us
Between me and you.
There is something between us
I see right through
I see right through.

I had a vision of you
And just like that.
I was left to live without it
Left to live without it.
Waiting on this side of the glass.
""";

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SizedBox(
            width: 300,
            height: 300,
            child: FocusedTextWidget.fromString(
              text: _text,
              resizeFactor: 0.4,
              autoPlay: true,
              autoPlayDuration: const Duration(seconds: 3),
            ),
          ),
        ),
      ),
    );
  }
}
6
likes
160
pub points
41%
popularity

Publisher

verified publisherdennisaurus.dev

A text widget that focuses on a specific paragraph or phrase. Inspired by the lyrics view in Apple Music.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on focused_text