mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-26 11:16:45 +08:00
feat: 4423 - specific "Not connected to internet" displayed error (#4455)
* feat: 4423 - specific "Not connected to internet" displayed error Impacted files: * `barcode_product_query.dart`: removed useless `try` as already `catch`'ed * `continuous_scan_model.dart`: removed the `codeInvalid` case that could never happen * `fetched_product.dart`: refactored with explicit constructors and additional exception and connectivity fields; removed the `codeInvalid` case that could never happen * `new_product_page.dart`: minor refactoring * `product_dialog_helper.dart`: removed the `codeInvalid` case that could never happen; minor refactoting * `product_list_item_simple.dart`: removed the `codeInvalid` case that could never happen * `product_loader_page.dart`: removed useless `try` as already `catch`'ed * `product_refresher.dart`: added a specific "You're not connected to the internet" error message; refactored using more `FetchedProduct`; removed useless method * `pubspec.lock`: wtf * `pubspec.yaml`: added package `connectivity_plus` * `question_card.dart`: refactored using `FetchedProduct` * feat: 4423 - fixed pubspec.yaml * feat: 4423 - new "server down" message after a ping attempt Impacted files: * `fetched_product.dart`: added field `failedPingedHost` where we store the host that we couldn't ping * `generated_plugin_registrant.cc`: wtf * `generated_plugins.cmake`: wtf * `GeneratedPluginRegistrant.swift`: wtf * `main.dart`: registered `DartPingIOS` * `product_refresher.dart`: now trying to ping the server if exception and connection * `pubspec.lock`: wtf * `pubspec.yaml: added packages `dart_ping` and `dart_ping_ios` * feat: 4423 - stupid lint check part 1 * feat: 4423 - stupid lint check part 2 * feat: 4423 - stupid lint check part 3 * feat: 4423 - stupid lint check part 5 * feat: 4423 - localizations Impacted files: * `app_en.arb`: 4 new labels when we couldn't retrieve a product (not found, no internet, server down, server error) * `product_refresher.dart`: used the new labels
This commit is contained in:
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:app_store_shared/app_store_shared.dart';
|
||||
import 'package:dart_ping_ios/dart_ping_ios.dart';
|
||||
import 'package:device_preview/device_preview.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -120,6 +121,7 @@ Future<bool> _init1() async {
|
||||
return false;
|
||||
}
|
||||
|
||||
DartPingIOS.register();
|
||||
await SmoothServices().init(GlobalVars.appStore);
|
||||
await setupAppNetworkConfig();
|
||||
await UserManagementProvider.mountCredentials();
|
||||
|
Reference in New Issue
Block a user