import 'package:flutter/material.dart'; TextStyle getTextFieldStyle(BuildContext context, bool isEditable) { return TextStyle( color: isEditable ? Theme.of(context).shadowColor : Theme.of(context).disabledColor ); } InputDecoration getInputDecoration(BuildContext context, String label, bool isEditable) { final theme = Theme.of(context); return InputDecoration( labelText: label, labelStyle: TextStyle( color: isEditable ? theme.shadowColor : theme.disabledColor, ) ); }