79321409

Date: 2025-01-01 09:37:09
Score: 0.5
Natty:
Report link

MaterialTheme() was declared twice. This was the reason for the duplication.

val colorScheme = when {
        useDynamicColors && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
            if (useDarkTheme) dynamicDarkColorScheme(context = LocalContext.current)
            else dynamicLightColorScheme(context = LocalContext.current)
        }

        useDarkTheme -> DarkColorScheme
        else -> LightColorScheme
    }
// superfluous code :
//  MaterialTheme(
//      colorScheme = colorScheme,
//      content = content
//  )
// 
    CompositionLocalProvider(
        value = LocalRippleConfiguration provides RippleConfiguration(
            rippleAlpha = RippleAlpha(
                pressedAlpha = 0.5f,
                focusedAlpha = 0.4f,
                draggedAlpha = 0.4f,
                hoveredAlpha = 0.4f
            ),
            color = LACE
        )
    ) {
           MaterialTheme(
            colorScheme = colorScheme,
            content = content
        )
    }
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Grimy Can