The Flutter build is stuck on the splash screen - flutter

Flutter build is stuck on the splash screen. I tried it on both a real device and the Pixel 4 Api33 emulator. Using Namal woocommerce source code available on codecanyon website and I am a beginner. I tried my best to figure out what's wrong but I failed. Asking for your help guys, please let me know if you need any other information.
**main.dart error log file on Pixel 4 Api33 emulator**
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
D/FlutterGeolocator(10640): Attaching Geolocator to activity
W/FlutterActivityAndFragmentDelegate(10640): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
D/FlutterGeolocator(10640): Creating service.
D/FlutterGeolocator(10640): Binding to location service.
D/FlutterLocationService(10640): Creating service.
D/FlutterLocationService(10640): Binding to location service.
D/FlutterGeolocator(10640): Geolocator foreground service connected
D/FlutterGeolocator(10640): Initializing Geolocator services
D/FlutterGeolocator(10640): Flutter engine connected. Connected engine count 1
Debug service listening on ws://127.0.0.1:54544/-pXfnrJ83sQ=/ws
Syncing files to device sdk gphone64 x86 64...
V/OneSignal(10640): Initializing the OneSignal Flutter SDK (3.3.2)
D/OneSignal(10640): Adding a task to the pending queue with ID: 1
D/OneSignal(10640): startPendingTasks with task queue quantity: 1
D/OneSignal(10640): Attempted to clean 6 month old IAM data, but none exists!
D/OneSignal(10640): OneSignal InAppMessageTracker initInfluencedTypeFromCache: OSChannelTracker{tag=iam_id, influenceType=UNATTRIBUTED, indirectIds=null, directId=null}
D/OneSignal(10640): OneSignal NotificationTracker initInfluencedTypeFromCache: OSChannelTracker{tag=notification_id, influenceType=UNATTRIBUTED, indirectIds=null, directId=null}
D/OneSignal(10640): OneSignal getUnattributedUniqueOutcomeEventsSentByChannel: null
W/OneSignal(10640): appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!
V/OneSignal(10640): setAppId called with id: YOUR_ONESIGNAL_APP_ID changing id from: null
V/OneSignal(10640): Starting OneSignal initialization!
D/OneSignal(10640): Retrieved IAMs from DB redisplayedInAppMessages: []
V/OneSignal(10640): No class found, not setting up OSRemoteNotificationReceivedHandler
I/OneSignal(10640): Last Pending Task has ran, shutting down
V/OneSignal(10640): OneSignal SDK initialization delayed, waiting for remote params.
D/OneSignal(10640): Starting request to get Android parameters.
D/OneSignal(10640): OneSignalRestClient: Making request to: https://api.onesignal.com/apps/YOUR_ONESIGNAL_APP_ID/android_params.js
W/SQLiteLog(10640): (28) double-quoted string literal: "notification"
D/OneSignal(10640): OneSignalRestClient: Adding header if-none-match: W/"05702b137a259242f45cdd80824abb9f"
D/TrafficStats(10640): tagSocket(135) with statsTag=0x2710, statsUid=-1
V/OneSignal(10640): OneSignalRestClient: After con.getResponseCode to: https://api.onesignal.com/apps/YOUR_ONESIGNAL_APP_ID/android_params.js
D/OneSignal(10640): OneSignalRestClient: GET - Using Cached response due to 304: {"awl_list":{},"receive_receipts_enable":false}
D/OneSignal(10640): OneSignal saveInfluenceParams: InfluenceParams{indirectNotificationAttributionWindow=1440, notificationLimit=10, indirectIAMAttributionWindow=1440, iamLimit=10, directEnabled=false, indirectEnabled=false, unattributedEnabled=false}
D/OneSignal(10640): reassignDelayedInitParams with appContext: androidx.multidex.MultiDexApplication#7610e7d
V/OneSignal(10640): setAppId called with id: YOUR_ONESIGNAL_APP_ID changing id from: null
V/OneSignal(10640): Starting OneSignal initialization!
V/OneSignal(10640): No class found, not setting up OSRemoteNotificationReceivedHandler
E/OneSignal(10640): OneSignal AppId format is invalid.
E/OneSignal(10640): Example: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba'
E/OneSignal(10640):
E/OneSignal(10640): java.lang.IllegalArgumentException: Invalid UUID string: YOUR_ONESIGNAL_APP_ID
E/OneSignal(10640): at java.util.UUID.fromString(UUID.java:194)
E/OneSignal(10640): at com.onesignal.OSUtils.initializationChecker(OSUtils.java:118)
E/OneSignal(10640): at com.onesignal.OneSignal.init(OneSignal.java:841)
E/OneSignal(10640): at com.onesignal.OneSignal.setAppId(OneSignal.java:735)
E/OneSignal(10640): at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1181)
E/OneSignal(10640): at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:889)
E/OneSignal(10640): at com.onesignal.OneSignal$7.complete(OneSignal.java:1122)
E/OneSignal(10640): at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:211)
E/OneSignal(10640): at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
E/OneSignal(10640): at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:156)
E/OneSignal(10640): at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:279)
E/OneSignal(10640): at java.lang.Thread.run(Thread.java:1012)
V/OneSignal(10640): initWithContext called with: androidx.multidex.MultiDexApplication#7610e7d
V/OneSignal(10640): Starting OneSignal initialization!
V/OneSignal(10640): No class found, not setting up OSRemoteNotificationReceivedHandler
I/flutter (10640): --> GET https://sidemenclothing.in/wp-json/api/tc_settings/app_all_settings
I/flutter (10640): {clientid: 1234, clientsecret: sk_1234, X-Requested-With: XMLHttpRequest, authorization: }
[log]
<-- START PARAMS:
null
END PARAMS -->
<-- END HTTP
I/flutter (10640): Hivedata
I/flutter (10640): Instance of 'BoxImpl<WooCartData>'
E/flutter (10640): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
E/flutter (10640): #0 List.[] (dart:core-patch/growable_array.dart:264:36)
E/flutter (10640): #1 _SplashScreenState.getCart (package:flutter_kundol/ui/screens/splash_screen.dart:136:28)
E/flutter (10640): <asynchronous suspension>
E/flutter (10640):
I/flutter (10640): <-- 200 GET https://sidemenclothing.in/wp-json/api/tc_settings/app_all_settings
[log]
<-- START RESPONSE:
{last_tab: 1, home_style: 1, category_style: 1, banner_style: 3, card_style: 1, cancel_order_button: 0, cancel_order_hours: 1, package_name: app.beastdeals, site_url: https://sidemenclothing.in/, new_product_duration: 5, filter_max_price: 100000, update_order: 10, one_page_checkout: 1, checkout_process: yes, custom_css_for_checkout: .site-header, nav, #secondary, footer {display: none!important;}, contact_us_email: info#domain-name.com, from_email: from#domain-name.com, phone_no: +92 123 456-789, address: 228 Park avs, city: New York, state: NY, Zip: 10003, Country: USA, Latitude: 40.730610, Longitude: -73.935242, sidebar_menu_icon: 0, wish_list_page: 0, edit_profile_page: 0, shipping_address_page: 0, my_orders_page: 0, contact_us_page: 0, about_us_page: 0, bill_ship_info: 0, downloads: 0, news_page: 0, intro_page: 0, share_app: 0, rate_app: 0, setting_page: 0, notification_title: Theme Coder, notification_text: A bundle of products wating for you!, notification_duration: 0, facebook_login: 0, about_page_id: , refund_page_id: , privacy_page_id: , terms_page_id: , wpml_enabled: 0, mvf_enabled: 0, wp_point_reward: 0, wp_multi_currency: 0, delivery_tracking: 0, tracking_url: http://urltracking.com/, geo_fencing: 0, one_signal_notification: 0, one_signal_app_id: , one_signal_app_key: , privacy_page: , refund_page: , terms_page: , about_page: , currency: {name: INR, position: left}, language: {name: en_US}}
END RESPONSE -->
<-- END HTTP
E/flutter (10640): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter (10640): #0 _SplashScreenState.build.<anonymous closure> (package:flutter_kundol/ui/screens/splash_screen.dart:74:76)
E/flutter (10640): #1 _BlocListenerBaseState._subscribe.<anonymous closure> (package:flutter_bloc/src/bloc_listener.dart:204:24)
E/flutter (10640): #2 _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
E/flutter (10640): #3 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
E/flutter (10640): #4 _DelayedData.perform (dart:async/stream_impl.dart:515:14)
E/flutter (10640): #5 _PendingEvents.handleNext (dart:async/stream_impl.dart:620:11)
E/flutter (10640): #6 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:591:7)
E/flutter (10640): #7 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (10640): #8 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter (10640):
D/EGL_emulation(10640): app_time_stats: avg=988.05ms min=162.14ms max=1813.96ms count=2
**pubsec.yml file**
name: flutter_kundol
description: A new Flutter ecommerce application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: '>=2.17.6 <3.0.5'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_bloc: ^7.3.3 # need to change InitialState implementations for above 7.3.3
equatable: ^2.0.5
shared_preferences: ^2.0.15
carousel_slider: ^4.1.1
dio: ^4.0.6
cached_network_image: ^3.2.1
flutter_html: ^2.2.1
# flutter_range_slider: "^1.5.0"
firebase_auth: ^4.1.1
google_sign_in: ^5.4.1
firebase_core: ^2.1.1
flutter_login_facebook: ^1.6.0
share: ^2.0.4
in_app_review: ^2.0.4
onesignal_flutter: ^3.4.1
flutter_svg: ^0.23.0+1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5
launch_review: ^3.0.1
dropdown_search: ^1.0.0
google_maps_place_picker_mb: ^2.0.0-mb.22
google_maps_flutter: ^2.1.12
bubble_tab_indicator: ^0.1.6
webview_flutter: ^2.8.0
url_launcher: ^6.1.5
hive: ^2.2.3
path_provider: ^2.0.11
hive_flutter: ^1.1.0
dev_dependencies:
hive_generator: ^1.1.3
build_runner: ^2.2.0
change_app_package_name: ^1.1.0
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/langs/
- assets/images/
- assets/icons/
- assets/json/
fonts:
- family: MontserratRegular
fonts:
- asset: assets/fonts/Montserrat-Regular.ttf
- family: MontserratLight
fonts:
- asset: assets/fonts/Montserrat-Light.ttf
- family: MontserratMedium
fonts:
- asset: assets/fonts/Montserrat-Medium.ttf
- family: MontserratBold
fonts:
- asset: assets/fonts/Montserrat-Bold.ttf
- family: MontserratSemiBold
fonts:
- asset: assets/fonts/Montserrat-SemiBold.ttf
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

Related

Flutter not load assets

I have a problem with flutter the assets below are not displayed inside the widget, it tells me unable to load assetss how can I do to fix this?
Dart Code:
final cookingEvent = Event(
imagePath: "assets/event_images/granite_cooking_class.jpeg",
title: "Basket",
description: "",
location: "Ferrara(FE)",
duration: "1ms",
punchLine1: "Partecipa!",
punchLine2: "nuova partita di calcio",categoryIds: [0, 2],
galleryImages: ["assets/event_images/cooking_1.jpeg", "assets/event_images/cooking_2.jpeg", "assets/event_images/cooking_3.jpeg"]);
Flutter Exception:
r: "assets/event_images/5_km_downtown_run.jpeg", scale: 1.0)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: Unable to load asset: assets/event_images/granite_cooking_class.jpeg
flutter: Another exception was thrown: Unable to load asset: assets/event_images/music_concert.jpeg
flutter: Another exception was thrown: Unable to load asset: assets/event_images/golf_competition.jpeg
Pubspec.yaml:
assets:
- assets/guest_images/
- assets/event_images/
- assets/fonts/
fonts:
- family: Montserrat
fonts:
weight: 700
Make sure that the path of your image is correct.
Then check for tab spaces.
make sure to run flutter pub get command.
Then restart your app or hot reload your app.

