null safety
This commit is contained in:
@@ -87,7 +87,7 @@ class _TrackingIDPageState extends State<TrackingIDPage> {
|
||||
String? selectedMarket;
|
||||
Widget dropDown() {
|
||||
List<Market> _markets = Provider.of<MarketModel>(context).markets;
|
||||
List<String> markets = _markets.map((e) => e.name).toList();
|
||||
List<String?> markets = _markets.map((e) => e.name).toList();
|
||||
markets.insert(0, MANAGE_MARKET);
|
||||
markets.insert(0, SELECT_MARKET);
|
||||
|
||||
@@ -126,10 +126,10 @@ class _TrackingIDPageState extends State<TrackingIDPage> {
|
||||
});
|
||||
},
|
||||
isExpanded: true,
|
||||
items: markets.map<DropdownMenuItem<String>>((String value) {
|
||||
items: markets.map<DropdownMenuItem<String>>((String? value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value,
|
||||
child: Text(value ?? "",
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: value == MANAGE_MARKET
|
||||
@@ -146,7 +146,7 @@ class _TrackingIDPageState extends State<TrackingIDPage> {
|
||||
_manageMarket() {
|
||||
Navigator.push<Package>(
|
||||
context,
|
||||
CupertinoPageRoute(builder: (context) => MarketEditor()),
|
||||
CupertinoPageRoute(builder: (context) => MarketEditor()),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user