feat(app): add manual entry and sharing flows
This commit is contained in:
@@ -8,7 +8,7 @@ import 'package:lunchpick/presentation/providers/location_provider.dart';
|
||||
final weatherProvider = FutureProvider<WeatherInfo>((ref) async {
|
||||
final repository = ref.watch(weatherRepositoryProvider);
|
||||
final location = await ref.watch(currentLocationProvider.future);
|
||||
|
||||
|
||||
if (location == null) {
|
||||
throw Exception('위치 정보를 가져올 수 없습니다');
|
||||
}
|
||||
@@ -37,12 +37,13 @@ class WeatherNotifier extends StateNotifier<AsyncValue<WeatherInfo>> {
|
||||
final WeatherRepository _repository;
|
||||
final Ref _ref;
|
||||
|
||||
WeatherNotifier(this._repository, this._ref) : super(const AsyncValue.loading());
|
||||
WeatherNotifier(this._repository, this._ref)
|
||||
: super(const AsyncValue.loading());
|
||||
|
||||
/// 날씨 정보 새로고침
|
||||
Future<void> refreshWeather() async {
|
||||
state = const AsyncValue.loading();
|
||||
|
||||
|
||||
try {
|
||||
final location = await _ref.read(currentLocationProvider.future);
|
||||
if (location == null) {
|
||||
@@ -86,7 +87,8 @@ class WeatherNotifier extends StateNotifier<AsyncValue<WeatherInfo>> {
|
||||
}
|
||||
|
||||
/// WeatherNotifier Provider
|
||||
final weatherNotifierProvider = StateNotifierProvider<WeatherNotifier, AsyncValue<WeatherInfo>>((ref) {
|
||||
final repository = ref.watch(weatherRepositoryProvider);
|
||||
return WeatherNotifier(repository, ref);
|
||||
});
|
||||
final weatherNotifierProvider =
|
||||
StateNotifierProvider<WeatherNotifier, AsyncValue<WeatherInfo>>((ref) {
|
||||
final repository = ref.watch(weatherRepositoryProvider);
|
||||
return WeatherNotifier(repository, ref);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user