Hosting an executable within a Flutter application

I have a basic flutter project running on android where when the application starts, I write an executable bundled in my assets.
static String appInternalPath = '/data/data/com.maksimdan.face_merger';
void writeExecutable() async {
var executablePath = join(appInternalPath, 'main');
if (await File(executablePath).exists()) {
File(executablePath).delete();
print('deleted old executable');
} else {
print('not executable exists');
}
ByteData data = await rootBundle.load('lib/py/dist/main');
List<int> bytes =
data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
await File(executablePath).writeAsBytes(bytes);
print('wrote new executable');
}
Sometime later in my code I try to run it.
void invokeExecutable() async {
String executablePath = join(appInternalPath, 'main');
Process.run('chmod', ['u+x', executablePath]).then((ProcessResult results) {
Process.run(executablePath, []).then((ProcessResult results) {
print(results.stdout);
});
});
}
But obtain a permission denied error.
E/flutter (31825): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: ProcessException: Permission denied
E/flutter (31825): Command: /data/data/com.maksimdan.flutter_general/main
E/flutter (31825): #0 _ProcessImpl._start (dart:io-patch/process_patch.dart:390:33)
E/flutter (31825): #1 Process.start (dart:io-patch/process_patch.dart:36:20)
E/flutter (31825): #2 _runNonInteractiveProcess (dart:io-patch/process_patch.dart:565:18)
E/flutter (31825): #3 Process.run (dart:io-patch/process_patch.dart:47:12)
E/flutter (31825): #4 _MyHomePageState.invokeExecutable.<anonymous closure> (package:flutter_general/main.dart:51:15)
E/flutter (31825): #5 _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (31825): #6 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (31825): <asynchronous suspension>
I've also tried:
Process.run('/system/bin/chmod', ['744', path]).then((ProcessResult results) {
print('shell1 complete');
Process.run(path, []).then((ProcessResult results) {
print('shell2 complete');
print(results.stdout);
});
});
My executable:
// 'Hello World!' program
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
>> g++ main.cc -o main
Is there a way to run your own executables in flutter with the proper permissions? On native android, there is an option to file.setExecutable(true); using this strategy. (Hosting an executable within Android application)
Or will I have to experiment with method channels?
pubspec.yml
name: face_merger
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
sqflite: ^1.3.0+2
process_run: ^0.10.10+1
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- lib/py/dist/main
I also verified that the file was written to the internal memory of on the device that I expected it to be written to using android studio's device explore.
Besides the writable permission you need to have readable permission in your app.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.yyy">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
...
You need to put the .db file extension at the end of the database name (Assuming DB_DIR is for a database). var path = join(DB_DIR, 'main.db');
Then I think you may want to use path_provider package and use
Directory documentsDirectory = await getApplicationDocumentsDirectory();
for the directory where you are accessing the database.

