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:
Udhay-Adithya
2025-08-31 12:15:43 +05:30
parent a3669b1685
commit b9cc42b019
25 changed files with 802 additions and 8 deletions

View File

@@ -0,0 +1,17 @@
import 'package:flutter/widgets.dart';
class DashbotIcons {
DashbotIcons._();
static String get dashbotIcon1 =>
'packages/dashbot/assets/dashbot_icon_1.png';
static String get dashbotIcon2 =>
'packages/dashbot/assets/dashbot_icon_2.png';
static Image getDashbotIcon1({double? width, double? height, BoxFit? fit}) {
return Image.asset(dashbotIcon1, width: width, height: height, fit: fit);
}
static Image getDashbotIcon2({double? width, double? height, BoxFit? fit}) {
return Image.asset(dashbotIcon2, width: width, height: height, fit: fit);
}
}

View File

@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../dashbot_dashboard.dart';
import '../providers/dashbot_window_notifier.dart';
void showDashbotWindow(BuildContext context, WidgetRef ref) {
final isDashbotActive = ref.read(dashbotWindowNotifierProvider).isActive;
final windowNotifier = ref.read(dashbotWindowNotifierProvider.notifier);
if (isDashbotActive) return;
final overlay = Overlay.of(context);
OverlayEntry? entry;
entry = OverlayEntry(
builder:
(context) => DashbotWindow(
onClose: () {
entry?.remove();
windowNotifier.toggleActive();
},
),
);
windowNotifier.toggleActive();
overlay.insert(entry);
}

View File

@@ -0,0 +1,2 @@
export 'show_dashbot.dart';
export 'dashbot_icons.dart';