Skip to content

Commit

Permalink
feat: added upgrader (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
SolMendiola authored Mar 25, 2024
1 parent fac47cc commit 54bcc84
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ vendor/bundle/

#iOS related
ios/build

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/xcuserdata/
14 changes: 10 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ PODS:
- bugsee_flutter (5.0.2):
- Bugsee (= 3.2.1)
- Flutter
- device_info_plus (0.0.1):
- Flutter
- Firebase/CoreOnly (10.18.0):
- FirebaseCore (= 10.18.0)
- Firebase/Crashlytics (10.18.0):
Expand Down Expand Up @@ -91,6 +93,7 @@ PODS:

DEPENDENCIES:
- bugsee_flutter (from `.symlinks/plugins/bugsee_flutter/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_crashlytics (from `.symlinks/plugins/firebase_crashlytics/ios`)
- Flutter (from `Flutter`)
Expand All @@ -99,7 +102,7 @@ DEPENDENCIES:
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
Expand All @@ -124,6 +127,8 @@ SPEC REPOS:
EXTERNAL SOURCES:
bugsee_flutter:
:path: ".symlinks/plugins/bugsee_flutter/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_crashlytics:
Expand All @@ -141,7 +146,7 @@ EXTERNAL SOURCES:
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
Expand All @@ -152,6 +157,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Bugsee: bee7c99744047186669df53f8b7ed77cb50ef2f1
bugsee_flutter: ef54a68c4fa59caf82f8954bbf03156965e7b6c4
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
firebase_core: 0af4a2b24f62071f9bf283691c0ee41556dcb3f5
firebase_crashlytics: 55714f63ae0973c54b3a721c451ae5f815086c1f
Expand All @@ -173,11 +179,11 @@ SPEC CHECKSUMS:
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2
webview_flutter_wkwebview: b7e70ef1ddded7e69c796c7390ee74180182971f

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
PODFILE CHECKSUM: 989d81c492c14dc649311e4e03b91db276355942

COCOAPODS: 1.14.3
8 changes: 7 additions & 1 deletion lib/ui/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:fluttips/ui/home/home_cubit.dart';
import 'package:fluttips/ui/section/error_handler/error_handler_cubit.dart';
import 'package:fluttips/ui/section/global_ui/global_ui_cubit.dart';
import 'package:fluttips/core/common/config.dart';
import 'package:upgrader/upgrader.dart';

class HomeScreen extends StatelessWidget {
const HomeScreen({
Expand Down Expand Up @@ -49,7 +50,12 @@ class _HomeContentScreenState extends State<HomeContentScreen> {
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
floatingActionButton: _buildFab(showUIActionComponent),
backgroundColor: context.theme.colors.background,
body: SafeArea(child: child),
body: SafeArea(
child: UpgradeAlert(
upgrader: Upgrader(),
child: child,
),
),
drawer: AppDrawer(
tabsController: AutoTabsRouter.of(context),
action: () => _scaffoldKey.currentState!.closeDrawer(),
Expand Down
28 changes: 28 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Generated file. Do not edit.
//

import FlutterMacOS
import Foundation

import device_info_plus
import firebase_core
import firebase_crashlytics
import flutter_secure_storage_macos
import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
}
43 changes: 43 additions & 0 deletions macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
92 changes: 70 additions & 22 deletions pubspec.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,17 @@ dependencies:
package_info_plus: 4.2.0
photo_view: 0.14.0
rxdart: 0.27.7
shared_preferences: 2.0.16
shared_preferences: 2.1.1
sqflite: 2.2.0+3
sqflite_common_ffi: 2.2.1+1 # Used to provide a custom DatabaseFactory
sqflite_common_ffi_web: 0.3.2 # Used to provide a custom DatabaseFactory
stack_trace: 1.11.0
stock: 1.0.1
styled_text: 7.0.0
url_launcher: 6.1.7
url_launcher: 6.1.11
webview_flutter: 4.0.1
webview_flutter_web: 0.2.1
upgrader: 8.4.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 54bcc84

Please sign in to comment.