null safety

This commit is contained in:
phyothandar
2021-09-10 16:48:21 +06:30
parent 03c5fc5016
commit bb4f4ad7c2
40 changed files with 393 additions and 352 deletions

View File

@@ -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()),
);
}