Files
apidash/packages/dashbot/lib/features/home/view/pages/home_page.dart
Udhay-Adithya b9cc42b019 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.
2025-08-31 12:15:43 +05:30

136 lines
4.4 KiB
Dart

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"),
// ),
],
),
],
),
);
}
}