40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:satu/shared/app_colors.dart';
|
|
import 'package:satu/shared/ui_helpers.dart';
|
|
|
|
class ProductTitleWidget extends StatelessWidget {
|
|
const ProductTitleWidget(
|
|
{required this.name, Key? key, this.ean, this.categoryName})
|
|
: super(key: key);
|
|
|
|
final String name;
|
|
final String? ean;
|
|
final String? categoryName;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
name,
|
|
style: const TextStyle(fontSize: 12, color: textColor),
|
|
overflow: TextOverflow.ellipsis,
|
|
maxLines: 1,
|
|
),
|
|
verticalSpaceTiny,
|
|
if (ean != null)
|
|
Text(
|
|
'Штрих-код: $ean',
|
|
style: const TextStyle(color: placeholderColor, fontSize: 10),
|
|
),
|
|
if (categoryName != null)
|
|
Text(
|
|
'Категория: $categoryName',
|
|
style: const TextStyle(color: placeholderColor, fontSize: 10),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|