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.
43 lines
1.2 KiB
43 lines
1.2 KiB
import 'package:flutter/cupertino.dart'; |
|
|
|
class CupertinoListTile extends StatelessWidget { |
|
final Widget? leading; |
|
final Widget? title; |
|
final Widget? subtitle; |
|
final Widget? trailing; |
|
|
|
const CupertinoListTile({ Key? key, this.leading, this.title, this.subtitle, this.trailing, }) : super(key: key); |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return Row( |
|
mainAxisSize: MainAxisSize.max, |
|
children: [ |
|
if (leading != null) |
|
leading!, |
|
Expanded( |
|
child: Column( |
|
mainAxisSize: MainAxisSize.min, |
|
children: [ |
|
if (title != null) |
|
title!, |
|
if (subtitle != null) |
|
CupertinoTheme( |
|
data: CupertinoTheme.of(context).copyWith( |
|
textTheme: CupertinoTextThemeData( |
|
textStyle: TextStyle( |
|
fontSize: CupertinoTheme.of(context).textTheme.textStyle.fontSize! - 2, |
|
) |
|
) |
|
), |
|
child: subtitle!, |
|
), |
|
], |
|
), |
|
), |
|
if (trailing != null) |
|
trailing!, |
|
], |
|
); |
|
} |
|
} |