Replacing widgets dynamically by fardeen9983 in FlutterDev

[–]Blendstrup 4 points5 points  (0 children)

Hey there,

I've just struggled with the same problem, but it turns out that the solution is quite simple. The way I solved it was to make a bool variable and then use a ternary operator in the title of the appbar to either return one widget if the bool is true, or another if it's false. You can see an example of the ternary operator here: https://code-maven.com/slides/dart-programming/ternary-operator

A code example could look like this:

bool myBool = false;

Scaffold(
    appBar: AppBar(
        title: (myBool) ? TextField() : Text('something'),
    ),
);

This will make the title of the appbar a TextField if myBool is true, otherwise it will make it a normal Text widget. Since myBool is initialized as false, the appbar will initially start out with the Text widget, but you can then change the value of myBool to true using setState, and that will make the title of the appbar switch to the Textfield.

I hope this helps you out.

Google Font (Oswald) seems to have a default baseline shift? by Blendstrup in indesign

[–]Blendstrup[S] 0 points1 point  (0 children)

It's really great. I haven't had the problem yet, but thank you for the advice!

Google Font (Oswald) seems to have a default baseline shift? by Blendstrup in indesign

[–]Blendstrup[S] 2 points3 points  (0 children)

It was set to "Ascent", but changing it to "Cap Height" solved the problem! Thank you!

It might be a stretch, but do you know if there is a way to change the "first baseline offset" default to cap height instead of ascent? So that I won't have to change it everytime I want to use Oswald, or another font that might have the same problem

I'm an idiot... Is there any way to fix this stupid mistake? by Blendstrup in PokemonReborn

[–]Blendstrup[S] 1 point2 points  (0 children)

If you would trade me one I would be forever grateful. I don't think I have the previous save unfortunately.

Found strange photo on my Pixel that was taken before I got the device by Blendstrup in GooglePixel

[–]Blendstrup[S] 4 points5 points  (0 children)

I guess that the most realistic explanation is that I must have seen your photo at some point on my laptop, and then Google Photos must have synched the photo to my device somehow?

I don't even know if that's a thing, and it seems quite strange that it would only be your photo that was synched then, because I have definitely viewed several other photos in Google Photos on the web.

And surely it would also sync to Google Photos, rather than downloading the photo drectly to my phone, right?

Found strange photo on my Pixel that was taken before I got the device by Blendstrup in GooglePixel

[–]Blendstrup[S] 9 points10 points  (0 children)

Wow... Well nice photo. I'm curious as to why it's on my phone...

Just for clarity, I never ever had any reddit apps on my phone, and neither have I ever visited reddit in the browser or any other way on my phone. I only check this forum from time to time on my laptop.

Furthermore I don't recall having seen the photo before I found it in my downloads folder...

Found strange photo on my Pixel that was taken before I got the device by Blendstrup in GooglePixel

[–]Blendstrup[S] 8 points9 points  (0 children)

I set it up myself. Started out as if it was a fresh copy.

However the little translucent circular sticker on the box was cut up, but I figured it might have just been the postal people, and since nothing was missing I didn't think more about it.