mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:27:09 -05:00 
			
		
		
		
	* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:hooks_riverpod/hooks_riverpod.dart';
 | 
						|
import 'package:immich_mobile/services/network.service.dart';
 | 
						|
 | 
						|
final networkProvider = StateNotifierProvider<NetworkNotifier, String>((ref) {
 | 
						|
  return NetworkNotifier(ref.watch(networkServiceProvider));
 | 
						|
});
 | 
						|
 | 
						|
class NetworkNotifier extends StateNotifier<String> {
 | 
						|
  final NetworkService _networkService;
 | 
						|
 | 
						|
  NetworkNotifier(this._networkService) : super('');
 | 
						|
 | 
						|
  Future<String?> getWifiName() {
 | 
						|
    return _networkService.getWifiName();
 | 
						|
  }
 | 
						|
 | 
						|
  Future<bool> getWifiReadPermission() {
 | 
						|
    return _networkService.getLocationWhenInUserPermission();
 | 
						|
  }
 | 
						|
 | 
						|
  Future<bool> getWifiReadBackgroundPermission() {
 | 
						|
    return _networkService.getLocationAlwaysPermission();
 | 
						|
  }
 | 
						|
 | 
						|
  Future<bool> requestWifiReadPermission() {
 | 
						|
    return _networkService.requestLocationWhenInUsePermission();
 | 
						|
  }
 | 
						|
 | 
						|
  Future<bool> requestWifiReadBackgroundPermission() {
 | 
						|
    return _networkService.requestLocationAlwaysPermission();
 | 
						|
  }
 | 
						|
 | 
						|
  Future<bool> openSettings() {
 | 
						|
    return _networkService.openSettings();
 | 
						|
  }
 | 
						|
}
 |