Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/app/router/app_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ final appRouter = GoRouter(
GoRoute(
path: '/settings',
name: 'settings',
pageBuilder: (context, state) => const MaterialPage(child: SettingsScreen()),
pageBuilder: (context, state) =>
const MaterialPage(child: SettingsScreen()),
),
],
);


2 changes: 0 additions & 2 deletions lib/app/router/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ import 'package:flutter/material.dart';
enum AppRoute { home, peers, settings }

typedef RouteBuilder = Widget Function(BuildContext context);


76 changes: 39 additions & 37 deletions lib/app/theme/app_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ class AppTheme {
secondary: AppColors.brandAccent,
error: AppColors.error,
surface: AppColors.surface,
background: AppColors.background,
outline: AppColors.neutral300,
);

final rawTextTheme = base.textTheme.copyWith(
displayLarge: AppTypography.display,
headlineMedium: AppTypography.headline,
titleMedium: AppTypography.title,
bodyMedium: AppTypography.body,
labelMedium: AppTypography.label,
).apply(fontFamily: 'Roboto');
final rawTextTheme = base.textTheme
.copyWith(
displayLarge: AppTypography.display,
headlineMedium: AppTypography.headline,
titleMedium: AppTypography.title,
bodyMedium: AppTypography.body,
labelMedium: AppTypography.label,
)
.apply(fontFamily: 'Roboto');

final textTheme = rawTextTheme.apply(
bodyColor: colorScheme.onSurface,
Expand All @@ -39,7 +40,8 @@ class AppTheme {
foregroundColor: AppColors.neutral900,
elevation: 0,
centerTitle: false,
titleTextStyle: AppTypography.title.copyWith(color: AppColors.neutral900),
titleTextStyle:
AppTypography.title.copyWith(color: AppColors.neutral900),
),
cardTheme: CardTheme(
color: AppColors.surface,
Expand All @@ -50,25 +52,25 @@ class AppTheme {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return AppColors.neutral300;
}
return colorScheme.primary;
}),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
return colorScheme.onSurface.withOpacity(0.38);
foregroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return colorScheme.onSurface.withValues(alpha: 0.38);
}
return colorScheme.onPrimary;
}),
minimumSize: MaterialStateProperty.all(const Size.fromHeight(48)),
shape: MaterialStateProperty.all(
minimumSize: WidgetStateProperty.all(const Size.fromHeight(48)),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.md),
),
),
padding: MaterialStateProperty.all(
padding: WidgetStateProperty.all(
const EdgeInsets.symmetric(horizontal: AppSpacing.lg),
),
animationDuration: AppMotion.medium,
Expand Down Expand Up @@ -98,17 +100,18 @@ class AppTheme {
secondary: AppColors.brandAccent,
error: AppColors.error,
surface: AppColors.neutral800,
background: AppColors.neutral900,
outline: AppColors.neutral600,
);

final rawTextTheme = base.textTheme.copyWith(
displayLarge: AppTypography.display,
headlineMedium: AppTypography.headline,
titleMedium: AppTypography.title,
bodyMedium: AppTypography.body,
labelMedium: AppTypography.label,
).apply(fontFamily: 'Roboto');
final rawTextTheme = base.textTheme
.copyWith(
displayLarge: AppTypography.display,
headlineMedium: AppTypography.headline,
titleMedium: AppTypography.title,
bodyMedium: AppTypography.body,
labelMedium: AppTypography.label,
)
.apply(fontFamily: 'Roboto');

final textTheme = rawTextTheme.apply(
bodyColor: colorScheme.onSurface,
Expand All @@ -118,13 +121,14 @@ class AppTheme {
return base.copyWith(
colorScheme: colorScheme,
textTheme: textTheme,
scaffoldBackgroundColor: colorScheme.background,
scaffoldBackgroundColor: colorScheme.surface,
appBarTheme: AppBarTheme(
backgroundColor: colorScheme.surface,
foregroundColor: colorScheme.onSurface,
elevation: 0,
centerTitle: false,
titleTextStyle: AppTypography.title.copyWith(color: colorScheme.onSurface),
titleTextStyle:
AppTypography.title.copyWith(color: colorScheme.onSurface),
),
cardTheme: CardTheme(
color: colorScheme.surface,
Expand All @@ -135,25 +139,25 @@ class AppTheme {
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return AppColors.neutral600;
}
return colorScheme.primary;
}),
foregroundColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.disabled)) {
return colorScheme.onSurface.withOpacity(0.38);
foregroundColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.disabled)) {
return colorScheme.onSurface.withValues(alpha: 0.38);
}
return colorScheme.onPrimary;
}),
minimumSize: MaterialStateProperty.all(const Size.fromHeight(48)),
shape: MaterialStateProperty.all(
minimumSize: WidgetStateProperty.all(const Size.fromHeight(48)),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.md),
),
),
padding: MaterialStateProperty.all(
padding: WidgetStateProperty.all(
const EdgeInsets.symmetric(horizontal: AppSpacing.lg),
),
animationDuration: AppMotion.medium,
Expand All @@ -174,5 +178,3 @@ class AppTheme {
);
}
}


