mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
52 lines
1.6 KiB
Dart
52 lines
1.6 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: 0,
|
|
iconColor: scheme.onSurface,
|
|
),
|
|
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),
|
|
),
|
|
);
|
|
}
|