class InfoButton extends StatelessWidget {
final String label;
InfoButton({required this.label});
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: () {
// OnClick info is zero as per specification
},
child: Text(
label,
style: TextStyle(
fontSize: 14,
fontFamily: 'Roboto',
),
),
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white,
backgroundColor: Colors.grey.withOpacity(0.5), // Grey with transparency
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
elevation: 0,
),
);
}
}
sidebar and content doesn't have any color difference also server info is positioned as i said before no other variant button управление is grey no white also add font neue machina for server card and for welcome card with image unbounded font also add image
To address your requirements, we'll make several adjustments to your Flutter app:
Distinct Sidebar and Content Colors: Ensure the sidebar and main content have clearly different background colors for better visual separation.
Server Info Positioning: Fine-tune the layout of the server information to align with your specifications.
"Управление" Button Styling: Ensure the "Управление" (Manage) button has a grey background instead of white.
Custom Fonts: Incorporate the Neue Machina font for the server cards and the welcome card, and use the Unbounded font where specified.
Adding Images: Add a relevant image to enhance the UI, specifically in the welcome section.
Below is the updated code with these improvements, along with explanations for each change:
1. Setting Up Custom Fonts
First, you need to add the custom fonts (Neue Machina and Unbounded) to your project.
a. Add Font Files:
Place your NeueMachina-Regular.ttf and Unbounded-Regular.ttf files in the assets/fonts/ directory of your project.
Fonts Added: Neue Machina for the server cards and welcome card, and Unbounded for specific texts.
Usage:
In ServerCard, the server name now uses 'NeueMachina'.
In MainTab, the welcome message uses 'Unbounded'.
Font Files: Ensure that the font files (NeueMachina-Regular.ttf and Unbounded-Regular.ttf) are correctly placed in the assets/fonts/ directory and referenced in pubspec.yaml.
Distinct Sidebar and Main Content Colors:
Sidebar:
Background color set to Color(0xFF1C1C1C) for a distinct look.
The logo text color changed to the primary color Color(0xFF532E41) to stand out against the sidebar background.
Main Content:
The scaffoldBackgroundColor remains Color(0xFF09090A) for a deep dark background, contrasting with the sidebar.
"Управление" Button Styling:
In the ServerCard widget, the "Управление" button's backgroundColor is set to Colors.grey to ensure it appears grey instead of white.
The button text remains white for visibility against the grey background.
Server Info Positioning:
ServerCard Layout:
Increased the height of ServerCard to 150 to provide ample space for content.
Used Expanded for the server details to utilize available space effectively.
Proper padding ensures that the server information is well-aligned and spaced.
Row Structure:
The Row contains the flag, server details, and the "Управление" button neatly aligned.
Adding Images:
Welcome Section:
Replaced the placeholder network image with an asset image: .
4. Final Notes
Asset Declaration: Remember to declare all assets (fonts and images) in your pubspec.yaml file to ensure they are bundled with your app.
Font Licensing: Ensure you have the right to use Neue Machina in your project. If it's a premium font, consider alternatives like Roboto or Unbounded which are free and available via Google Fonts.
Responsive Design: While the current setup uses fixed widths and heights, consider making the UI responsive to different screen sizes and orientations for a more flexible design.
Further Customization: Based on your specific design requirements, feel free to adjust colors, fonts, and layouts further to achieve the desired look and feel.
By implementing these changes, your Netpc.Space Dashboard should now have distinct sidebar and main content areas, properly styled buttons, correctly positioned server information, integrated custom fonts, and enhanced visuals with images.
Not yet included in a published release.
,
s
t
y
l
e
:
TextStyle(color:
Colors.grey,fontSize:
16,fontFamily:′
Roboto′,),),SizedBox(height:
16),Row(children:
[InfoButton(label:′
CPU:
a
m′
]?
?′
N
/
A′
′
)
,
S
i
z
e
d
B
o
x
(
w
i
d
t
h
:
8),InfoButton(label:′
Disk:
'assets/images/welcome_background.jpg'
Note: Ensure that you have the image placed correctly in the assets/images/ directory and declared in pubspec.yaml: