Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5861b9210c | |||
| a678c3806e |
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.0.80] - 2026-06-24
|
||||||
|
|
||||||
|
### 新功能
|
||||||
|
- 出库单详情新增「售价」与「利润」列,利润 = 售价 − 成本,一眼看清每笔出库的盈亏。
|
||||||
|
|
||||||
|
### 改进
|
||||||
|
- 出库 / 入库单详情改为全屏展示,内容更大更清晰,左上角返回箭头关闭。
|
||||||
|
- 出库单详情自动带出商品的生产日期与批次号(明细未单独填写时回退商品资料),去掉冗余的「数量」列。
|
||||||
|
|
||||||
|
## [1.0.79] - 2026-06-24
|
||||||
|
|
||||||
|
### 改进
|
||||||
|
- 入库单 / 出库单搜索框升级:搜索后关键词以标签形式显示在搜索框内,带一键清除(✕)按钮,输入框自动清空便于继续输入;当前仅支持单个搜索词。
|
||||||
|
|
||||||
## [1.0.78] - 2026-06-24
|
## [1.0.78] - 2026-06-24
|
||||||
|
|
||||||
### 改进
|
### 改进
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ class StockOutItem {
|
|||||||
productSeries: lineOrProduct('series', 'series'),
|
productSeries: lineOrProduct('series', 'series'),
|
||||||
productSpec: lineOrProduct('spec', 'spec'),
|
productSpec: lineOrProduct('spec', 'spec'),
|
||||||
productUnit: (json['product'] as Map<String, dynamic>?)?['unit'] as String?,
|
productUnit: (json['product'] as Map<String, dynamic>?)?['unit'] as String?,
|
||||||
batchNo: json['batch_no'] as String?,
|
// 批次号/生产日期:优先明细行快照,回退 product 关联(App 新建单据快照列常为空)
|
||||||
productionDate: json['production_date'] as String?,
|
batchNo: lineOrProduct('batch_no', 'batch_no'),
|
||||||
|
productionDate: lineOrProduct('production_date', 'production_date'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ class StockInListNotifier extends AsyncNotifier<PageResult<StockInOrder>> {
|
|||||||
/// 当前服务端状态过滤值(供页面进入时对齐标签/下拉,避免重复拉取)
|
/// 当前服务端状态过滤值(供页面进入时对齐标签/下拉,避免重复拉取)
|
||||||
String get currentStatus => _status;
|
String get currentStatus => _status;
|
||||||
|
|
||||||
|
String get currentKeyword => _keyword;
|
||||||
|
|
||||||
void setStatus(String status) {
|
void setStatus(String status) {
|
||||||
_status = status;
|
_status = status;
|
||||||
_page = 1;
|
_page = 1;
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ class StockOutListNotifier extends AsyncNotifier<PageResult<StockOutOrder>> {
|
|||||||
/// 当前服务端状态过滤值(供页面进入时对齐标签/下拉,避免重复拉取)
|
/// 当前服务端状态过滤值(供页面进入时对齐标签/下拉,避免重复拉取)
|
||||||
String get currentStatus => _status;
|
String get currentStatus => _status;
|
||||||
|
|
||||||
|
String get currentKeyword => _keyword;
|
||||||
|
|
||||||
void setStatus(String status) {
|
void setStatus(String status) {
|
||||||
_status = status;
|
_status = status;
|
||||||
_page = 1;
|
_page = 1;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import '../../widgets/multi_select_dropdown.dart' show ColDef, ColumnToggleButto
|
|||||||
import '../../core/storage/column_prefs.dart';
|
import '../../core/storage/column_prefs.dart';
|
||||||
import '../../widgets/page_scaffold.dart';
|
import '../../widgets/page_scaffold.dart';
|
||||||
import '../../widgets/status_badge.dart';
|
import '../../widgets/status_badge.dart';
|
||||||
|
import '../../widgets/search_chip.dart';
|
||||||
import '../../core/utils/export_util.dart';
|
import '../../core/utils/export_util.dart';
|
||||||
import '../../providers/inventory_provider.dart';
|
import '../../providers/inventory_provider.dart';
|
||||||
import '../../providers/tab_state_provider.dart';
|
import '../../providers/tab_state_provider.dart';
|
||||||
@@ -44,6 +45,7 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
|||||||
Set<String> _filterSupplier = {};
|
Set<String> _filterSupplier = {};
|
||||||
Set<String>? _hiddenCols; // null = 尚未载入本地存档(回退到 minWidth 首次默认)
|
Set<String>? _hiddenCols; // null = 尚未载入本地存档(回退到 minWidth 首次默认)
|
||||||
final _searchCtrl = TextEditingController();
|
final _searchCtrl = TextEditingController();
|
||||||
|
String _appliedKw = ''; // 已生效的搜索词(框内 chip 标签展示)
|
||||||
|
|
||||||
static const _screenId = 'stock_in_list';
|
static const _screenId = 'stock_in_list';
|
||||||
|
|
||||||
@@ -72,6 +74,10 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
|||||||
final want = tab == 1 ? 'pending,draft' : _statusFilter;
|
final want = tab == 1 ? 'pending,draft' : _statusFilter;
|
||||||
final notifier = ref.read(stockInListProvider.notifier);
|
final notifier = ref.read(stockInListProvider.notifier);
|
||||||
if (notifier.currentStatus != want) notifier.setStatus(want);
|
if (notifier.currentStatus != want) notifier.setStatus(want);
|
||||||
|
// 同步已生效的搜索词到框内 chip(provider 持久化,切走再回来不丢)
|
||||||
|
if (notifier.currentKeyword != _appliedKw) {
|
||||||
|
setState(() => _appliedKw = notifier.currentKeyword);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,8 +87,19 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _triggerSearch() =>
|
void _triggerSearch() {
|
||||||
ref.read(stockInListProvider.notifier).setKeyword(_searchCtrl.text.trim());
|
final kw = _searchCtrl.text.trim();
|
||||||
|
ref.read(stockInListProvider.notifier).setKeyword(kw);
|
||||||
|
// 仅支持单个搜索词:生效后输入框清空,搜索词转为框内 chip 标签
|
||||||
|
setState(() => _appliedKw = kw);
|
||||||
|
if (kw.isNotEmpty) _searchCtrl.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _clearSearch() {
|
||||||
|
_searchCtrl.clear();
|
||||||
|
setState(() => _appliedKw = '');
|
||||||
|
ref.read(stockInListProvider.notifier).setKeyword('');
|
||||||
|
}
|
||||||
|
|
||||||
String? get _startDate => _dateRange != null
|
String? get _startDate => _dateRange != null
|
||||||
? '${_dateRange!.start.year}-${_dateRange!.start.month.toString().padLeft(2, '0')}-${_dateRange!.start.day.toString().padLeft(2, '0')}'
|
? '${_dateRange!.start.year}-${_dateRange!.start.month.toString().padLeft(2, '0')}-${_dateRange!.start.day.toString().padLeft(2, '0')}'
|
||||||
@@ -363,12 +380,29 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
|||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
final hasKw = _appliedKw.isNotEmpty;
|
||||||
final searchField = TextField(
|
final searchField = TextField(
|
||||||
controller: _searchCtrl,
|
controller: _searchCtrl,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: '单号/往来单位/酒名,回车搜索',
|
hintText: hasKw ? '继续输入新关键词…' : '单号/往来单位/酒名,回车搜索',
|
||||||
prefixIcon: const Icon(Icons.search, size: 16),
|
|
||||||
hintStyle: const TextStyle(fontSize: 12),
|
hintStyle: const TextStyle(fontSize: 12),
|
||||||
|
// 搜索图标 +(已生效时)框内 chip 标签,仅一个词;✕ 删除即清除搜索。
|
||||||
|
// 用 prefixIcon 而非 prefix:后者仅在聚焦/有文字时才显示,搜索后输入框为空会被隐藏。
|
||||||
|
prefixIconConstraints:
|
||||||
|
const BoxConstraints(minWidth: 0, minHeight: 0),
|
||||||
|
prefixIcon: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8, right: 6),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.search, size: 16),
|
||||||
|
if (hasKw) ...[
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
SearchChip(label: _appliedKw, onDeleted: _clearSearch),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: const Icon(Icons.search, size: 16),
|
icon: const Icon(Icons.search, size: 16),
|
||||||
tooltip: '搜索',
|
tooltip: '搜索',
|
||||||
@@ -1010,24 +1044,21 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Dialog(
|
return Dialog.fullscreen(
|
||||||
child: Container(
|
child: SafeArea(
|
||||||
width: context.dialogWidth(720),
|
|
||||||
constraints: const BoxConstraints(maxHeight: 600),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(color: AppTheme.primary),
|
||||||
color: AppTheme.primary,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(12),
|
|
||||||
topRight: Radius.circular(12),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||||
|
tooltip: '返回',
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
const Text('入库单详情',
|
const Text('入库单详情',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -1040,10 +1071,6 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
|
|||||||
tooltip: '打印',
|
tooltip: '打印',
|
||||||
onPressed: () => safePrint(context, () => printStockInOrder(_loadedOrder!)),
|
onPressed: () => safePrint(context, () => printStockInOrder(_loadedOrder!)),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.close, color: Colors.white),
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import '../../widgets/multi_select_dropdown.dart' show ColDef, ColumnToggleButto
|
|||||||
import '../../core/storage/column_prefs.dart';
|
import '../../core/storage/column_prefs.dart';
|
||||||
import '../../widgets/page_scaffold.dart';
|
import '../../widgets/page_scaffold.dart';
|
||||||
import '../../widgets/status_badge.dart';
|
import '../../widgets/status_badge.dart';
|
||||||
|
import '../../widgets/search_chip.dart';
|
||||||
import '../../core/utils/export_util.dart';
|
import '../../core/utils/export_util.dart';
|
||||||
import '../../core/utils/print_util.dart';
|
import '../../core/utils/print_util.dart';
|
||||||
import '../../providers/inventory_provider.dart';
|
import '../../providers/inventory_provider.dart';
|
||||||
@@ -43,6 +44,7 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
|
|||||||
Set<String>? _hiddenCols; // null = 尚未载入本地存档(回退到 minWidth 首次默认)
|
Set<String>? _hiddenCols; // null = 尚未载入本地存档(回退到 minWidth 首次默认)
|
||||||
final _searchCtrl = TextEditingController();
|
final _searchCtrl = TextEditingController();
|
||||||
final _codeSearchCtrl = TextEditingController();
|
final _codeSearchCtrl = TextEditingController();
|
||||||
|
String _appliedKw = ''; // 已生效的搜索词(框内 chip 标签展示)
|
||||||
|
|
||||||
static const _screenId = 'stock_out_list';
|
static const _screenId = 'stock_out_list';
|
||||||
|
|
||||||
@@ -59,6 +61,10 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
|
|||||||
final want = tab == 1 ? 'pending,draft' : _statusFilter;
|
final want = tab == 1 ? 'pending,draft' : _statusFilter;
|
||||||
final notifier = ref.read(stockOutListProvider.notifier);
|
final notifier = ref.read(stockOutListProvider.notifier);
|
||||||
if (notifier.currentStatus != want) notifier.setStatus(want);
|
if (notifier.currentStatus != want) notifier.setStatus(want);
|
||||||
|
// 同步已生效的搜索词到框内 chip(provider 持久化,切走再回来不丢)
|
||||||
|
if (notifier.currentKeyword != _appliedKw) {
|
||||||
|
setState(() => _appliedKw = notifier.currentKeyword);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,9 +88,19 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _triggerSearch() => ref
|
void _triggerSearch() {
|
||||||
.read(stockOutListProvider.notifier)
|
final kw = _searchCtrl.text.trim();
|
||||||
.setKeyword(_searchCtrl.text.trim());
|
ref.read(stockOutListProvider.notifier).setKeyword(kw);
|
||||||
|
// 仅支持单个搜索词:生效后输入框清空,搜索词转为框内 chip 标签
|
||||||
|
setState(() => _appliedKw = kw);
|
||||||
|
if (kw.isNotEmpty) _searchCtrl.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _clearSearch() {
|
||||||
|
_searchCtrl.clear();
|
||||||
|
setState(() => _appliedKw = '');
|
||||||
|
ref.read(stockOutListProvider.notifier).setKeyword('');
|
||||||
|
}
|
||||||
|
|
||||||
void _triggerCodeSearch() => ref
|
void _triggerCodeSearch() => ref
|
||||||
.read(stockOutListProvider.notifier)
|
.read(stockOutListProvider.notifier)
|
||||||
@@ -375,12 +391,29 @@ class _StockOutListScreenState extends ConsumerState<StockOutListScreen> {
|
|||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
final hasKw = _appliedKw.isNotEmpty;
|
||||||
final searchField = TextField(
|
final searchField = TextField(
|
||||||
controller: _searchCtrl,
|
controller: _searchCtrl,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: '单号/往来单位/酒名,回车搜索',
|
hintText: hasKw ? '继续输入新关键词…' : '单号/往来单位/酒名,回车搜索',
|
||||||
prefixIcon: const Icon(Icons.search, size: 16),
|
|
||||||
hintStyle: const TextStyle(fontSize: 12),
|
hintStyle: const TextStyle(fontSize: 12),
|
||||||
|
// 搜索图标 +(已生效时)框内 chip 标签,仅一个词;✕ 删除即清除搜索。
|
||||||
|
// 用 prefixIcon 而非 prefix:后者仅在聚焦/有文字时才显示,搜索后输入框为空会被隐藏。
|
||||||
|
prefixIconConstraints:
|
||||||
|
const BoxConstraints(minWidth: 0, minHeight: 0),
|
||||||
|
prefixIcon: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8, right: 6),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.search, size: 16),
|
||||||
|
if (hasKw) ...[
|
||||||
|
const SizedBox(width: 6),
|
||||||
|
SearchChip(label: _appliedKw, onDeleted: _clearSearch),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
icon: const Icon(Icons.search, size: 16),
|
icon: const Icon(Icons.search, size: 16),
|
||||||
tooltip: '搜索',
|
tooltip: '搜索',
|
||||||
@@ -924,24 +957,21 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Dialog(
|
return Dialog.fullscreen(
|
||||||
child: Container(
|
child: SafeArea(
|
||||||
width: context.dialogWidth(720),
|
|
||||||
constraints: const BoxConstraints(maxHeight: 600),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(color: AppTheme.primary),
|
||||||
color: AppTheme.primary,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(12),
|
|
||||||
topRight: Radius.circular(12),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||||
|
tooltip: '返回',
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
const Text('出库单详情',
|
const Text('出库单详情',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
@@ -954,10 +984,6 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
|
|||||||
tooltip: '打印',
|
tooltip: '打印',
|
||||||
onPressed: () => safePrint(context, () => printStockOutOrder(_loadedOrder!)),
|
onPressed: () => safePrint(context, () => printStockOutOrder(_loadedOrder!)),
|
||||||
),
|
),
|
||||||
IconButton(
|
|
||||||
icon: const Icon(Icons.close, color: Colors.white),
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1040,7 +1066,7 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
|
|||||||
children: [
|
children: [
|
||||||
TableRow(
|
TableRow(
|
||||||
decoration: const BoxDecoration(color: Color(0xFFF0F4FF)),
|
decoration: const BoxDecoration(color: Color(0xFFF0F4FF)),
|
||||||
children: ['序号', '商品编码', '名称', '系列', '规格', '生产日期', '批次号', '数量', '单价', '金额']
|
children: ['序号', '商品编码', '名称', '系列', '规格', '生产日期', '批次号', '成本价', '售价', '利润']
|
||||||
.map((h) => Padding(
|
.map((h) => Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
|
||||||
child: Text(h,
|
child: Text(h,
|
||||||
@@ -1069,9 +1095,9 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
|
|||||||
: (item.productionDate ?? '-')),
|
: (item.productionDate ?? '-')),
|
||||||
_TableCell(
|
_TableCell(
|
||||||
(item.batchNo?.isNotEmpty ?? false) ? item.batchNo! : '-'),
|
(item.batchNo?.isNotEmpty ?? false) ? item.batchNo! : '-'),
|
||||||
_TableCell(item.quantity.toStringAsFixed(3)),
|
|
||||||
_TableCell('¥${item.unitPrice.toStringAsFixed(2)}'),
|
_TableCell('¥${item.unitPrice.toStringAsFixed(2)}'),
|
||||||
_TableCell('¥${item.totalPrice.toStringAsFixed(2)}'),
|
_TableCell('¥${item.salePrice.toStringAsFixed(2)}'),
|
||||||
|
_TableCell('¥${(item.salePrice - item.unitPrice).toStringAsFixed(2)}'),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
/// 搜索框内嵌的「已生效搜索词」标签:紧凑圆角 chip + ✕ 删除按钮。
|
||||||
|
///
|
||||||
|
/// 用于列表屏搜索框 [InputDecoration.prefix],仅展示单个搜索词;
|
||||||
|
/// 点 ✕ 触发 [onDeleted] 清除搜索。
|
||||||
|
class SearchChip extends StatelessWidget {
|
||||||
|
const SearchChip({super.key, required this.label, required this.onDeleted});
|
||||||
|
|
||||||
|
final String label;
|
||||||
|
final VoidCallback onDeleted;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final bg = theme.colorScheme.primary.withValues(alpha: 0.12);
|
||||||
|
final fg = theme.colorScheme.primary;
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.only(left: 8, right: 2, top: 2, bottom: 2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: bg,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 120),
|
||||||
|
child: Text(
|
||||||
|
label,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: fg,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkResponse(
|
||||||
|
onTap: onDeleted,
|
||||||
|
radius: 14,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
child: Icon(Icons.close, size: 14, color: fg),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user