Fladder/lib/screens/details_screens/components/label_title_item.dart
2025-01-05 13:53:59 +01:00

38 lines
1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class LabelTitleItem extends ConsumerWidget {
final Text? title;
final String? label;
final Widget? content;
const LabelTitleItem({
this.title,
this.label,
this.content,
super.key,
}) : assert(label != null || content != null);
@override
Widget build(BuildContext context, WidgetRef ref) {
return Material(
color: Colors.transparent,
textStyle: Theme.of(context).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.bold),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Opacity(
opacity: 0.6,
child: Material(
color: Colors.transparent, textStyle: Theme.of(context).textTheme.titleMedium, child: title)),
const SizedBox(width: 12),
label != null
? SelectableText(
label!,
)
: content!,
].nonNulls.toList(),
),
);
}
}