"The best way": there is no silverbullet, you'll have to decide what frameworks and tools to use. But i'll give a simple example how a client application typically connects to a database. Most basic example:

Client application
The client application can be any application the user typically uses. Some examples:
- Mobile app (written in native, Dart, Xamarin, ...)
- Desktop app (Electron, WPF, ...)
- Website app (Angular, React, Vue, ...)
- ...
API
The API is there to retrieve data, and change data. But It will also handle authentication, authorization, logging, doing business logic, ...
The API can be any technology you want. In your example .net core.
Whats important is that your client application can communicate with your api.
Using GraphQL, REST (JSON, XML, ...), ...
Dart has packages for GraphQL and REST
Database
Your API will then execute queries, inserts, updates, deletes, execute stored procedures on the Database of your choice. In your example SQL Server.
There are many possibilities on how to set this up, depending on your skills, knowledge of frameworks, how you want to deploy things.
How you want to deploy this will limit your choices as well. For your API:
- Serverless API (Via Azure Functions, AWS Lambda, ...)
- Cloud Website (Azure Web Apps, ...)
- Website hosted on premise
- Docker container
- ...
In real life scenarios this often gets more complex with Firewalls, Application Gateways, Virtual networks, clusters, ...