• <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.    

    竹菊影视国产精品| 国产成人亚洲精品91专区手机| 中文字幕在线精品视频入口一区| 国语自产精品视频在线看| 无码精品一区二区三区在线| 国产精品麻豆入口| 亚洲精品伦理熟女国产一区二区| 无码国内精品久久人妻蜜桃| 69堂国产成人精品视频不卡 | 日韩精品无码久久久久久 | 久久久午夜精品福利内容| 亚洲国产精品一区二区久久hs | 国产成人综合一区精品| 久久久99精品免费观看| 熟女少妇精品一区二区| 亚洲av无码国产精品色在线看不卡 | 2020国产精品亚洲综合网| 亚洲国产精品自在线一区二区| 国产亚洲精品无码拍拍拍色欲| 精品福利一区3d动漫| 日本精品视频一区二区三区| 2017国产精品自拍| 日本中文字幕在线精品| 99热这里只有精品免费播放 | 在线综合亚洲中文精品| 亚洲高清日韩精品第一区| 久久久久国产精品免费免费不卡| 最新在线精品国自av| 国产亚洲精品免费视频播放| 久久国产美女免费观看精品| 国产精品自在线拍国产第一页| 精品一区二区三区电影| 国产亚洲精品免费| 国产三级精品三级在线专区| 国产精品三级av及在线观看 | 97久久国产露脸精品国产| 香蕉伊思人在线精品| 黑人大战亚洲人精品一区| 国产亚洲美女精品久久久| 一本色道久久综合亚洲精品| 国产剧情国产精品一区|