I am creating a PopupMenuButton() in the AppBar section.
This is my file:
import 'dart:js';
import 'package:bfdi_app/settings.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
class ProfilePage extends StatefulWidget {
@override
_ProfilePageState createState() => _ProfilePageState();
}
class _ProfilePageState extends State<ProfilePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(
'App_Name',
),
actions: <Widget>[
PopupMenuButton(
icon: Icon(Icons.settings),
onSelected:(value){
if(value==0){
Navigator.push(
context,
MaterialPageRoute(builder: (context)=>SettingPage())
);
}
},
itemBuilder: (context) => [
PopupMenuItem(
child: Text("Settings"),
value:0,
],
),
],
),
}
Now I am facing an error in Console Log:
Compiler message:
lib/Pages/addPost.dart:1:8: Error: Not found: 'dart:js'
import 'dart:js';
^
lib/Profile/profile.dart:1:8: Error: Not found: 'dart:js'
import 'dart:js';
^
I have already added the dependency dart:js, but still getting the same error. Error:
Go to your flutter installed directory/.pub-cache/hosted/pub.dartlang.org/js-0.6.3-nullsafety.1/lib/js.dart
Delete or comment this line:
export 'dart:js' show allowInterop, allowInteropCaptureThis;
Then try again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With