Skip to content

Commit

Permalink
remove request local network permission at home
Browse files Browse the repository at this point in the history
Signed-off-by: phuoc <[email protected]>
  • Loading branch information
phuocbitmark committed Jun 17, 2024
1 parent 8f25757 commit 84cc08e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 50 deletions.
14 changes: 0 additions & 14 deletions lib/screen/home/home_navigation_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

import 'dart:async';
import 'dart:io';

import 'package:after_layout/after_layout.dart';
import 'package:autonomy_flutter/common/injector.dart';
Expand Down Expand Up @@ -45,7 +44,6 @@ import 'package:autonomy_flutter/util/au_icons.dart';
import 'package:autonomy_flutter/util/constants.dart';
import 'package:autonomy_flutter/util/dio_util.dart';
import 'package:autonomy_flutter/util/inapp_notifications.dart';
import 'package:autonomy_flutter/util/local_network_helper.dart';
import 'package:autonomy_flutter/util/log.dart';
import 'package:autonomy_flutter/util/style.dart';
import 'package:autonomy_flutter/util/ui_helper.dart';
Expand Down Expand Up @@ -316,18 +314,6 @@ class HomeNavigationPageState extends State<HomeNavigationPage>
WidgetsBinding.instance.addObserver(this);
_fgbgSubscription = FGBGEvents.stream.listen(_handleForeBackground);
unawaited(_syncArtist());

unawaited(_requestLocalNetworkPermission());
}

Future<void> _requestLocalNetworkPermission() async {
if (Platform.isIOS) {
final didRequest = _configurationService.didGetLocalNetworkPermission();
if (!didRequest) {
final result = await LocalNetworkHelper.requestLocalNetworkPermission();
await _configurationService.setDidGetLocalNetworkPermission(result);
}
}
}

Future<void> _syncArtist() async {
Expand Down
15 changes: 0 additions & 15 deletions lib/service/configuration_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import 'package:uuid/uuid.dart';
//ignore_for_file: constant_identifier_names

abstract class ConfigurationService {
bool didGetLocalNetworkPermission();

Future<void> setDidGetLocalNetworkPermission(bool value);

Future<void> setRecordOwners(List<String> owners, {bool override = false});

List<String> getRecordOwners();
Expand Down Expand Up @@ -281,8 +277,6 @@ abstract class ConfigurationService {
}

class ConfigurationServiceImpl implements ConfigurationService {
static const String keyDidGetLocalNetWorkPermission =
'did_get_local_network_permission';
static const String keyRecordOwners = 'yoko_ono_record_owners';
static const String KEY_HAS_MERCHANDISE_SUPPORT_INDEX_ID =
'has_merchandise_support';
Expand Down Expand Up @@ -1227,15 +1221,6 @@ class ConfigurationServiceImpl implements ConfigurationService {
await _preferences.setStringList(keyRecordOwners, currentOwners.toList());
}
}

@override
bool didGetLocalNetworkPermission() =>
_preferences.getBool(keyDidGetLocalNetWorkPermission) ?? false;

@override
Future<void> setDidGetLocalNetworkPermission(bool value) async {
await _preferences.setBool(keyDidGetLocalNetWorkPermission, value);
}
}

enum ConflictAction {
Expand Down
21 changes: 0 additions & 21 deletions lib/util/local_network_helper.dart

This file was deleted.

0 comments on commit 84cc08e

Please sign in to comment.