What\'s the best programming practice to
create a constant class in Flutter
to keep all the application constants for easy referenc
I like to organise my "constants" this way. It's easier for me to stay organised and to keep track what's already there.
I can than do stuff like this: Tables.questions.id
and Tables.anwerOptions.orderIndex
class Tables {
static QuestionsTable get questions => QuestionsTable();
static AnswerOptionsTable get answerOptions => AnswerOptionsTable();
}
class QuestionsTable {
String get id => "id";
String get title => "question";
String get subtitle => "description";
String get inputFieldType => "answer_input_type";
String get answer => "answer";
}
class AnswerOptionsTable {
String get id => "id";
String get questionId => "question_id";
String get answerOption => "answer_option";
String get orderIndex => "order_index";
}