1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import 'package:flutter/material.dart';
- class OrDivider extends StatelessWidget {
- final String title;
- final Color color, textColor;
- OrDivider({
- Key key,
- @required this.title,
- this.color = Colors.grey,
- this.textColor = Colors.white,
- }) : super(key: key);
- @override
- Widget build(BuildContext context) {
- Size size = MediaQuery.of(context).size;
- return Container(
- margin: EdgeInsets.symmetric(vertical: size.height * 0.02),
- width: size.width * 0.8,
- child: Row(
- children: <Widget>[
- buildDivider(),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 10),
- child: Text(
- title,
- style: TextStyle(
- color: textColor,
- fontWeight: FontWeight.w600,
- ),
- ),
- ),
- buildDivider(),
- ],
- ),
- );
- }
- Expanded buildDivider() {
- return Expanded(
- child: Divider(
- color: color,
- height: 1.5,
- ),
- );
- }
- }
|