Flutter : News App Workshop #part5 send data to WebViewPage

NewsPages.dart

Navigator.push(context,
  MaterialPageRoute(builder: (context) => WebViewPage(),
    settings: RouteSettings(
      arguments: {
        'name' : articles[index]['source']['name'],
        'url' : articles[index]['url'],
      }
    )
   )
 );

WebViewPage.dart

final Map news = ModalRoute.of(context)!.settings.arguments as Map;
title: Text('${news['name']}'),

(Visited 16 times, 1 visits today)
Spread the love
Published
Categorized as Flutter