marquee 1.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new76

marquee

⏩ A Flutter widget that scrolls text infinitely. Provides many customizations, including custom scroll directions and velocities, pausing after every round and specifying custom durations and curves for accelerating and decelerating.

Appreciate the widget? Show some ❤️ and star the repo to support the project.

Usage

This is a minimalistic example:

Marquee(
  text: 'There once was a boy who told this story about a boy: "',
)

And here's a piece of code that makes full use of the marquee's customizability:

Marquee(
  texts: [ 'Some sample text.', 'Some other text.' ],
  style: TextStyle(fontWeight: FontWeight.bold),
  scrollAxis: Axis.horizontal,
  blankSpace: 20.0,
  velocity: 100.0,
  pauseAfterRound: Duration(seconds: 1),
  startPadding: 10.0,
  accelerationDuration: Duration(seconds: 1),
  accelerationCurve: Curves.linear,
  decelerationDuration: Duration(milliseconds: 500),
  decelerationCurve: Curves.easeOut,
)

For more information about the properties, have a look at the API reference.

LICENSE

Copyright (c) 2018 Marcel Garus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Changelog

[1.1.0] - 2018/11/08

  • Support for multiple texts.

[1.0.2] - 2018/10/29

  • Fixed typo.

[1.0.1] - 2018/10/29

  • Shortened app description to meet maintenance guidelines.

[1.0.0] - 2018/10/29

  • Complete overhaul of the widget architecture. Now, no custom widget is accepted as a child, but only text. This is a limitation that was consciously made to allow several other features to be implemented, including:
    • More efficient scrolling that resets after every round.
    • Backwards scrolling.
    • Pauses after every round.
    • Custom durations and curves for accelerating and decelerating.
  • Switched to async handling of scrolling instead of relying on Timer, resulting in a more consistent experience when resuming from a paused app state.
  • Start padding added.
  • API documentation greatly improved. Many examples added.
  • README is more concise.

[0.1.0] - 2018/10/22

  • Added example.

[0.0.2] - 2018/10/22

  • Improved readme.

[0.0.1] - 2018/10/22

  • Initial release featuring custom scrollAxis, blankSpace and velocity.

example/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Marquee',
      home: Scaffold(
        backgroundColor: Colors.deepOrange,
        body: ListView(
          padding: EdgeInsets.only(top: 50.0),
          children: [
            _buildMarquee(),
            _buildComplexMarquee(),
          ].map(_wrapWithStuff).toList(),
        )
      ),
    );
  }

  Widget _buildMarquee() {
    return Marquee(
      text: 'There once was a boy who told this story about a boy: "',
    );
  }

  Widget _buildComplexMarquee() {
    return Marquee(
      texts: [ 'Some sample text.', 'Some other text.' ],
      style: TextStyle(fontWeight: FontWeight.bold),
      scrollAxis: Axis.horizontal,
      blankSpace: 20.0,
      velocity: 100.0,
      pauseAfterRound: Duration(seconds: 1),
      startPadding: 10.0,
      accelerationDuration: Duration(seconds: 1),
      accelerationCurve: Curves.linear,
      decelerationDuration: Duration(milliseconds: 500),
      decelerationCurve: Curves.easeOut,
    );
  }

  Widget _wrapWithStuff(Widget child) {
    return Padding(
      padding: EdgeInsets.all(16.0),
      child: Container(
        height: 50.0,
        color: Colors.white,
        child: child
      )
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  marquee: ^1.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:marquee/marquee.dart';
  
Version Uploaded Documentation Archive
1.1.0 Nov 8, 2018 Go to the documentation of marquee 1.1.0 Download marquee 1.1.0 archive
1.0.2 Oct 29, 2018 Go to the documentation of marquee 1.0.2 Download marquee 1.0.2 archive
1.0.1 Oct 29, 2018 Go to the documentation of marquee 1.0.1 Download marquee 1.0.1 archive
1.0.0 Oct 29, 2018 Go to the documentation of marquee 1.0.0 Download marquee 1.0.0 archive
0.1.0 Oct 22, 2018 Go to the documentation of marquee 0.1.0 Download marquee 0.1.0 archive
0.0.2 Oct 22, 2018 Go to the documentation of marquee 0.0.2 Download marquee 0.0.2 archive
0.0.1 Oct 22, 2018 Go to the documentation of marquee 0.0.1 Download marquee 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
collection ^1.14.11 1.14.11
flutter 0.0.0
Transitive dependencies
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test