You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.6 KiB

4 years ago
// Flutter imports:
import 'package:flutter/material.dart';
4 years ago
// Package imports:
import 'package:flutter_screenutil/flutter_screenutil.dart';
4 years ago
///自定义分割线
class GridientDiveder {
4 years ago
final bool isReverse; //颜色方向反转
const GridientDiveder({Key? key, this.isReverse = false});
Widget verticalDivider(double height) {
return Container(
width: 1.w,
height: height,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: isReverse
? [
Color(0xFFE8E8E8),
Color(0xFFFFFFFF),
]
: [
Color(0xFFFFFFFF),
Color(0xFFE8E8E8),
])),
);
}
4 years ago
Widget horizontalDivider(double width) {
return Container(
width: width,
height: 1.w,
decoration: BoxDecoration(
gradient: LinearGradient(
4 years ago
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: isReverse
? [
Color(0xFFE8E8E8),
Color(0xFFFFFFFF),
]
: [
Color(0xFFFFFFFF),
Color(0xFFE8E8E8),
])),
);
}
}
4 years ago
class AkuBox {
///生成 高度为设计高度的SizedBox
4 years ago
static h(double height) {
return SizedBox(
height: height.w,
);
}
///生成 宽度为设计高度的SizedBox
4 years ago
static w(double width) {
return SizedBox(
width: width.w,
);
}
}