dart.global.ethers is undefined
despite having the same syntax as in the example, I get the error in the title
`final Web3Provider provider = Web3Provider(ethereum!);
final Signer signer = provider.getSigner();
final Contract contract = Contract(deployedNftContractAddress, tideNftAbiListed, provider);
final symbol = await contract.symbol();`
when running final Web3Provider provider = Web3Provider(ethereum!);
I get the error dart.global.ethers is undefined.
Below I put all the imports of the file containing this code:
`import 'package:flutter_web3_provider/ethers.dart';
import 'package:http/http.dart' as http;
import 'package:flutter_web3_provider/ethereum.dart';
import 'dart:convert';`
Did you import ethers like in the example? https://github.com/gochain/flutter_web3_provider/blob/main/example/lib/main.dart
yes, as you can see from all the imports i wrote
Did you add this to the HTML?
<script src="https://cdn.ethers.io/lib/ethers-5.0.umd.min.js" type="application/javascript"></script>
I just added it, but I keep getting the same error
I'm not sure, might have to debug it yourself. Pull Requests are welcome.
I solved by downloading and adding manually the script : https://cdn.ethers.io/lib/ethers-5.0.umd.min.js in my project