Last active
May 12, 2021 09:27
-
-
Save crizant/a98799b41b2d31c496eff749394fbc5e to your computer and use it in GitHub Desktop.
Flutter: handle custom theme properties in different brightness by extension method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
extension CustomColorScheme on ColorScheme { | |
Color get success => brightness == Brightness.light ? const Color(0xFF28a745) : const Color(0x2228a745); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment