flutter_vertical_marquee 0.2.3

flutter_vertical_marquee #

pub package

screenshot #

image

install #

latest_version: pub package

yaml

dependencies:
  flutter:
    sdk: flutter

  ...
  # marquee
  flutter_vertical_marquee: $latest_version

import in dart:

import 'package:flutter_vertical_marquee/flutter_vertical_marquee.dart';

build widget

  List<String> _tipMarqueeList = [];

  _initMarquee() {
    _tipMarqueeList.clear();
    _tipMarqueeList.addAll(["test1", "test2"]);
  }

  Widget _buildMarquee() {
    _initMarquee();
    var controller = MarqueeController();
    return GestureDetector(
      child: Container(
        height: 40.0,
        color: Colors.lightBlueAccent.shade100,
        child: Marquee(
          textList: _tipMarqueeList, // List<Text>, textList and textSpanList can only have one of code.
          textSpanList: // List<TextSpan> text, textList and textSpanList can only have one of code.
          fontSize: 14.0, // text size
          scrollDuration: Duration(seconds: 1), // every scroll duration
          stopDuration: Duration(seconds: 3), //every stop duration
          tapToNext: false, // tap to next
          textColor: Colors.black, // text color
          controller: controller, // the controller can get the position
        ),
      ),
      onTap: () {
        print(controller.position); // get the position
      },
    );
  }

or see example tab

call me #

email cjl_spy@163.com

CHANGELOG #

[0.2.3]

fix a position bug

[0.2.2]

fix position bug

[0.2.1]

fix if

[0.2.0] support text span

[0.1.1] fix bug

[0.1.0]

first version

example/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  MyAppState createState() {
    return new MyAppState();
  }
}

class MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: Text('title'),
          ),
          body: Column(
            children: <Widget>[
              _buildMarquee(),
            ],
          )),
      initialRoute: "home",
    );
  }

  List<String> _tipMarqueeList = [];

  _initMarquee() {
    _tipMarqueeList.clear();
    _tipMarqueeList.addAll(["test1", "test2"]);
  }

  Widget _buildMarquee() {
    _initMarquee();
    var controller = MarqueeController();
    return GestureDetector(
      child: Container(
        height: 40.0,
        color: Colors.lightBlueAccent.shade100,
        child: Marquee(
          textList: _tipMarqueeList, // your text list
          fontSize: 14.0, // text size
          scrollDuration: Duration(seconds: 1), // every scroll duration
          stopDuration: Duration(seconds: 3), //every stop duration
          tapToNext: false, // tap to next
          textColor: Colors.black, // text color
          controller: controller, // the controller can get the position
        ),
      ),
      onTap: () {
        print(controller.position); // get the position
      },
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_vertical_marquee: ^0.2.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_vertical_marquee/flutter_vertical_marquee.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Jul 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/src/marquee.dart.

Run flutter format to format lib/src/marquee.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

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

Admin