手機直播原始碼,Flutter 自定義 虛線 分割線
手機直播原始碼,Flutter 自定義 虛線 分割線
學習使用Flutter 進行 虛線 自定義控制元件 練習
// 自定義虛線 (預設是垂直方向) class DashedLind extends StatelessWidget { final Axis axis; // 虛線方向 final double dashedWidth; // 根據虛線的方向確定自己虛線的寬度 final double dashedHeight; // 根據虛線的方向確定自己虛線的高度 final int count; // 內部會根據設定的個數和寬度確定密度(虛線的空白間隔) final Color color; // 虛線的顏色 const DashedLind({super.key, required this.axis, this.dashedWidth = 1, this.dashedHeight = 1, this.count = 10, this.color = const Color(0xffaaaaaa) }); @override Widget build(BuildContext context) { return LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { // 根據寬度計算個數 return Flex( direction: axis, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: List.generate(count, (_) { return SizedBox( width: dashedWidth, height: dashedHeight, child: DecoratedBox( decoration: BoxDecoration(color: color), ), ); }),); }); } }
使用方法:
@override Widget build(BuildContext context) { return Scaffold( // 腳手架 appBar: AppBar( title: Text(widget.title), ), body: Center( child: Column( children: [ Container ( height: 200, child: const DashedLind( axis:Axis.vertical, // 垂直方向設定 dashedHeight: 8, count: 12, color: Colors.red, ), ), Container( width: 200, child: const DashedLind( axis: Axis.horizontal, // 水平方向設定 dashedWidth: 6,count: 15, color: Colors.red, ), ) ], ), ), ); } }
以上就是手機直播原始碼,Flutter 自定義 虛線 分割線, 更多內容歡迎關注之後的文章
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978258/viewspace-2992089/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 直播平臺原始碼,Flutter 自定義 虛線 分割線原始碼Flutter
- 影片直播app原始碼,自定義View 線型EditText輸入框APP原始碼View
- RecyclerVieW自定義華麗的分割線View
- 自定義GridView實現分割線解析View
- app直播原始碼,java自定義註解APP原始碼Java
- 用css實現自定義虛線邊框CSS
- 手機直播原始碼,Flutter 中的彈簧按鈕效果原始碼Flutter
- 手機直播原始碼,android 輪播圖自定製元件原始碼Android元件
- flutter 自定義view 繪製曲線統計圖FlutterView
- Flutter自定義折線圖並新增點選事件Flutter事件
- 線上直播原始碼,自定義氣泡效果(BubbleView)原始碼View
- 直播系統app原始碼,TabLayout:自定義字型大小APP原始碼TabLayout自定義字型
- 自定義連線池
- 手機直播原始碼,flutter 隨機數的生成和保留兩位小數原始碼Flutter隨機
- 直播平臺原始碼,flutter 自定義九宮格,計算器佈局,驗證碼認證原始碼Flutter
- app直播原始碼,vue 自定義指令過濾特殊字元APP原始碼Vue字元
- 直播商城原始碼,vue 自定義指令過濾特殊字元原始碼Vue字元
- 直播軟體原始碼,自定義RecyclerView支援快速滾動原始碼View
- 影片直播系統原始碼,自定義背景和狀態管理原始碼
- 線上直播系統原始碼,自定義底部 BottomNavigationBar原始碼Navigation
- 直播平臺搭建原始碼,qt自定義滑動按鈕原始碼QT
- app直播原始碼,uniapp之自定義頂部樣式APP原始碼
- 直播軟體原始碼,vue 自定義指令過濾特殊字元原始碼Vue字元
- app直播原始碼,el-button自定義圖片顯示APP原始碼
- bogo手機直播原始碼部署直播軟體系統搭建!Go原始碼
- 自定義ItemDecoration分割線的高度、顏色、偏移,看完這個你就懂了
- 直播軟體原始碼,自定義修改原本已有的圖示原始碼
- 直播平臺原始碼,自定義下拉重新整理控制元件原始碼控制元件
- 直播原始碼開發,el-button自定義圖片顯示原始碼
- 直播平臺原始碼,el-button自定義圖片顯示原始碼
- app直播原始碼,自定義兩種Activity切換動畫實現APP原始碼動畫
- 成品直播原始碼,如何在開發時自定義快取策略原始碼快取
- 如何用MFC畫出直線、虛線、折線、圓、橢圓、矩形、弧形(附上原始碼)原始碼
- 直播商城原始碼,去掉導航條和tabbar線條原始碼tabBar
- 直播app原始碼,Flutter 彈窗元件APP原始碼Flutter元件
- airtest資料線連線手機AI
- 直播小程式原始碼,react-native自定義文字輸入框原始碼React
- 線上直播原始碼,自定義導航欄並固定居中對齊原始碼