Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error 255 when 'black' #000000 background tried. all other colours including white #ffffff fine. #6

Closed
lubi888 opened this issue Aug 27, 2019 · 5 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@lubi888
Copy link

lubi888 commented Aug 27, 2019

Hi again, @henriquearthur ,

I tried a black background and got this error.

flutter pub pub run flutter_native_splash:create
Unhandled exception:
type 'int' is not a subtype of type 'String'
#0      createSplash (package:flutter_native_splash/flutter_native_splash.dart:15:10)
<asynchronous suspension>
#1      main (file:///C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.6/bin/create.dart:5:3)
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

Every other colour, including 'white' #ffffff works fine for me.

Is black a colour or an absence of colour and light?! That's possibly a physics question.

@henriquearthur
Copy link
Collaborator

henriquearthur commented Aug 27, 2019

I will look into this later when I get home but it looks like when a hex color only has numbers like "008000" or "000000" it doesn't go into a String: String color = config['color'];.

Changing the variable type should fix this. Will publish a new version later today.

Damn, I was hoping it was physics craziness over here.

@henriquearthur henriquearthur added android bug Something isn't working and removed android labels Aug 27, 2019
@lubi888
Copy link
Author

lubi888 commented Aug 27, 2019

Hi Herique,

Yeah, take your time. There's no rush.

In the meantime I just put in a 95% black from w3 schools color picker and it works fine.

color: 0d0d0d gives me as near to black '000000' as possible

Does the code think '000000' is 0 the int and not '000000' the string? I'll let you handle that.

Thanks, H.

@bishosamer
Copy link

im getting the same issue it seems that it doesnt like 0's, i tried 008e93 and it gives the same error

@henriquearthur
Copy link
Collaborator

Here's the thing. When we do this:

flutter_native_splash:
  image: splash.png
  color: 000000

YAML passes color as integer 0 to Dart. How to prevent that? Super-complicated stuff: use quotes.

flutter_native_splash:
  image: splash.png
  color: "000000"

This is how YAML syntax works. I added quotes in README.md to prevent future errors.
And now you can use # too, like: color: "#000000". I was missing that litte guy!

Thanks for the catch!

@henriquearthur henriquearthur added documentation Improvements or additions to documentation and removed dart labels Aug 27, 2019
@lubi888
Copy link
Author

lubi888 commented Aug 28, 2019

Hi again @henriquearthur

Looking forward to giving this a try today. So this was a yaml issue and not a prob for dart? Sounds about right.

I'll give it a go a bit later because right now 'pub.dev' website is down and 'flutter pub get' is not working. A bit embarrassing for Google. Must be hard for the developers like you right now.

Anyway, thanks again for all your work and contributions to the flutter community. Ciao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants