40 lines
1.2 KiB
Dart
40 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:satu/shared/app_colors.dart';
|
|
import 'package:satu/shared/ui_helpers.dart';
|
|
import 'package:satu/views/work/tabs/component/product_list_item.dart';
|
|
|
|
class ProductTitleWidget extends StatelessWidget {
|
|
const ProductTitleWidget({Key? key, required this.name, 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: TextStyle(fontSize: 12.sp, color: textColor),
|
|
overflow: TextOverflow.ellipsis,
|
|
maxLines: 2,
|
|
),
|
|
verticalSpaceTiny,
|
|
if (ean != null)
|
|
Text(
|
|
'Штрих-код: ${ean}',
|
|
style: TextStyle(color: placeholderColor, fontSize: 8.sp),
|
|
),
|
|
if (categoryName != null)
|
|
Text(
|
|
'Категория: ${categoryName}',
|
|
style: TextStyle(color: placeholderColor, fontSize: 8.sp),
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|