import 'package:flex_color_scheme/flex_color_scheme.dart';
import 'package:flutter/material.dart';

class AppTheme {
  AppTheme._();

  static ThemeData lightTheme = FlexColorScheme.light(
    surfaceStyle: FlexSurface.medium,
    scheme: FlexScheme.aquaBlue,
    fontFamily: 'Roboto',
  ).toTheme;

  static ThemeData darkTheme = FlexColorScheme.dark(
    scheme: FlexScheme.aquaBlue,
    fontFamily: 'Roboto',
  ).toTheme;

  static ThemeData makeTheme(ThemeData baseThemeData) {
    return baseThemeData.copyWith(
      cardTheme: baseThemeData.cardTheme.copyWith(
        color: baseThemeData.bottomAppBarColor,
        elevation: 1,
        margin: const EdgeInsets.only(bottom: 10.0),
        shape: const RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(10.0)),
        ),
      ),
      scrollbarTheme: baseThemeData.scrollbarTheme.copyWith(
        isAlwaysShown: true,
      ),
      textTheme: baseThemeData.textTheme.copyWith(
        subtitle2: TextStyle(
          color: baseThemeData.primaryColor,
          letterSpacing: 2.0,
        ),
      ),
      inputDecorationTheme: baseThemeData.inputDecorationTheme.copyWith(
        fillColor: baseThemeData.textSelectionTheme.selectionColor,
        border: const UnderlineInputBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(8.0),
            topRight: Radius.circular(8.0),
          ),
        ),
      ),
      bottomNavigationBarTheme: BottomNavigationBarThemeData(
        backgroundColor: baseThemeData.primaryColor,
      ),
    );
  }
}
