Skip to content

Instantly share code, notes, and snippets.

@crizant
Last active May 12, 2021 09:27
Show Gist options
  • Save crizant/a98799b41b2d31c496eff749394fbc5e to your computer and use it in GitHub Desktop.
Save crizant/a98799b41b2d31c496eff749394fbc5e to your computer and use it in GitHub Desktop.
Flutter: handle custom theme properties in different brightness by extension method
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