diff --git a/example/lib/widgets/example_divider.dart b/example/lib/widgets/example_divider.dart index b991a8c..800829a 100644 --- a/example/lib/widgets/example_divider.dart +++ b/example/lib/widgets/example_divider.dart @@ -23,8 +23,9 @@ class _ExampleDividerState extends State { color: Colors.red, child: 'ASDivider'.text.make(), ), - ASDivider(color: Colors.black,), - + ASDivider( + color: Colors.black, + ), Row( children: [ Container( @@ -45,12 +46,25 @@ class _ExampleDividerState extends State { color: Colors.red, child: 'ASDottedDivider'.text.make(), ), - ASDottedDivider.horizontal(color: Colors.black,), + ASDottedDivider.horizontal( + color: Colors.black, + ), + Container( - width: double.infinity, - height: 50.w, - color: Colors.red, - child: 'ASDottedDivider'.text.make(), + height: 100.w, + child: Row( + children: [ + Container( + color: Colors.red, + ).expand(), + ASDottedDivider.vertical( + color: Colors.black, + ), + Container( + color: Colors.red, + ).expand(), + ], + ), ), ], ), diff --git a/lib/divider/as_dotted_divider.dart b/lib/divider/as_dotted_divider.dart index 2676be8..0531c33 100644 --- a/lib/divider/as_dotted_divider.dart +++ b/lib/divider/as_dotted_divider.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class ASDottedDivider extends StatelessWidget { @@ -37,7 +38,8 @@ class ASDottedDivider extends StatelessWidget { : boxConstraints.constrainHeight(); final _dashWidth = dashWidth ?? 10.w; final _dashPattern = (1 + dash![1] / dash![0]); - final int count = (boxWidth / (_dashWidth * _dashPattern)).floor(); + final int count = + (( boxWidth) / (_dashWidth * _dashPattern)).floor(); return Flex( direction: axis, mainAxisAlignment: MainAxisAlignment.spaceBetween,