import 'package:baseproject/core/theme/index.dart';
import 'package:flutter/material.dart';

ThemeData _getThemeData(BuildContext context) {
  return ThemeData(
    textTheme: Theme.of(context).textTheme.apply(
          bodyColor: CustomColor.textColor,
          fontFamily: fontFamily,
        ),
    visualDensity: VisualDensity.adaptivePlatformDensity,
    // appBarTheme: AppBarTheme(
    //     textTheme: Theme.of(context).textTheme.apply(
    //           fontFamily: fontFamily,
    //         )),
    scaffoldBackgroundColor: Colors.white,
    iconTheme: IconTheme.of(context).copyWith(color: CustomColor.textColor),
    bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.white),
    inputDecorationTheme: FormTheme.getDefaultInputDecorationTheme(),
    // tabBarTheme: TabBarTheme(
    //   indicator: const UnderlineTabIndicator(
    //     borderSide: BorderSide(color: CustomTheme.tabBarIndicatorColor, width: 2),
    //   ),
    //   labelStyle: textStyleBodySmall.copyWith(fontWeight: FontWeight.w600),
    //   labelColor: CustomColor.textColor,
    //   unselectedLabelColor: CustomColor.textColor,
    //   unselectedLabelStyle: textStyleBodySmall,
    // ),
    // inputDecorationTheme: InputDecorationTheme(
    //   border: inputDecoration.border,
    //   enabledBorder: inputDecoration.enabledBorder,
    //   errorBorder: inputDecoration.errorBorder,
    //   errorStyle: TextStyle(color: CoreColor.colorInputTextError),
    // ),
    // checkboxTheme: CheckboxThemeData(
    //   checkColor: MaterialStateProperty.all(CheckboxSettings.checkColor),
    //   fillColor: MaterialStateProperty.all(CheckboxSettings.fillColor),
    //   side: BorderSide(color: CheckboxSettings.borderColor, width: 1),
    //   shape: RoundedRectangleBorder(
    //     borderRadius: BorderRadius.circular(6),
    //   ),
    // ),
  );
}

ThemeData _getThemeDataDark(BuildContext context) {
  return ThemeData(
    visualDensity: VisualDensity.adaptivePlatformDensity,
    textTheme: Theme.of(context).textTheme.apply(
          bodyColor: CustomColor.textColor,
          fontFamily: fontFamily,
        ),
    // appBarTheme: AppBarTheme(
    //     textTheme: Theme.of(context).textTheme.apply(
    //           fontFamily: fontFamily,
    //         )),
    scaffoldBackgroundColor: Colors.white,
    iconTheme: IconTheme.of(context).copyWith(color: CustomColor.textColor),
    bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.white),
    // tabBarTheme: TabBarTheme(
    //   indicator: const UnderlineTabIndicator(
    //     borderSide: BorderSide(color: CustomTheme.tabBarIndicatorColor, width: 2),
    //   ),
    //   labelStyle: textStyleBodySmall.copyWith(fontWeight: FontWeight.w600),
    //   labelColor: CustomColor.textColor,
    //   unselectedLabelColor: CustomColor.textColor,
    //   unselectedLabelStyle: textStyleBodySmall,
    // ),
    // inputDecorationTheme: InputDecorationTheme(
    //   border: inputDecoration.border,
    //   enabledBorder: inputDecoration.enabledBorder,
    //   errorBorder: inputDecoration.errorBorder,
    //   errorStyle: TextStyle(color: CoreColor.colorInputTextError),
    // ),
    // checkboxTheme: CheckboxThemeData(
    //   checkColor: MaterialStateProperty.all(CheckboxSettings.checkColor),
    //   fillColor: MaterialStateProperty.all(CheckboxSettings.fillColor),
    //   side: BorderSide(color: CheckboxSettings.borderColor, width: 1),
    //   shape: RoundedRectangleBorder(
    //     borderRadius: BorderRadius.circular(6),
    //   ),
    // ),
  );
}

ThemeData getTheme(BuildContext context, bool isLight) {
  if (isLight) {
    return _getThemeData(context);
  } else {
    return _getThemeDataDark(context);
  }
}
