mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 18:28:25 +08:00
feat: move generation buttons to dashbot
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import 'package:apidash/consts.dart';
|
||||
import 'package:apidash/providers/collection_providers.dart';
|
||||
import 'package:apidash/services/agentic_services/apidash_agent_calls.dart';
|
||||
import 'package:apidash/widgets/widget_sending.dart';
|
||||
import 'package:apidash_design_system/apidash_design_system.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'framework_selector.dart';
|
||||
@@ -150,42 +147,3 @@ class _GenerateUIDialogState extends ConsumerState<GenerateUIDialog> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AIGenerateUIButton extends ConsumerWidget {
|
||||
const AIGenerateUIButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return FilledButton.tonalIcon(
|
||||
style: FilledButton.styleFrom(
|
||||
padding: kPh12,
|
||||
minimumSize: const Size(44, 44),
|
||||
),
|
||||
onPressed: () {
|
||||
final model = ref.watch(selectedRequestModelProvider
|
||||
.select((value) => value?.httpResponseModel));
|
||||
if (model == null) return;
|
||||
|
||||
String data = "";
|
||||
if (model.sseOutput != null) {
|
||||
data = model.sseOutput!.join('');
|
||||
} else {
|
||||
data = model.formattedBody ?? "<>";
|
||||
}
|
||||
|
||||
showCustomDialog(
|
||||
context,
|
||||
GenerateUIDialog(content: data),
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.generating_tokens,
|
||||
),
|
||||
label: const SizedBox(
|
||||
child: Text(
|
||||
kLabelGenerateUI,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,31 +9,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'generated_tool_codecopy.dart';
|
||||
import 'tool_requirements_selector.dart';
|
||||
|
||||
class GenerateToolButton extends ConsumerWidget {
|
||||
const GenerateToolButton({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return FilledButton.tonalIcon(
|
||||
style: FilledButton.styleFrom(
|
||||
padding: kPh12,
|
||||
minimumSize: const Size(44, 44),
|
||||
),
|
||||
onPressed: () async {
|
||||
GenerateToolDialog.show(context, ref);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.token_outlined,
|
||||
),
|
||||
label: const SizedBox(
|
||||
child: Text(
|
||||
"Generate Tool",
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GenerateToolDialog extends ConsumerStatefulWidget {
|
||||
final APIDashRequestDescription requestDesc;
|
||||
const GenerateToolDialog({
|
||||
|
||||
Reference in New Issue
Block a user