import 'package:flutter/material.dart'; void main() { runApp(NetpcSpaceApp()); } class…
- User
import 'package:flutter/material.dart';
void main() { runApp(NetpcSpaceApp()); }
class NetpcSpaceApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Netpc.Space Dashboard', debugShowCheckedModeBanner: false, theme: ThemeData( primaryColor: Color(0xFF532E41), scaffoldBackgroundColor: Color(0xFF09090A), fontFamily: 'Roboto', // Default font textTheme: TextTheme( bodyLarge: TextStyle(color: Colors.white), bodyMedium: TextStyle(color: Colors.white), ), ), home: DashboardScreen(), ); } }
class DashboardScreen extends StatefulWidget { @override State createState() => _DashboardScreenState(); }
class _DashboardScreenState extends State { String selectedTab = 'Главное';
@override Widget build(BuildContext context) { // Fixed screen size assumption return Scaffold( body: SizedBox( width: 1920, height: 1080, child: Stack( children: [ // Sidebar Positioned( left: 0, top: 0, child: Sidebar( selectedTab: selectedTab, onTabSelected: (tab) { setState(() { selectedTab = tab; }); }, ), ), // Main Content Positioned( left: 400, // Sidebar width top: 0, child: MainContent( selectedTab: selectedTab, ), ), ], ), ), ); } }
class Sidebar extends StatelessWidget { final String selectedTab; final Function(String) onTabSelected;
Sidebar({required this.selectedTab, required this.onTabSelected});
@override Widget build(BuildContext context) { return Container( width: 400, // Fixed width height: 1080, // Fixed height color: Color(0xFF09090A), // Background color child: Stack( children: [ // "netpc.space" Text Positioned( left: 128, top: 63, child: Text( 'netpc.space', style: TextStyle( color: Colors.white, fontSize: 24, fontWeight: FontWeight.bold, fontFamily: 'NeueMachina', // Ensure this font is added ), ), ), // User Card Positioned( left: 128, top: 120, child: Container( width: 240, // Adjusted width to fit within sidebar padding: EdgeInsets.all(16), decoration: BoxDecoration( color: Colors.white.withOpacity(0.1), border: Border.all(color: Colors.white30), borderRadius: BorderRadius.circular(12), ), child: Column( mainAxisSize: MainAxisSize.min, children: [ Row( children: [ // Static User Icon Icon( Icons.person, color: Colors.white, size: 40, ), SizedBox(width: 16), // Username and Logout Button Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( 'username', style: TextStyle( color: Colors.white, fontSize: 18, fontFamily: 'Roboto', ), ), SizedBox(height: 4), GestureDetector( onTap: () { // Handle logout }, child: Row( children: [ Icon( Icons.logout, color: Colors.white, size: 16, ), SizedBox(width: 4), Text( 'Logout', style: TextStyle( color: Colors.white, fontSize: 14, fontFamily: 'Roboto', ), ), ], ), ), ], ), ), ], ), SizedBox(height: 16), // User Balance Row( children: [ Icon( Icons.account_balance_wallet, color: Colors.white, size: 24, ), SizedBox(width: 8), Text( '10000', style: TextStyle( color: Colors.white, fontSize: 16, fontFamily: 'Roboto', ), ), ], ), ], ), ), ), // Spacer after User Card Positioned( left: 128, top: 220, child: SizedBox( width: 240, height: 40, // Adjust as needed for spacing child: Container(), // Transparent space ), ), // "Основное" Text Positioned( left: 128, top: 280, child: Text( 'Основное', style: TextStyle( color: Color(0xFF532E41), // Purple color fontSize: 20, fontWeight: FontWeight.bold, fontFamily: 'Roboto', ), ), ), // Navigation Buttons Positioned( left: 128, top: 320, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ NavButton( icon: Icons.dashboard, label: 'Главное', isSelected: selectedTab == 'Главное', onTap: () => onTabSelected('Главное'), ), NavButton( icon: Icons.settings, label: 'Настройки', isSelected: selectedTab == 'Настройки', onTap: () => onTabSelected('Настройки'), ), // Add more navigation buttons here as needed ], ), ), ], ); } }
- Assistant