3 changes: 2 additions & 1 deletion lib/app/theme/tokens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class AppColors {

// Data visualization colors
static const Color dataUpload = Color(0xFF0988B0); // Blue for upload (TX)
static const Color dataDownload = Color(0xFF10B981); // Green for download (RX)
static const Color dataDownload =
Color(0xFF10B981); // Green for download (RX)
static const Color dataPeers = Color(0xFF0988B0); // Primary blue for peers
static const Color dataUptime = Color(0xFF10B981); // Green for uptime
static const Color dataTraffic = Color(0xFF0D9C9E); // Accent teal for traffic
Expand Down
17 changes: 12 additions & 5 deletions lib/app/widgets/app_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ class AppCard extends StatelessWidget {
final VoidCallback? onTap;
final EdgeInsetsGeometry? margin;

const AppCard({super.key, required this.child, this.padding = const EdgeInsets.all(AppSpacing.lg), this.onTap, this.margin});
const AppCard(
{super.key,
required this.child,
this.padding = const EdgeInsets.all(AppSpacing.lg),
this.onTap,
this.margin});

@override
Widget build(BuildContext context) {
Expand All @@ -16,14 +21,16 @@ class AppCard extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
borderRadius: BorderRadius.circular(AppRadii.lg),
boxShadow: AppElevation.level1,
border: Border.all(color: Theme.of(context).dividerColor.withOpacity(0.5)),
border:
Border.all(color: Theme.of(context).dividerColor.withValues(alpha: 0.5)),
),
margin: margin ?? const EdgeInsets.symmetric(vertical: AppSpacing.lg),
child: Padding(padding: padding, child: child),
);
if (onTap == null) return card;
return InkWell(borderRadius: BorderRadius.circular(AppRadii.lg), onTap: onTap, child: card);
return InkWell(
borderRadius: BorderRadius.circular(AppRadii.lg),
onTap: onTap,
child: card);
}
}


8 changes: 4 additions & 4 deletions lib/app/widgets/app_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class AppScaffold extends StatelessWidget {
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height -
MediaQuery.of(context).padding.top -
MediaQuery.of(context).padding.bottom -
kToolbarHeight -
80, // approximate bottom nav height
MediaQuery.of(context).padding.top -
MediaQuery.of(context).padding.bottom -
kToolbarHeight -
80, // approximate bottom nav height
),
child: child,
),
Expand Down
10 changes: 6 additions & 4 deletions lib/app/widgets/desktop_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DesktopLayout extends StatelessWidget {
Widget build(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height;
final screenWidth = MediaQuery.of(context).size.width;

return Scaffold(
body: SizedBox(
width: screenWidth,
Expand All @@ -42,20 +42,22 @@ class DesktopLayout extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor.withOpacity(0.3),
color:
Theme.of(context).dividerColor.withValues(alpha: 0.3),
width: 1,
),
),
),
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.xxl),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xxl),
alignment: Alignment.centerLeft,
child: title,
),

// Main content with proper padding
Expanded(
child: Material(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
child: Padding(
padding: const EdgeInsets.all(AppSpacing.xxl),
child: SingleChildScrollView(
Expand Down
16 changes: 8 additions & 8 deletions lib/app/widgets/desktop_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class DesktopSidebar extends StatelessWidget {
color: Theme.of(context).colorScheme.surface,
border: Border(
right: BorderSide(
color: Theme.of(context).dividerColor.withOpacity(0.3),
color: Theme.of(context).dividerColor.withValues(alpha: 0.3),
width: 1,
),
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 8,
offset: const Offset(2, 0),
),
Expand Down Expand Up @@ -93,7 +93,7 @@ class DesktopSidebar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(
color: Theme.of(context).dividerColor.withOpacity(0.3),
color: Theme.of(context).dividerColor.withValues(alpha: 0.3),
),
const SizedBox(height: AppSpacing.sm),
Text(
Expand All @@ -102,7 +102,7 @@ class DesktopSidebar extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.6),
.withValues(alpha: 0.6),
),
overflow: TextOverflow.ellipsis,
),
Expand All @@ -112,7 +112,7 @@ class DesktopSidebar extends StatelessWidget {
color: Theme.of(context)
.colorScheme
.onSurface
.withOpacity(0.4),
.withValues(alpha: 0.4),
),
),
],
Expand Down Expand Up @@ -153,13 +153,13 @@ class _SidebarItem extends StatelessWidget {
),
decoration: BoxDecoration(
color: isSelected
? Theme.of(context).colorScheme.primary.withOpacity(0.1)
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.1)
: Colors.transparent,
borderRadius: BorderRadius.circular(AppRadii.md),
border: isSelected
? Border.all(
color:
Theme.of(context).colorScheme.primary.withOpacity(0.3),
Theme.of(context).colorScheme.primary.withValues(alpha: 0.3),
width: 1,
)
: null,
Expand All @@ -171,7 +171,7 @@ class _SidebarItem extends StatelessWidget {
size: 20,
color: isSelected
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.7),
),
const SizedBox(width: AppSpacing.md),
Expanded(
Expand Down
3 changes: 2 additions & 1 deletion lib/app/widgets/responsive_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class ResponsiveLayout extends StatelessWidget {
Widget build(BuildContext context) {
return MediaQuery.of(context).size.width >= ResponsiveBreakpoints.desktop
? desktop
: MediaQuery.of(context).size.width >= ResponsiveBreakpoints.mobile && tablet != null
: MediaQuery.of(context).size.width >= ResponsiveBreakpoints.mobile &&
tablet != null
? tablet!
: mobile;
}
Expand Down
Loading