Skip to content

Commit

Permalink
Upgrade packages, remove unused, reduce apk size
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Feb 8, 2024
1 parent 8c5f423 commit dd3f361
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 394 deletions.
2 changes: 1 addition & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:eduapge2/messages.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:package_info/package_info.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down
3 changes: 0 additions & 3 deletions lib/icanteen.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
Expand Down Expand Up @@ -47,8 +46,6 @@ class ICanteenPageState extends State<ICanteenPage> {

getData() async {
sharedPreferences = await SharedPreferences.getInstance();
dio.interceptors
.add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);

setState(() {
loading = true; //make loading true to show progressindicator
Expand Down
3 changes: 0 additions & 3 deletions lib/icanteen_setup.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:dio/dio.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
Expand All @@ -21,8 +20,6 @@ class ICanteenSetupScreenState extends State<ICanteenSetupScreen> {
late SessionManager sessionManager;
late SharedPreferences sharedPreferences;

Dio dio = Dio();

String baseUrl = FirebaseRemoteConfig.instance.getString("testUrl");

AppLocalizations? local;
Expand Down
6 changes: 0 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:eduapge2/api.dart';
import 'package:eduapge2/homework.dart';
Expand Down Expand Up @@ -97,8 +95,6 @@ class PageBase extends StatefulWidget {
class PageBaseState extends State<PageBase> {
int _selectedIndex = 0;
String baseUrl = FirebaseRemoteConfig.instance.getString("testUrl");
late Response response;
Dio dio = Dio();

bool loaded = false;

Expand All @@ -115,8 +111,6 @@ class PageBaseState extends State<PageBase> {

@override
void initState() {
dio.interceptors
.add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);
if (!_isCheckingForUpdate) _checkForUpdate(); // ik that it's not necessary
super.initState();
}
Expand Down
13 changes: 4 additions & 9 deletions lib/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:html_unescape/html_unescape.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
Expand Down Expand Up @@ -51,14 +50,10 @@ class MessagePageState extends State<MessagePage> {
});
Response response = await dio.get(
"$baseUrl/api/timelineitem/${widget.id}",
options: buildCacheOptions(
const Duration(days: 5),
forceRefresh: false,
options: Options(
headers: {
"Authorization": "Bearer ${EP2Data.getInstance().user.token}",
},
),
options: Options(
headers: {
"Authorization": "Bearer ${EP2Data.getInstance().user.token}",
},
),
);

Expand Down
6 changes: 0 additions & 6 deletions lib/timetable.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:eduapge2/api.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/material.dart';
import 'package:dio/dio.dart';
import 'package:dio_http_cache/dio_http_cache.dart';
import 'package:flutter_session_manager/flutter_session_manager.dart';
import 'package:intl/intl.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
Expand All @@ -19,8 +17,6 @@ class TimeTablePage extends StatefulWidget {
class TimeTablePageState extends State<TimeTablePage> {
String baseUrl = FirebaseRemoteConfig.instance.getString("testUrl");

Dio dio = Dio();

bool error = false; //for error status
bool loading = false; //for data featching status
String errmsg = ""; //to assing any error message from API/runtime
Expand All @@ -37,8 +33,6 @@ class TimeTablePageState extends State<TimeTablePage> {
@override
void initState() {
super.initState();
dio.interceptors
.add(DioCacheManager(CacheConfig(baseUrl: baseUrl)).interceptor);
}

@override
Expand Down
4 changes: 1 addition & 3 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import dynamic_color
import firebase_analytics
import firebase_core
import firebase_remote_config
import package_info
import package_info_plus
import path_provider_foundation
import sentry_flutter
Expand All @@ -24,8 +23,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseRemoteConfigPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseRemoteConfigPlugin"))
FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
Expand Down
Loading

0 comments on commit dd3f361

Please sign in to comment.