Basis setup on exploring

This commit is contained in:
2025-04-21 01:17:46 +08:00
parent 8e7baaa380
commit be08c7c806
22 changed files with 1454 additions and 27 deletions

View File

@ -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
View 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;
});