mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-13 18:12:20 -06:00
feat: extract snippets into widgets, code cleanup document details
This commit is contained in:
34
lib/features/document_details/view/widgets/details_item.dart
Normal file
34
lib/features/document_details/view/widgets/details_item.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DetailsItem extends StatelessWidget {
|
||||
final String label;
|
||||
final Widget content;
|
||||
const DetailsItem({
|
||||
Key? key,
|
||||
required this.label,
|
||||
required this.content,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
content,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
DetailsItem.text(
|
||||
String text, {
|
||||
required this.label,
|
||||
required BuildContext context,
|
||||
}) : content = Text(
|
||||
text,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user