|
|
|
|
@ -12,6 +12,7 @@ import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/dialogs/dialog.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
|
|
|
|
|
|
|
|
|
|
@ -134,15 +135,17 @@ class _CopilotHistoryPageState extends State<CopilotHistoryPage> {
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemCount: filteredHistory.length,
|
|
|
|
|
separatorBuilder: (context, index) => 12.height,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final item = filteredHistory[index];
|
|
|
|
|
|
|
|
|
|
return messageHistoryCard(item: item, provider: provider);
|
|
|
|
|
},
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemCount: filteredHistory.length,
|
|
|
|
|
separatorBuilder: (context, index) => 12.height,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final item = filteredHistory[index];
|
|
|
|
|
|
|
|
|
|
return messageHistoryCard(item: item, provider: provider);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -189,9 +192,18 @@ class _CopilotHistoryPageState extends State<CopilotHistoryPage> {
|
|
|
|
|
).expanded,
|
|
|
|
|
IconButton(
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
await provider.deleteHistory(item.threadId);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
bool result = await showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (_) => AAlertDialog(
|
|
|
|
|
title: "Confirm".addTranslation,
|
|
|
|
|
content: "Are you sure you want to delete?".addTranslation,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if (result) {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
await provider.deleteHistory(item.threadId);
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
style: const ButtonStyle(tapTargetSize: MaterialTapTargetSize.shrinkWrap),
|
|
|
|
|
icon: "delete_icon".toSvgAsset(width: 20, height: 20),
|
|
|
|
|
|