spotube/lib/themes/theme.dart

54 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
ThemeData theme(Color seed, Brightness brightness) {
final scheme = ColorScheme.fromSeed(
seedColor: seed,
shadow: Colors.black12,
brightness: brightness,
);
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
listTileTheme: ListTileThemeData(
horizontalTitleGap: 5,
iconColor: scheme.onSurface,
),
appBarTheme: const AppBarTheme(surfaceTintColor: Colors.transparent),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
),
),
iconTheme: IconThemeData(size: 16, color: scheme.onSurface),
navigationBarTheme: const NavigationBarThemeData(
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
height: 50,
iconTheme: MaterialStatePropertyAll(
IconThemeData(size: 18),
),
),
tabBarTheme: TabBarTheme(
indicatorSize: TabBarIndicatorSize.tab,
labelStyle: const TextStyle(fontWeight: FontWeight.w600),
labelColor: scheme.primary,
dividerColor: Colors.transparent,
indicator: BoxDecoration(
color: scheme.secondaryContainer,
borderRadius: BorderRadius.circular(15),
),
),
popupMenuTheme: PopupMenuThemeData(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
color: scheme.surface,
elevation: 4,
),
snackBarTheme: SnackBarThemeData(
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
backgroundColor: scheme.onSurface,
contentTextStyle: TextStyle(color: scheme.surface),
),
sliderTheme: SliderThemeData(overlayShape: SliderComponentShape.noOverlay),
);
}