There is no Android API to change the DNS server, at least on an unrooted phone; this must be done by each user through their phone's wifi settings. This is actually a good thing - if an app could easily hijack DNS servers that could be catastrophic for internet security.
However, there may be a potential alternative. There are apps that provide DNS settings, but by masquerading as a VPN. 1.1.1.1 from cloudflare is probably the most prominent example of this. However, what it does it probably not very easy to do from Flutter, as it involves a great deal of native android code and likely some server backend (not sure about that but it seems likely). I doubt very much that there is a flutter package providing this functionality.
Your best bet would be to figure out how this is done in native android code, and then expose it through a platform channel to dart.