Skip to content

Commit

Permalink
Optimize import.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed May 27, 2024
1 parent 5000d7c commit 573d782
Show file tree
Hide file tree
Showing 25 changed files with 22 additions and 47 deletions.
1 change: 1 addition & 0 deletions lib/account/device_linking/approve_device.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:lantern/common/common.dart';
import 'package:lantern/plans/utils.dart';

import 'explanation_step.dart';

@RoutePage<void>(name: 'ApproveDevice')
Expand Down
5 changes: 1 addition & 4 deletions lib/account/settings.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'package:catcher_2/core/catcher_2.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:intl/intl.dart';
import 'package:lantern/common/app_methods.dart';
import 'package:lantern/common/app_secret.dart';
import 'package:lantern/common/common.dart';
import 'package:lantern/common/common_desktop.dart';
import 'package:lantern/common/ui/app_loading_dialog.dart';
import 'package:lantern/i18n/localization_constants.dart';
import 'package:lantern/messaging/messaging_model.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';

@RoutePage(name: 'Settings')
class Settings extends StatelessWidget {
Expand Down
1 change: 1 addition & 0 deletions lib/account/support.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:url_launcher/url_launcher.dart';

import '../common/common.dart';

@RoutePage<void>(name: 'Support')
Expand Down
1 change: 1 addition & 0 deletions lib/catcher_setup.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';

import 'package:catcher_2/catcher_2.dart';
import 'package:flutter/material.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Expand Down
6 changes: 2 additions & 4 deletions lib/common/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export 'package:stop_watch_timer/stop_watch_timer.dart';

export 'add_nonbreaking_spaces.dart';
export 'app_keys.dart';
export 'app_secret.dart';
export 'disable_back_button.dart';
export 'iterable_extension.dart';
export 'list_subscriber.dart';
Expand All @@ -51,7 +52,6 @@ export 'ui/continue_arrow.dart';
export 'ui/copy_text.dart';
export 'ui/countdown_min_sec.dart';
export 'ui/countdown_stopwatch.dart';

// custom components
export 'ui/custom/asset_image.dart';
export 'ui/custom/badge.dart';
Expand All @@ -62,10 +62,10 @@ export 'ui/custom/fullscreen_video_viewer.dart';
export 'ui/custom/fullscreen_viewer.dart';
export 'ui/custom/ink_well.dart';
export 'ui/custom/list_item_factory.dart';
export 'ui/custom/retry_widget.dart';
export 'ui/custom/rounded_rectangle_border.dart';
export 'ui/custom/text.dart';
export 'ui/custom/text_field.dart';
export 'ui/custom/retry_widget.dart';
export 'ui/dimens.dart';
export 'ui/focused_menu.dart';
export 'ui/full_screen_dialog.dart';
Expand All @@ -87,11 +87,9 @@ export 'ui/round_button.dart';
export 'ui/search_field.dart';
export 'ui/show_bottom_modal.dart';
export 'ui/show_snackbar.dart';

export 'ui/text_highlighter.dart';
export 'ui/text_styles.dart';
export 'ui/transitions.dart';
export 'app_secret.dart';

final appLogger = Logger(
printer: PrettyPrinter(
Expand Down
12 changes: 2 additions & 10 deletions lib/common/common_desktop.dart
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import 'package:lantern/common/common.dart';
import 'package:tray_manager/tray_manager.dart';
import 'package:lantern/ffi.dart';
import 'package:ffi/ffi.dart';
import 'dart:ffi';
import 'package:lantern/common/ui/websocket.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';

export 'dart:convert';
export 'dart:ffi'; // For FFI

export 'package:ffi/ffi.dart';
export 'package:ffi/src/utf8.dart';
export 'package:lantern/ffi.dart';
export 'package:lantern/common/tray_handler.dart';
export 'package:lantern/common/ui/websocket.dart';
export 'package:lantern/ffi.dart';
export 'package:web_socket_channel/io.dart';
export 'package:web_socket_channel/web_socket_channel.dart';
4 changes: 0 additions & 4 deletions lib/common/ffi_list_subscriber.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import 'dart:collection';

import 'common.dart';
import 'common_desktop.dart';
import 'list_subscriber.dart';
import 'package:lantern/i18n/i18n.dart';
import 'package:fixnum/fixnum.dart';
import 'package:intl/intl.dart';

class FfiListNotifier<T> extends SubscribedNotifier<ChangeTrackingList<T>> {
FfiListNotifier(
Expand Down
6 changes: 2 additions & 4 deletions lib/common/ffi_subscriber.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import 'package:web_socket_channel/status.dart' as status;

import 'common.dart';
import 'common_desktop.dart';
import 'dart:convert';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/status.dart' as status;
import 'package:web_socket_channel/web_socket_channel.dart';

extension BoolParsing on String {
bool parseBool() {
Expand Down
4 changes: 2 additions & 2 deletions lib/common/model.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:collection';

import 'package:lantern/common/ffi_subscriber.dart';
import 'package:lantern/common/ffi_list_subscriber.dart';
import 'package:lantern/common/ffi_subscriber.dart';
import 'package:lantern/messaging/messaging.dart';

import 'common_desktop.dart';
import 'package:web_socket_channel/web_socket_channel.dart';

abstract class Model {
late MethodChannel methodChannel;
Expand Down
2 changes: 0 additions & 2 deletions lib/common/tray_handler.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:lantern/common/common.dart';
import 'package:lantern/common/common_desktop.dart';
import 'package:tray_manager/tray_manager.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/common/ui/app_webview.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_windows_webview/flutter_windows_webview.dart';
import 'package:lantern/common/common.dart';
import 'package:lantern/common/ui/app_loading_dialog.dart';

@RoutePage(name: 'AppWebview')
class AppWebView extends StatefulWidget {
Expand Down
2 changes: 0 additions & 2 deletions lib/common/ui/custom/text.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:lantern/common/common.dart';

class CText extends StatelessWidget {
Expand Down
3 changes: 1 addition & 2 deletions lib/common/ui/websocket.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'package:flutter/foundation.dart';

import 'package:lantern/common/common_desktop.dart';

abstract class WebsocketService {
Expand Down
3 changes: 0 additions & 3 deletions lib/core/router/router.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import 'package:auto_route/auto_route.dart';
import 'package:lantern/common/common.dart';
import 'package:lantern/common/ui/transitions.dart';
import 'package:lantern/core/router/router.gr.dart';

@AutoRouterConfig(
replaceInRouteName: 'Page,Route,Screen',
Expand Down
2 changes: 1 addition & 1 deletion lib/i18n/i18n.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:i18n_extension_importer/src/io/import.dart';
import 'package:i18n_extension/i18n_extension.dart';
import 'package:i18n_extension_importer/src/io/import.dart';
import 'package:lantern/common/common.dart';

extension Localization on String {
Expand Down
3 changes: 2 additions & 1 deletion lib/messaging/messaging_model.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// import 'calls/signaling.dart';
import 'messaging.dart';
import 'package:lantern/common/common_desktop.dart';

import 'messaging.dart';

final messagingModel = MessagingModel();

class MessagingModel extends Model {
Expand Down
1 change: 1 addition & 0 deletions lib/messaging/protos_flutteronly/messaging.pbenum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

// ignore_for_file: UNDEFINED_SHOWN_NAME
import 'dart:core' as $core;

import 'package:protobuf/protobuf.dart' as $pb;

class MessageDirection extends $pb.ProtobufEnum {
Expand Down
2 changes: 1 addition & 1 deletion lib/messaging/protos_flutteronly/messaging.pbjson.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
///
import 'dart:convert' as $convert;
// Generated code. Do not modify.
// source: protos_flutteronly/messaging.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name

import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use messageDirectionDescriptor instead')
const MessageDirection$json = const {
Expand Down
1 change: 0 additions & 1 deletion lib/plans/plan_details.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:lantern/common/common.dart';
import 'package:lantern/plans/payment_provider.dart';
import 'package:lantern/plans/utils.dart';

class PlanCard extends StatelessWidget {
Expand Down
2 changes: 1 addition & 1 deletion lib/plans/reseller_checkout.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:email_validator/email_validator.dart';
import 'package:intl/intl.dart';
import 'package:lantern/common/common.dart';
import 'package:lantern/plans/plan_details.dart';
import 'package:lantern/plans/tos.dart';
import 'package:lantern/plans/utils.dart';
import 'package:intl/intl.dart';

class ResellerCodeFormatter extends TextInputFormatter {
@override
Expand Down
1 change: 0 additions & 1 deletion lib/plans/utils.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:lantern/common/common.dart';
import 'package:lantern/common/ui/app_webview.dart';
import 'package:lantern/plans/payment_provider.dart';

const defaultTimeoutDuration = Duration(seconds: 10);

Expand Down
2 changes: 1 addition & 1 deletion lib/replica/logic/uploader.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter_uploader/flutter_uploader.dart';
import 'package:http/http.dart' as http;
import 'package:lantern/common/common.dart';
import 'package:lantern/messaging/notifications.dart';
import 'package:http/http.dart' as http;

/// ReplicaUploader is a singleton class. Use it like this:
/// - Initialize ReplicaUploader by calling ReplicaUploader.inst.init()
Expand Down
2 changes: 1 addition & 1 deletion lib/vpn/vpn_model.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:lantern/vpn/vpn.dart';
import 'package:lantern/common/common_desktop.dart';
import 'package:lantern/vpn/vpn.dart';

final vpnModel = VpnModel();

Expand Down
1 change: 0 additions & 1 deletion lib/vpn/vpn_status.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:lantern/vpn/vpn.dart';
import 'package:lantern/common/common_desktop.dart';

class VPNStatus extends StatelessWidget {
@override
Expand Down
1 change: 1 addition & 0 deletions lib/vpn/vpn_tab.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:lantern/account/split_tunneling.dart';
import 'package:lantern/messaging/messaging.dart';
import 'package:lantern/vpn/vpn.dart';

import 'vpn_bandwidth.dart';
import 'vpn_pro_banner.dart';
import 'vpn_server_location.dart';
Expand Down

0 comments on commit 573d782

Please sign in to comment.