Flutter 1.0 - Unable to load text asset

I'm having some trouble loading text assets in flutter (1.0).
This is the current code attempting to read the asset.
Future<String> get _localPath async {
final directory = await getApplicationDocumentsDirectory();
return directory.path;
}
Future<String> getFileData(String path) async {
return await rootBundle.loadString(path);
}
Future<File> get _localFile async {
final path = await _localPath;
final file = File('$path/toon_test_3.json');
bool exists = file.existsSync();
if(exists){
return file;
} else {
// Load the default file
final newfile = await getFileData('toonRepo/data.json');
return file.writeAsString(newfile);
}
}
loadString will failing popping up the following:
Could not load source 'dart:core/runtime/libobject_patch.dart': <source not available>.
If execution continues the following exception is raised:
Exception has occurred.
FlutterError (Unable to load asset: toonRepo/data.json)
I've tried a lot of solutions here that revolve around the asset section in pubspec.yaml
name: hello_world
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
path_provider: ^0.4.1
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
english_words: ^3.1.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
assets:
- toonRepo/
uses-material-design: true
Am I going wrong somewhere very silly?
Cheers for any pointers you have.
Project Structure
Here is a temporary copy of the code if you want to take a peek.
Github
And here's a stack trace
[VERBOSE-2:shell.cc(184)] Dart Error: Unhandled exception:
Unable to load asset: toonRepo/data.json
#0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
<asynchronous suspension>
#1 AssetBundle.loadString (package:flutter/src/services/asset_bundle.dart:67:33)
<asynchronous suspension>
#2 CachingAssetBundle.loadString.<anonymous closure> (package:flutter/src/services/asset_bundle.dart:162:56)
#3 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection/runtime/libcompact_hash.dart:284:23)
The asset access works fine with the pubspec.yaml in your question.
new Text("Name: " + toon.info.name)),
fails because toon is null because it never got a value assigned.
You could use new Text("Name: " + (toon?.info?.name ?? 'foo')), to work around the exception.
If you add
widget.storage.getFileData('toonRepo/data.json').then((f) => print(f));
to _FlutterDemoState.initState(), you'll see that reading the asset works just fine.

