Git Product home page Git Product logo

text_marquee_package's Introduction

scrolling_text

This package can be used to make a scrolling text widget(marquee) same as shown on bottom of the news channel.

Features

  • custom text style
  • start and ending offset for text
  • you can have callback function on the end of any text scrolling
  • controlled speed with speed and rest parameters
  • vertical or horizontal scroll direction

Usage

Add this Project to Pubspec and import as

import 'package:scrolling_text/scrolling_text.dart';

You can use as this to play multiple text in marquee

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Scrolling Text Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          body: Center(
            child: Container(
              width: 30,
              color: const Color.fromARGB(255, 128, 184, 230),
              padding: const EdgeInsets.all(10),
              child: ScrollingText(
                text: news[index],
                scrollAxis: Axis.vertical,
                onFinish: () {
                  if (index < news.length) {
                    index++;
                  } else {
                    index = 0;
                  }
                  setState(() {});
                },
              ),
            ),
          ),
        ));
  }
}

int index = 0;
List<String> news = [
  'Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content',
  'Lorem Ipsum is simply dummy text of the printing and typesetting industry',
  'It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using  making it look like readable English.'
];

Basic Results

Horizontal Example:

Vertical Example

text_marquee_package's People

Contributors

innovatoraakash avatar

Stargazers

Purna Kalyan Shakya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.