import 'dart:convert'; import 'package:dio/dio.dart'; final dio = Dio(); void getHttp() async { String username = 'user'; String password = 'password'; String basicAuth = 'Basic ${base64.encode(utf8.encode('$username:$password'))}'; final response = await dio.get('http://localhost:8080/api/v1/projects',options:Options(headers: {'authorization': basicAuth})); print(response); }