Flutter play custom sound using audioplayers 0.7.7?

pubspec.yaml
flutter:
uses-material-design: true
assets:
- assets/Images/1.png
- assets/Images/MP3.mp3
Test.dart
Widget localAsset() {
return _tab([
Text("Click to play"),
_btn('Play', () => audioCache.play('assets\Images\MP3.mp3')),
]);
}
I am new to flutter, for my applications i want play two sounds mode(background sound ,button action sound), after referred from flutter package i have changed code like as above , when i used this widget in my material,i am getting below error,
E/flutter ( 2750): [ERROR:flutter/shell/common/shell.cc(181)] Dart Error: Unhandled exception:
E/flutter ( 2750): Unable to load asset: assets/assetsImagesMP3.mp3
E/flutter ( 2750): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
Backslash are Windows-specific. Use slashes instead. Android is Unix-based and so is iOS
audioCache.play('assets/Images/MP3.mp3')

Migrating to angulardart 4.0.0 fails with message Unsupported operation: Using the 'angular2' transformer is required

I just migrated my project from angulardart 3.1.0 to 4.0.0 my pubspec.yaml was:
dependencies:
angular2: ^3.1.0
http: ^0.11.0
#...other deps
dev_dependencies:
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: web/main.dart
resolved_identifiers:
BrowserClient: 'package:http/browser_client.dart'
Client: 'package:http/http.dart'
- dart_to_js_script_rewriter
- $dart2js:
sourceMaps: true
and became :
dependencies:
angular: ^4.0.0
angular_router: ^1.0.2
angular_components: ^0.8.0
http: ^0.11.0
#... other deps
dev_dependencies:
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular:
entry_points: web/main.dart
- $dart2js:
sourceMaps: true
- dart_to_js_script_rewriter
My issue is that in dartium (Version 50.0.2661.108 (64-bit) "on mac") I have this error on startup:
VM970:1 Uncaught Unhandled exception:
Unsupported operation: Using the 'angular2' transformer is required.
Please see https://webdev.dartlang.org/angular/tutorial for setup instructions,
and ensure your 'pubspec.yaml' file is configured to invoke the 'angular2'
transformer on your application's entry point.
#0 bootstrap (package:angular/src/platform/bootstrap.dart:107:5)
#1 main (http://localhost:3000/web/main.dart:50:3)
<asynchronous suspension>
And when I try to run pub build it does not recognize ngIf and ngFor :
Error: Template parse errors: line 13, column 11 of UserListPopup: ParseErrorLevel.FATAL: Property binding ngIf not used by any directive on an embedded template
For reference, this is my entire pubspec.yaml now:
name: share_place
description: Collaborate around your documents in a seamless way
version: 0.0.1
environment:
sdk: '>=1.24.0 <2.0.0'
dependencies:
angular: ^4.0.0
angular_router: ^1.0.2
angular_components: ^0.8.0
http: ^0.11.0
stream_transformers: ^0.3.0
http_server: any
js: ^0.6.0
uuid: ^0.5.3
croppie_dart: ^2.4.1
stack_trace: any
source_map_stack_trace: any
source_maps: any
validator: ">=0.0.4 <0.1.0"
dev_dependencies:
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular:
entry_points:
- web/main.dart
- $dart2js:
sourceMaps: true
- dart_to_js_script_rewriter
This is reproducible on twos machines I tested to upgrade dart on (windows and mac). I still didn't try to uninstall reinstall
Here's the content of my main.dart there's nothing special I think:
int version;
Future loadLastVersion() async {
String version = await html.HttpRequest.getString('/sp/util/loadAppVersion');
if (conf.appVersion != version) {
if (conf.isWebApp) {
html.window.alert("you have an old version : ${conf.appVersion} we must load the new version :${version}");
html.window.location.assign("${conf.remoteUrl}/v${version}");
} else {
html.window.alert("A new version ${version} is available! Please download it from : https://www.share.place/downloads");
}
}
}
Future main() async {
loadLastVersion();
Logger.root.level = Level.FINE;
Logger.root.onRecord.listen((LogRecord rec) {
if (rec.level == Level.SEVERE || rec.level == Level.WARNING)
html.window.console.error('${rec.level.name} - ${rec.loggerName} : ${rec.message}');
else if (rec.level == Level.INFO)
html.window.console.info('${rec.level.name} - ${rec.loggerName} : ${rec.message}');
else
html.window.console.debug('${rec.level.name} - ${rec.loggerName} : ${rec.message}');
});
bootstrap(AppComponent, [provide(Client, useClass: BrowserDataService), provide(ExceptionHandler, useClass: ErrorHandler), Environment, EventBus]
// Using a real back end? Import browser_client.dart and change the above to
// [provide(Client, useFactory: () => new BrowserClient(), deps: [])]
);
}
This is not supported anymore
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
You need to add to #Component(...)
directives: const [COMMON_DIRECTIVES]
pipes: const [COMMON_PIPES]
to every component where you use them.