修改 as divider

master
张萌 3 years ago
parent 95ad140480
commit 4837412652

@ -23,8 +23,9 @@ class _ExampleDividerState extends State<ExampleDivider> {
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<ExampleDivider> {
color: Colors.red,
child: 'ASDottedDivider'.text.make(),
),
ASDottedDivider.horizontal(color: Colors.black,),
ASDottedDivider.horizontal(
color: Colors.black,
),
Container(
height: 100.w,
child: Row(
children: [
Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: 'ASDottedDivider'.text.make(),
).expand(),
ASDottedDivider.vertical(
color: Colors.black,
),
Container(
color: Colors.red,
).expand(),
],
),
),
],
),

@ -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,

Loading…
Cancel
Save