mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
refactor: Mark semantically final variables as final (or const) proper [DCM] (#2783)
I was playing around with the rule avoid-global-state While I don't think we should enable it, because we do have several totally legitimate cases of what the rule considers global state, it did help me find any current cases where the things just should be final constants. So this PR will mark semantically final variables as final (or const) proper, exclusively on examples (no violations on actual src code are legit).
This commit is contained in:
@ -18,9 +18,9 @@ void main() {
|
||||
/// for tapping elsewhere.
|
||||
/// 3. Uses the Bgm utility for background music.
|
||||
class AudioGame extends FlameGame with TapDetector {
|
||||
static Paint black = BasicPalette.black.paint();
|
||||
static Paint gray = const PaletteEntry(Color(0xFFCCCCCC)).paint();
|
||||
static TextPaint text = TextPaint(
|
||||
static final Paint black = BasicPalette.black.paint();
|
||||
static final Paint gray = const PaletteEntry(Color(0xFFCCCCCC)).paint();
|
||||
static final TextPaint text = TextPaint(
|
||||
style: TextStyle(color: BasicPalette.white.color),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user