Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

divider with text flutter

import 'package:flutter/material.dart';


class TitleDivider extends StatelessWidget {
  const TitleDivider({
    Key? key,
    required this.title,
  }) : super(key: key);
  final String title;

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        expandedDivider(),
        textLineGrey(title),
        expandedDivider(),
      ],
    );
  }

  Expanded expandedDivider() {
    return const Expanded(
      child: Divider(
        color: Color(0xffbdbdbd),
        endIndent: 5,
        thickness: 1,
        indent: 5,
      ),
    );
  }
  
  Text textLineGrey(String text) {
  return Text(
    text,
    semanticsLabel: text,
    style: const TextStyle(
      color: Color(0xff9E9E9E),
    ),
  );
}
}
 
PREVIOUS NEXT
Tagged: #divider #text #flutter
ADD COMMENT
Topic
Name
4+3 =