aves/lib/widgets/common/menu_row.dart
2020-05-24 10:21:43 +09:00

35 lines
743 B
Dart

import 'package:aves/widgets/common/icons.dart';
import 'package:flutter/material.dart';
class MenuRow extends StatelessWidget {
final String text;
final IconData icon;
final bool checked;
const MenuRow({
Key key,
this.text,
this.icon,
this.checked,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
if (checked != null) ...[
Opacity(
opacity: checked ? 1 : 0,
child: const Icon(AIcons.checked),
),
const SizedBox(width: 8),
],
if (icon != null) ...[
Icon(icon),
const SizedBox(width: 8),
],
Expanded(child: Text(text)),
],
);
}
}