aman-satu-flutter/lib/views/settings/component/setting_item.dart

28 lines
683 B
Dart

import 'package:flutter/material.dart';
class SettingItem extends StatefulWidget {
const SettingItem({Key? key, this.name, this.value, this.onTap})
: super(key: key);
final String? name;
final String? value;
final Function()? onTap;
@override
_SettingItemState createState() => _SettingItemState();
}
class _SettingItemState extends State<SettingItem> {
@override
Widget build(BuildContext context) {
return Card(
child: ListTile(
title: Text(widget.name ?? ''),
subtitle: widget.value != null ? Text(widget.value ?? '') : null,
trailing: const Icon(Icons.chevron_right),
onTap: widget.onTap,
),
);
}
}