Update background color in language_level_dropdown.dart and p_languag… (#1841)
* Update background color in language_level_dropdown.dart and p_language_dropdown.dart --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
6ee37c0216
commit
11c681576b
3 changed files with 13 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
|
|
@ -11,6 +12,7 @@ class LanguageLevelDropdown extends StatelessWidget {
|
|||
final Function(LanguageLevelTypeEnum)? onChanged;
|
||||
final FormFieldValidator<Object>? validator;
|
||||
final bool enabled;
|
||||
final Color? backgroundColor;
|
||||
|
||||
const LanguageLevelDropdown({
|
||||
super.key,
|
||||
|
|
@ -18,6 +20,7 @@ class LanguageLevelDropdown extends StatelessWidget {
|
|||
this.onChanged,
|
||||
this.validator,
|
||||
this.enabled = true,
|
||||
this.backgroundColor,
|
||||
});
|
||||
|
||||
@override
|
||||
|
|
@ -48,6 +51,14 @@ class LanguageLevelDropdown extends StatelessWidget {
|
|||
? (value) => onChanged?.call(value as LanguageLevelTypeEnum)
|
||||
: null,
|
||||
validator: validator,
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
maxHeight: kIsWeb ? 500 : null,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
color: backgroundColor ??
|
||||
Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,9 +80,6 @@ class SettingsLearningView extends StatelessWidget {
|
|||
}
|
||||
return null;
|
||||
},
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.surfaceContainerHigh,
|
||||
),
|
||||
PLanguageDropdown(
|
||||
onChange: (lang) =>
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ class PLanguageDropdownState extends State<PLanguageDropdown> {
|
|||
maxHeight: kIsWeb ? 500 : null,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
color: widget.backgroundColor,
|
||||
color: widget.backgroundColor ??
|
||||
Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
),
|
||||
),
|
||||
items: [
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue