mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 18:57:05 +08:00
feat: move generation buttons to dashbot
This commit is contained in:
@@ -93,23 +93,37 @@ class _DashbotHomePageState extends ConsumerState<DashbotHomePage> {
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
if (currentRequest?.httpResponseModel?.statusCode != null &&
|
||||
currentRequest?.httpResponseModel?.statusCode == 200) ...[
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: const [
|
||||
Expanded(
|
||||
child: GenerateToolButton(),
|
||||
if (currentRequest?.httpResponseModel?.statusCode != null &&
|
||||
currentRequest?.httpResponseModel?.statusCode == 200) ...[
|
||||
HomeScreenTaskButton(
|
||||
label: "🛠️ Generate Tool",
|
||||
onPressed: () {
|
||||
GenerateToolDialog.show(context, ref);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: AIGenerateUIButton(),
|
||||
HomeScreenTaskButton(
|
||||
label: "📱 Generate UI",
|
||||
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),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user