• <ul id="cgeq2"></ul>
  • 歡迎您光臨深圳塔燈網絡科技有限公司!
    電話圖標 余先生:13699882642

    網站百科

    為您解碼網站建設的點點滴滴

    flutter跑馬燈

    發表日期:2018-12 文章編輯:小燈 瀏覽次數:2591

    flutter_marquee

    flutter 插件

    flutter 跑馬燈
    可以指定跑馬燈的方向
    可以傳入數組,可以是自定義的widget
    可以控制跑馬燈的時間間隔
    控制點擊事件等等

    效果圖

    QQ20181206-234225.gif

    git

    https://github.com/LiuC520/flutter_marquee

    引入:

    dependencies: flutter: sdk: flutter flutter_marquee: git: https://github.com/LiuC520/flutter_marquee.git 

    屬性

    Attribute 屬性 Description 描述
    children 自定義的widget組件數組
    texts 也可以傳入 字符串數組
    seletedTextColor 當前顯示text的顏色,只有texts有值才生效
    textColor 其他text的顏色,只有texts有值才生效
    duration 跑馬燈的切換時長 默認是4秒
    itemDuration 單個item的動畫出現或者退出時長 默認是500毫秒
    autoStart 是否自動開始動畫
    animationDirection 動畫顯示的切換方式,默認是從上往下切換: AnimationDirection.l2r、AnimationDirection.r2l、AnimationDirection.t2b、AnimationDirection.b2t
    animateDistance 移動的距離: 如果沒有設置就是默認獲取組件寬高,橫向動畫就是組建的寬度,縱向的就是組件的高度
    singleLine 是否是單行顯示: 默認是false
    onChange 點擊事件回調: 回調的參數是跑馬燈的widget的下標

    Example

    1、首先在pubspec.yaml中添加依賴

    dependencies: flutter: sdk: flutter flutter_marquee: git: https://github.com/flutter_marquee/flutter_marquee.git
    import 'package:flutter_marquee/flutter_marquee.dart'; Column( children: <Widget>[ Column( children: <Widget>[ Text("從下到上,時間間隔6秒,傳入的是字符串數組"), Container( margin: EdgeInsets.all(4), height: 60, width: 200, decoration: BoxDecoration( border: Border.all(width: 2, color: Colors.red), borderRadius: BorderRadius.all(Radius.circular(8))), child: FlutterMarquee( texts: ["劉成", "劉成1111", "劉成2222", "劉成3333"].toList(), onChange: (i) { print(i); }, duration: 4), ) ], ), Column( children: <Widget>[ Text("從上到下,時間間隔8秒,傳入的是自定義的text widget"), Container( margin: EdgeInsets.all(4), height: 60, width: 200, decoration: BoxDecoration( border: Border.all(width: 2, color: Colors.red), borderRadius: BorderRadius.all(Radius.circular(8))), child: FlutterMarquee( children: <Widget>[ Text( "劉成", style: TextStyle(color: Colors.red), ), Text("劉成1111", style: TextStyle(color: Colors.green)), Text("劉成2222", style: TextStyle(color: Colors.blue)), Text("劉成3333", style: TextStyle(color: Colors.yellow)), ], onChange: (i) { print(i); }, animationDirection: AnimationDirection.t2b, duration: 8), ) ], ), Column( children: <Widget>[ Text("從左到右,時間間隔2秒,自定義的view"), Container( margin: EdgeInsets.all(4), height: 60, width: 200, decoration: BoxDecoration( border: Border.all(width: 2, color: Colors.red), borderRadius: BorderRadius.all(Radius.circular(8))), child: FlutterMarquee( children: <Widget>[ Center( child: Row( children: <Widget>[ Icon(Icons.menu), Text( "劉成", style: TextStyle(color: Colors.green), ), ], ), ), Center( child: Row( children: <Widget>[ Icon(Icons.add), Text( "劉成1111", style: TextStyle(color: Colors.red), ), ], ), ), Center( child: Row( children: <Widget>[ Icon(Icons.satellite), Text( "劉成2222", style: TextStyle(color: Colors.blue), ), ], ), ), Center( child: Row( children: <Widget>[ Icon(Icons.format_align_justify), Text("劉成3333", style: TextStyle(color: Colors.yellow)), ], ), ), ], onChange: (i) { print(i); }, animationDirection: AnimationDirection.l2r, duration: 2), ) ], ), Column( children: <Widget>[ Text("從右到左,時間間隔6秒"), Container( margin: EdgeInsets.all(4), height: 60, width: 200, decoration: BoxDecoration( border: Border.all(width: 2, color: Colors.red), borderRadius: BorderRadius.all(Radius.circular(8))), child: FlutterMarquee( texts: ["劉成", "劉成1111", "劉成2222", "劉成3333"].toList(), onChange: (i) { print(i); }, animationDirection: AnimationDirection.r2l, duration: 6), ) ], ),

    本頁內容由塔燈網絡科技有限公司通過網絡收集編輯所得,所有資料僅供用戶學習參考,本站不擁有所有權,如您認為本網頁中由涉嫌抄襲的內容,請及時與我們聯系,并提供相關證據,工作人員會在5工作日內聯系您,一經查實,本站立刻刪除侵權內容。本文鏈接:http://www.juherenli.com/17572.html
    相關APP開發
     八年  行業經驗

    多一份參考,總有益處

    聯系深圳網站公司塔燈網絡,免費獲得網站建設方案及報價

    咨詢相關問題或預約面談,可以通過以下方式與我們聯系

    業務熱線:余經理:13699882642

    Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.    

    国产精品三级在线| 人妻少妇精品中文字幕av蜜桃| 91精品国产人成网站| 国产成人精品日本亚洲专区| 模特私拍国产精品久久| 国产成人久久精品激情| 亚洲国产午夜中文字幕精品黄网站| 99re热久久这里只有精品首页| 亚洲精品少妇30p| 香蕉99久久国产综合精品宅男自| 98视频精品全部国产| 久久精品免费电影| 精品日本一区二区三区在线观看| 国产精品久久久久久久久久久不卡 | 日产精品一线二线三线芒果| 国产精品一区12p| 成人精品一区二区激情| 亚洲av午夜精品无码专区| 久久精品中文字幕第一页| 黄床大片免费30分钟国产精品 | 久久91亚洲精品中文字幕| 久久久精品国产Sm最大网站| 国产精品一区二区久久乐下载| 91精品一区二区综合在线| 久热这里只精品99国产6_99| 91精品最新国内在线播放| 永久免费精品影视网站| 国产精品色午夜免费视频| 亚洲国产精品ⅴa在线观看| 久久99精品久久久久久久久久 | 国产亚洲美女精品久久| 久久精品国产亚洲AV未满十八 | 中文字幕精品无码一区二区| mm1313亚洲精品国产| 国产中的精品一区的| 国产精品一卡二卡三卡四卡 | 亚洲第一区精品日韩在线播放| 国产精品视频公开费视频| 国产精品无码无卡在线观看久| 久9热视频这里只精品18| 久久人人做人人玩人精品|