const routes; drop universal_io
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:exceptions/exceptions.dart';
|
||||
@@ -29,7 +30,7 @@ import 'package:http/io_client.dart';
|
||||
import 'package:nullability/nullability.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:socks5_proxy/socks_client.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import 'package:weblibre/core/http_error_handler.dart';
|
||||
import 'package:weblibre/data/models/web_page_info.dart';
|
||||
import 'package:weblibre/extensions/http_encoding.dart';
|
||||
|
||||
@@ -99,7 +99,7 @@ class BangDetails extends HookConsumerWidget {
|
||||
.addTab(url: url, private: isPrivate);
|
||||
|
||||
if (context.mounted) {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
},
|
||||
label: Text(bangData.domain),
|
||||
|
||||
@@ -138,7 +138,7 @@ class TabTreeDialog extends HookConsumerWidget {
|
||||
.requestDismiss();
|
||||
}
|
||||
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
},
|
||||
onBeforeDelete: () {
|
||||
if (graph.nodes.length <= 2) {
|
||||
|
||||
@@ -582,7 +582,7 @@ class _ViewUrlSheet extends HookConsumerWidget {
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.requestDismiss();
|
||||
} else {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
},
|
||||
initialHeight: initialHeight,
|
||||
|
||||
@@ -24,14 +24,14 @@ class TabViewScreen extends HookConsumerWidget {
|
||||
scrollController: scrollController,
|
||||
showNewTabFab: false,
|
||||
onClose: () {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
},
|
||||
)
|
||||
: ViewTabsWidget(
|
||||
scrollController: scrollController,
|
||||
showNewTabFab: false,
|
||||
onClose: () {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -46,7 +46,7 @@ class TabViewScreen extends HookConsumerWidget {
|
||||
).push(context);
|
||||
|
||||
if (context.mounted) {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
},
|
||||
child: const Icon(Icons.add),
|
||||
|
||||
@@ -214,7 +214,7 @@ class TabMenu extends HookConsumerWidget {
|
||||
leadingIcon: const Icon(MdiIcons.folderArrowUpDownOutline),
|
||||
child: const Text('Assign container'),
|
||||
onPressed: () async {
|
||||
final targetContainerId = await ContainerSelectionRoute()
|
||||
final targetContainerId = await const ContainerSelectionRoute()
|
||||
.push<String?>(context);
|
||||
|
||||
if (targetContainerId != null) {
|
||||
@@ -237,7 +237,7 @@ class TabMenu extends HookConsumerWidget {
|
||||
leadingIcon: const Icon(MdiIcons.webPlus),
|
||||
child: const Text('Assign Site to Container'),
|
||||
onPressed: () async {
|
||||
final targetContainerId = await ContainerSelectionRoute()
|
||||
final targetContainerId = await const ContainerSelectionRoute()
|
||||
.push<String?>(context);
|
||||
|
||||
if (targetContainerId != null) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:fading_scroll/fading_scroll.dart';
|
||||
import 'package:fast_equatable/fast_equatable.dart';
|
||||
@@ -12,7 +14,7 @@ import 'package:nullability/nullability.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:sliver_tools/sliver_tools.dart';
|
||||
import 'package:timeago/timeago.dart' as timeago;
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import 'package:weblibre/features/geckoview/domain/repositories/tab.dart';
|
||||
import 'package:weblibre/features/geckoview/features/browser/presentation/dialogs/delete_data.dart';
|
||||
import 'package:weblibre/features/geckoview/features/history/domain/entities/history_filter_options.dart';
|
||||
|
||||
@@ -119,7 +119,7 @@ class SearchScreen extends HookConsumerWidget {
|
||||
if (context.mounted) {
|
||||
ref.read(bottomSheetControllerProvider.notifier).requestDismiss();
|
||||
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,7 +233,7 @@ class SearchScreen extends HookConsumerWidget {
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.requestDismiss();
|
||||
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ class HistorySuggestions extends HookConsumerWidget {
|
||||
)
|
||||
.requestDismiss();
|
||||
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ class TabSearch extends HookConsumerWidget {
|
||||
.read(bottomSheetControllerProvider.notifier)
|
||||
.requestDismiss();
|
||||
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -345,6 +345,7 @@ class ContainerEditScreen extends HookConsumerWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
icon: const Icon(Icons.warning),
|
||||
title: const Text('Delete Container'),
|
||||
content: const Text(
|
||||
'Are you sure you want to delete this container and close all attached tabs?',
|
||||
|
||||
@@ -171,7 +171,9 @@ class ContainerChips extends HookConsumerWidget {
|
||||
label: Text(data!.length.toString()),
|
||||
showCheckmark: false,
|
||||
onSelected: (_) async {
|
||||
await ContainerDraftRoute().push(context);
|
||||
await const ContainerDraftRoute().push(
|
||||
context,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
@@ -206,7 +208,7 @@ class ContainerChips extends HookConsumerWidget {
|
||||
IconButton(
|
||||
visualDensity: VisualDensity.compact,
|
||||
onPressed: () async {
|
||||
await ContainerListRoute().push(context);
|
||||
await const ContainerListRoute().push(context);
|
||||
},
|
||||
icon: const Icon(Icons.chevron_right),
|
||||
),
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import 'package:weblibre/features/user/data/models/engine_settings.dart';
|
||||
import 'package:weblibre/features/user/domain/repositories/engine_settings.dart';
|
||||
import 'package:weblibre/utils/exit_app.dart';
|
||||
import 'package:weblibre/utils/form_validators.dart';
|
||||
|
||||
const _defaultServerUrl = 'https://services.addons.mozilla.org';
|
||||
@@ -53,11 +52,7 @@ class AddonCollectionScreen extends HookConsumerWidget {
|
||||
currentSettings.copyWith.addonCollection(null),
|
||||
);
|
||||
|
||||
unawaited(
|
||||
Future.delayed(const Duration(seconds: 1)).whenComplete(() {
|
||||
exit(0);
|
||||
}),
|
||||
);
|
||||
await exitApp(ref.container);
|
||||
},
|
||||
icon: const Icon(Icons.delete),
|
||||
),
|
||||
@@ -122,13 +117,7 @@ class AddonCollectionScreen extends HookConsumerWidget {
|
||||
),
|
||||
);
|
||||
|
||||
unawaited(
|
||||
Future.delayed(const Duration(seconds: 1)).whenComplete(
|
||||
() {
|
||||
exit(0);
|
||||
},
|
||||
),
|
||||
);
|
||||
await exitApp(ref.container);
|
||||
}
|
||||
},
|
||||
child: const Text('Save & Restart Browser'),
|
||||
|
||||
@@ -27,7 +27,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import 'package:weblibre/core/logger.dart';
|
||||
import 'package:weblibre/core/providers/app_state.dart';
|
||||
import 'package:weblibre/core/routing/routes.dart';
|
||||
@@ -35,6 +35,7 @@ import 'package:weblibre/features/settings/presentation/controllers/save_setting
|
||||
import 'package:weblibre/features/settings/presentation/widgets/custom_list_tile.dart';
|
||||
import 'package:weblibre/features/user/data/models/engine_settings.dart';
|
||||
import 'package:weblibre/features/user/domain/repositories/engine_settings.dart';
|
||||
import 'package:weblibre/utils/exit_app.dart';
|
||||
import 'package:weblibre/utils/ui_helper.dart';
|
||||
|
||||
class DeveloperSettingsScreen extends HookConsumerWidget {
|
||||
@@ -95,9 +96,10 @@ class DeveloperSettingsScreen extends HookConsumerWidget {
|
||||
final restart = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
icon: const Icon(Icons.warning),
|
||||
title: const Text('User Agent Changed'),
|
||||
content: const Text(
|
||||
'The app needs to restart for the new user agent to take effect',
|
||||
'The Browser needs to get restarted for the new user agent to take effect',
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -117,7 +119,7 @@ class DeveloperSettingsScreen extends HookConsumerWidget {
|
||||
);
|
||||
|
||||
if (restart == true) {
|
||||
exit(0);
|
||||
await exitApp(ref.container);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart' show rootBundle;
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||
import 'package:pluggable_transports_proxy/pluggable_transports_proxy.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
part 'builtin_bridges.g.dart';
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ class FeedArticleScreen extends HookConsumerWidget {
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.open_in_browser),
|
||||
@@ -258,7 +258,7 @@ class FeedArticleScreen extends HookConsumerWidget {
|
||||
context,
|
||||
tabName: title.whenNotEmpty,
|
||||
onShow: () {
|
||||
BrowserRoute().go(context);
|
||||
const BrowserRoute().go(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:weblibre/extensions/uri.dart';
|
||||
|
||||
final _domainRegex = RegExp(r'\.[a-zA-Z]{2,}$');
|
||||
|
||||
Reference in New Issue
Block a user