parent
e68c860227
commit
d6bf8b7429
@ -0,0 +1,49 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:ansu_ui/extension/sizedbox_extension.dart';
|
||||
|
||||
class ASOptionTileItem extends StatelessWidget {
|
||||
final Widget leading;
|
||||
final Widget title;
|
||||
final onPressed;
|
||||
const ASOptionTileItem({
|
||||
Key key,
|
||||
this.leading,
|
||||
this.title,
|
||||
this.onPressed,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onPressed,
|
||||
borderRadius: BorderRadius.circular(5.w),
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(minHeight: 46.w),
|
||||
child: Row(
|
||||
children: [
|
||||
14.wb,
|
||||
leading ?? SizedBox(),
|
||||
leading != null ? 8.wb : 0.wb,
|
||||
Expanded(
|
||||
child: DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
color: Colors.black.withOpacity(0.65),
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
child: title,
|
||||
),
|
||||
),
|
||||
14.wb,
|
||||
Icon(
|
||||
CupertinoIcons.chevron_forward,
|
||||
size: 16.w,
|
||||
),
|
||||
14.wb,
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
import 'package:ansu_ui/ansu_ui.dart';
|
||||
import 'package:ansu_ui/styles/as_colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ASVerticalTileItem extends StatelessWidget {
|
||||
///标题
|
||||
final String title;
|
||||
|
||||
///child
|
||||
final Widget child;
|
||||
|
||||
final EdgeInsets padding;
|
||||
ASVerticalTileItem({
|
||||
Key key,
|
||||
@required this.title,
|
||||
this.child,
|
||||
this.padding,
|
||||
}) : super(key: key);
|
||||
|
||||
EdgeInsets get _widgetPadding =>
|
||||
padding ??
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 10.w,
|
||||
vertical: 12.w,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: _widgetPadding,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: kTextSubColor,
|
||||
fontSize: 14.sp,
|
||||
),
|
||||
),
|
||||
13.hb,
|
||||
ASDivider(),
|
||||
child,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue