Button working

This commit is contained in:
Jean-Philippe Brule 2025-10-25 22:47:34 -04:00
parent 8a12b7e1da
commit e23969c3e4
3 changed files with 134 additions and 81 deletions

View File

@ -58,8 +58,8 @@ class _NavigationSidebarState extends State<NavigationSidebar> {
const SizedBox(height: 8), const SizedBox(height: 8),
_buildMenuItem( _buildMenuItem(
icon: Iconsax.hierarchy_square, icon: Iconsax.hierarchy_square,
title: 'The Architect', title: 'The Architech',
pageId: 'architect', pageId: 'architech',
colorScheme: colorScheme, colorScheme: colorScheme,
), ),
const SizedBox(height: 8), const SizedBox(height: 8),

View File

@ -3,6 +3,8 @@ import 'package:iconsax/iconsax.dart';
import 'package:animate_do/animate_do.dart'; import 'package:animate_do/animate_do.dart';
import 'package:getwidget/getwidget.dart'; import 'package:getwidget/getwidget.dart';
import 'components/navigation_sidebar.dart'; import 'components/navigation_sidebar.dart';
import 'pages/architech_page.dart';
import 'dart:html' as html;
class ConsoleLandingPage extends StatefulWidget { class ConsoleLandingPage extends StatefulWidget {
const ConsoleLandingPage({Key? key}) : super(key: key); const ConsoleLandingPage({Key? key}) : super(key: key);
@ -25,10 +27,6 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
setState(() { setState(() {
_currentPage = pageId; _currentPage = pageId;
}); });
// Handle page navigation here
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Navigating to: $pageId')),
);
} }
@override @override
@ -153,8 +151,8 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
switch (_currentPage) { switch (_currentPage) {
case 'dashboard': case 'dashboard':
return 'Dashboard'; return 'Dashboard';
case 'architect': case 'architech':
return 'The Architect'; return 'The Architech';
case 'agents': case 'agents':
return 'AI Agents'; return 'AI Agents';
case 'analytics': case 'analytics':
@ -169,6 +167,17 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
} }
Widget _buildMainContent(ColorScheme colorScheme) { Widget _buildMainContent(ColorScheme colorScheme) {
// Switch between different pages
switch (_currentPage) {
case 'architech':
return const ArchitechPage();
case 'dashboard':
default:
return _buildDashboardContent(colorScheme);
}
}
Widget _buildDashboardContent(ColorScheme colorScheme) {
return LayoutBuilder( return LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
return SingleChildScrollView( return SingleChildScrollView(
@ -176,69 +185,6 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Page Title
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
colorScheme.primary.withOpacity(0.2),
colorScheme.secondary.withOpacity(0.15),
],
),
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: colorScheme.primary.withOpacity(0.5),
width: 1,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: colorScheme.primary,
borderRadius: BorderRadius.circular(6),
),
child: const Text(
'S',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(width: 10),
Text(
'Svrnty Console',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
),
],
),
const SizedBox(height: 8),
Text(
'sovereign AI solutions • 30 October 2025',
style: TextStyle(
fontSize: 14,
color: colorScheme.onSurfaceVariant,
fontFamily: 'Montserrat',
),
),
],
),
),
const SizedBox(height: 28),
// Status Cards Grid // Status Cards Grid
_buildResponsiveGrid( _buildResponsiveGrid(
constraints.maxWidth, constraints.maxWidth,
@ -249,6 +195,7 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
colorScheme.primary, colorScheme.primary,
Icons.api, Icons.api,
'Active', 'Active',
url: 'https://localhost:7108/swagger/',
), ),
_buildStatusCard( _buildStatusCard(
'Frontend', 'Frontend',
@ -376,8 +323,9 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
String subtitle, String subtitle,
Color color, Color color,
IconData icon, IconData icon,
String status, String status, {
) { String? url,
}) {
final colorScheme = Theme.of(context).colorScheme; final colorScheme = Theme.of(context).colorScheme;
return FadeInUp( return FadeInUp(
@ -406,14 +354,18 @@ class _ConsoleLandingPageState extends State<ConsoleLandingPage> {
), ),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
GFToast.showToast( if (url != null) {
'$title tapped', html.window.open(url, '_blank');
context, } else {
toastPosition: GFToastPosition.BOTTOM, GFToast.showToast(
textStyle: const TextStyle(fontSize: 14, color: Colors.white), '$title tapped',
backgroundColor: color.withOpacity(0.9), context,
toastDuration: 2, toastPosition: GFToastPosition.BOTTOM,
); textStyle: const TextStyle(fontSize: 14, color: Colors.white),
backgroundColor: color.withOpacity(0.9),
toastDuration: 2,
);
}
}, },
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
child: Container( child: Container(

View File

@ -0,0 +1,101 @@
import 'package:flutter/material.dart';
import 'package:iconsax/iconsax.dart';
import 'package:animate_do/animate_do.dart';
class ArchitechPage extends StatelessWidget {
const ArchitechPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return SingleChildScrollView(
padding: const EdgeInsets.all(32.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Empty State Content
FadeInUp(
duration: const Duration(milliseconds: 600),
child: Center(
child: Container(
constraints: const BoxConstraints(maxWidth: 600),
padding: const EdgeInsets.all(48),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.all(32),
decoration: BoxDecoration(
color: colorScheme.surfaceContainerHighest,
shape: BoxShape.circle,
),
child: Icon(
Iconsax.hierarchy_square,
size: 80,
color: colorScheme.primary.withOpacity(0.5),
),
),
const SizedBox(height: 32),
Text(
'Coming Soon',
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: colorScheme.onSurface,
),
),
const SizedBox(height: 16),
Text(
'The Architech module is currently under development. This powerful tool will allow you to design, visualize, and manage your AI infrastructure with ease.',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
color: colorScheme.onSurfaceVariant,
height: 1.5,
),
),
const SizedBox(height: 32),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
decoration: BoxDecoration(
color: colorScheme.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: colorScheme.primary.withOpacity(0.3),
width: 1,
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Iconsax.info_circle,
color: colorScheme.primary,
size: 20,
),
const SizedBox(width: 12),
Text(
'Stay tuned for updates',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: colorScheme.primary,
),
),
],
),
),
],
),
),
),
),
],
),
);
}
}