mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 03:17:00 +08:00
feat: add initial dashbot package implementation
- Created a new Dashbot package with core functionalities. - Implemented Dashbot window model and notifier for state management. - Added UI components including Dashbot default page and home page. - Integrated routing for Dashbot with initial routes defined. - Included assets for Dashbot icons and set up pubspec.yaml. - Added tests for Dashbot window notifier to ensure functionality. - Established a basic README and CHANGELOG for the package.
This commit is contained in:
135
packages/dashbot/lib/features/home/view/pages/home_page.dart
Normal file
135
packages/dashbot/lib/features/home/view/pages/home_page.dart
Normal file
@@ -0,0 +1,135 @@
|
||||
import 'package:dashbot/core/utils/dashbot_icons.dart';
|
||||
|
||||
import '../../../../core/routes/dashbot_routes.dart';
|
||||
import 'package:apidash_design_system/tokens/measurements.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class DashbotHomePage extends ConsumerStatefulWidget {
|
||||
const DashbotHomePage({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<DashbotHomePage> createState() => _DashbotHomePageState();
|
||||
}
|
||||
|
||||
class _DashbotHomePageState extends ConsumerState<DashbotHomePage> {
|
||||
void navigateToChat(String prompt) {
|
||||
Navigator.of(context).pushNamed(
|
||||
DashbotRoutes.dashbotChat,
|
||||
arguments: {'initialPrompt': prompt},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
kVSpacer16,
|
||||
DashbotIcons.getDashbotIcon1(width: 60),
|
||||
|
||||
kVSpacer16,
|
||||
Text(
|
||||
'Hello there,',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w800),
|
||||
),
|
||||
Text('How can I help you today?'),
|
||||
kVSpacer16,
|
||||
Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Navigator.of(context).pushNamed(
|
||||
// DashbotRoutes.dashbotChat,
|
||||
// );
|
||||
// },
|
||||
// style: TextButton.styleFrom(
|
||||
// side: BorderSide(
|
||||
// color: Theme.of(context).colorScheme.primary,
|
||||
// ),
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// vertical: 0,
|
||||
// horizontal: 16,
|
||||
// ),
|
||||
// ),
|
||||
// child: const Text("🤖 Chat with Dashbot"),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0,
|
||||
horizontal: 16,
|
||||
),
|
||||
),
|
||||
child: const Text("🔎 Explain me this response"),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {},
|
||||
// style: TextButton.styleFrom(
|
||||
// side: BorderSide(
|
||||
// color: Theme.of(context).colorScheme.primary,
|
||||
// ),
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// vertical: 0,
|
||||
// horizontal: 16,
|
||||
// ),
|
||||
// ),
|
||||
// child: const Text("🐞 Help me debug this error"),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0,
|
||||
horizontal: 16,
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
"📄 Generate documentation",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
style: TextButton.styleFrom(
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 0,
|
||||
horizontal: 16,
|
||||
),
|
||||
),
|
||||
child: const Text("📝 Generate Tests"),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {},
|
||||
// style: TextButton.styleFrom(
|
||||
// side: BorderSide(
|
||||
// color: Theme.of(context).colorScheme.primary,
|
||||
// ),
|
||||
// padding: const EdgeInsets.symmetric(
|
||||
// vertical: 0,
|
||||
// horizontal: 16,
|
||||
// ),
|
||||
// ),
|
||||
// child: const Text("📊 Generate Visualizations"),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user