#flutter
Вопрос:
Как можно устранить эту проблему. Большое спасибо.
import 'package:flutter_translate/flutter_translate.dart';
class TabViewerPopupMenuActions {
static const String NEW_TAB = translate(
'options.new_tab'); //ERROR: Const variables must be initialized with a constant value.
static const List<String> choices = <String>[
NEW_TAB
];
}
я пытаюсь удалить const
class TabViewerPopupMenuActions {
static String NEW_TAB = translate(
'options.new_tab');
static List<String> choices = <String>[
NEW_TAB
];
}
но ошибка в переключателе
switch (choice) {
case TabViewerPopupMenuActions.NEW_TAB
ОШИБКА: Выражения регистра должны быть постоянными
Комментарии:
1. Какова переменная выбора?
2. выбор: NEW_TAB, НАСТРОЙКИ, NEW_INCOGNITO