✨ Basis setup on exploring
This commit is contained in:
@ -6,7 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
const kAtkStoreKey = 'nex_user_atk';
|
||||
const kRtkStoreKey = 'nex_user_rtk';
|
||||
|
||||
const kNetworkServerDefault = 'https://api.sn.solsynth.dev';
|
||||
const kNetworkServerDefault = 'http://localhost:5071';
|
||||
const kNetworkServerStoreKey = 'app_server_url';
|
||||
|
||||
const kAppbarTransparentStoreKey = 'app_bar_transparent';
|
||||
|
20
lib/pods/network.dart
Normal file
20
lib/pods/network.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'config.dart';
|
||||
|
||||
final dioProvider = Provider<Dio>((ref) {
|
||||
final serverUrl = ref.watch(serverUrlProvider);
|
||||
final dio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: serverUrl,
|
||||
connectTimeout: const Duration(seconds: 10),
|
||||
receiveTimeout: const Duration(seconds: 10),
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
return dio;
|
||||
});
|
Reference in New Issue
Block a user