一统天下 flutter - widget 媒体类: Divider - 分隔线

源码 https://github.com/webabcd/flutter_demo
作者 webabcd

一统天下 flutter - widget 媒体类: Divider - 分隔线

示例如下:

lib\widget\media\divider.dart

/*
 * Divider - 分隔线
 */

import 'package:flutter/material.dart';

class DividerDemo extends StatefulWidget {
  const DividerDemo({Key? key}) : super(key: key);

  @override
  _DividerDemoState createState() => _DividerDemoState();
}

class _DividerDemoState extends State<DividerDemo> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("title")),
      backgroundColor: Colors.orange,
      body: Center(
        child: Container(
          color: Colors.blue,
          child: const Divider(
            height: 200,        /// Divider 组件的高度(不是实际分隔线的高度)
            thickness: 20,      /// 分隔线的高度,会在 Divider 组件的中间绘制此直线
            color: Colors.red,  /// 分隔线的颜色
            indent: 10,         /// 分隔线左侧的缩进值
            endIndent: 10,      /// 分隔线右侧的缩进值
          ),
        ),
      ),
    );
  }
}

源码 https://github.com/webabcd/flutter_demo
作者 webabcd

posted @ 2023-03-23 15:52  webabcd  阅读(113)  评论(0编辑  收藏  举报