Skip to content

Commit

Permalink
feat: #1185 - added the "splash screen until last moment" effect (#1188)
Browse files Browse the repository at this point in the history
Impacted files:
* `main.dart`: added the "splash screen until last moment" effect
* `Podfile.lock`: wtf
* `pubspec.lock`: impacted from `pubspec.yaml`
* `pubspec.yaml`: upgraded packages and sdk; moved `flutter_native_splash` from `dev`
  • Loading branch information
monsieurtanuki authored Mar 9, 2022
1 parent 766ec4e commit e5be520
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 56 deletions.
16 changes: 11 additions & 5 deletions packages/smooth_app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PODS:
- camera (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_native_splash (0.0.1):
- Flutter
- flutter_secure_storage (3.3.1):
- Flutter
- google_ml_barcode_scanner (0.0.1):
Expand Down Expand Up @@ -73,7 +75,7 @@ PODS:
- Flutter
- path_provider_ios (0.0.1):
- Flutter
- "permission_handler (5.1.0+2)":
- permission_handler_apple (9.0.2):
- Flutter
- PromisesObjC (2.0.0)
- Protobuf (3.19.4)
Expand All @@ -95,14 +97,15 @@ PODS:
DEPENDENCIES:
- camera (from `.symlinks/plugins/camera/ios`)
- Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- google_ml_barcode_scanner (from `.symlinks/plugins/google_ml_barcode_scanner/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- iso_countries (from `.symlinks/plugins/iso_countries/ios`)
- matomo_forever (from `.symlinks/plugins/matomo_forever/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
Expand Down Expand Up @@ -131,6 +134,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/camera/ios"
Flutter:
:path: Flutter
flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_secure_storage:
:path: ".symlinks/plugins/flutter_secure_storage/ios"
google_ml_barcode_scanner:
Expand All @@ -145,8 +150,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
sentry_flutter:
Expand All @@ -159,6 +164,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
camera: 9993f92f2c793e87b65e35f3a23c70582afb05b1
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
google_ml_barcode_scanner: 469be1279c5ab275846f0957c85015b7b30d0c16
GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940
Expand All @@ -178,7 +184,7 @@ SPEC CHECKSUMS:
nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
permission_handler_apple: d21b38e1a4b2e041c63af9568f9165e114e507a6
PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
Protobuf: 235750e4696ff59fb07d949a9dbbc92b3c0700fe
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
Expand Down
7 changes: 6 additions & 1 deletion packages/smooth_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_native_splash/flutter_native_splash.dart';
import 'package:openfoodfacts/personalized_search/product_preferences_selection.dart';
import 'package:provider/provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
Expand All @@ -23,7 +24,9 @@ import 'package:smooth_app/themes/theme_provider.dart';
List<CameraDescription> cameras = <CameraDescription>[];

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final WidgetsBinding widgetsBinding =
WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);

if (kReleaseMode) {
await AnalyticsHelper.initSentry(
Expand Down Expand Up @@ -97,6 +100,7 @@ class _SmoothAppState extends State<SmoothApp> {
future: _initFuture,
builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
if (snapshot.hasError) {
FlutterNativeSplash.remove();
return _buildError(snapshot);
}
if (snapshot.connectionState != ConnectionState.done) {
Expand All @@ -108,6 +112,7 @@ class _SmoothAppState extends State<SmoothApp> {
ChangeNotifierProvider<T> provide<T extends ChangeNotifier>(T value) =>
ChangeNotifierProvider<T>(create: (BuildContext context) => value);

FlutterNativeSplash.remove();
return MultiProvider(
providers: <ChangeNotifierProvider<ChangeNotifier>>[
provide<UserPreferences>(_userPreferences),
Expand Down
85 changes: 46 additions & 39 deletions packages/smooth_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "34.0.0"
version: "36.0.0"
after_layout:
dependency: transitive
description:
Expand All @@ -21,14 +21,14 @@ packages:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
version: "3.3.1"
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.11"
version: "3.2.1"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -77,7 +77,7 @@ packages:
name: camera
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.4+11"
version: "0.9.4+16"
camera_platform_interface:
dependency: transitive
description:
Expand All @@ -91,7 +91,7 @@ packages:
name: camera_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1+2"
version: "0.2.1+3"
carousel_slider:
dependency: "direct main"
description:
Expand All @@ -113,13 +113,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.5"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -154,7 +147,7 @@ packages:
name: crop_your_image
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0+1"
version: "0.7.0"
cross_file:
dependency: transitive
description:
Expand Down Expand Up @@ -189,7 +182,7 @@ packages:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
version: "2.2.2"
device_frame:
dependency: transitive
description:
Expand Down Expand Up @@ -264,12 +257,12 @@ packages:
source: hosted
version: "0.14.0"
flutter_native_splash:
dependency: "direct dev"
dependency: "direct main"
description:
name: flutter_native_splash
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.3"
version: "2.1.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down Expand Up @@ -377,7 +370,7 @@ packages:
name: hive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.6"
hive_flutter:
dependency: "direct main"
description:
Expand Down Expand Up @@ -412,28 +405,28 @@ packages:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
version: "3.1.3"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.4+8"
version: "0.8.4+10"
image_picker_for_web:
dependency: transitive
description:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
version: "2.1.6"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.3"
version: "2.4.4"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -545,7 +538,7 @@ packages:
name: modal_bottom_sheet
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -573,7 +566,7 @@ packages:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.4.0"
package_info_plus_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -643,14 +636,14 @@ packages:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.11"
version: "2.0.12"
path_provider_ios:
dependency: transitive
description:
name: path_provider_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.7"
version: "2.0.8"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -679,13 +672,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.1"
percent_indicator:
dependency: "direct main"
description:
Expand All @@ -699,14 +685,35 @@ packages:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "8.3.0"
version: "9.2.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.2+1"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.3"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.7.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -769,14 +776,14 @@ packages:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
qr_code_scanner:
dependency: "direct main"
description:
name: qr_code_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.1"
version: "0.7.0"
quiver:
dependency: transitive
description:
Expand Down Expand Up @@ -825,7 +832,7 @@ packages:
name: shared_preferences_ios
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
version: "2.1.0"
shared_preferences_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1005,7 +1012,7 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.9"
url_launcher_windows:
dependency: transitive
description:
Expand All @@ -1019,7 +1026,7 @@ packages:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.5"
version: "3.0.6"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -1047,7 +1054,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.11"
version: "2.4.1"
wkt_parser:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit e5be520

Please sign in to comment.