don't use null check operator on user l2 (#1089)

pull/1544/head
ggurdin 1 year ago committed by GitHub
parent 563744288f
commit 7c5c28162e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -103,7 +103,7 @@ class LearningProgressIndicatorsState
context: context,
builder: (c) => const SettingsLearning(),
),
l2: userL2!.getDisplayName(context) ?? userL2.langCode,
l2: userL2?.getDisplayName(context) ?? userL2?.langCode,
),
Row(
children: ProgressIndicatorEnum.values

@ -3,12 +3,12 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
/// A badge that represents one learning progress indicator (i.e., construct uses)
class LearningSettingsButton extends StatelessWidget {
final String l2;
final String? l2;
final VoidCallback onTap;
const LearningSettingsButton({
super.key,
required this.l2,
this.l2,
required this.onTap,
});
@ -46,7 +46,7 @@ class LearningSettingsButton extends StatelessWidget {
),
const SizedBox(width: 5),
Text(
l2,
l2 ?? "?",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,

Loading…
Cancel
Save