Widget build(BuildContext context) {
final routeArgs =
ModalRoute.of(context).settings.arguments as Map<String, String>;
final categoryTitle = routeArgs['title'];
final categoryId = routeArgs['id'];
return Scaffold(
appBar: AppBar(
title: Text(categoryTitle),
),
i think your routeArgs['title'] is null and when you put it in text it is generating error try
Text(categoryTitle??"")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.