Mike Rydstrom Profile picture
Oct 6, 2021 11 tweets 6 min read Read on X
Here #FlutterDev connoisseur @biz84 showed us how to make a #Flutter web body like layout, that is centered and width constrained.
What happens if we use this with scrolling content?
What is your solution for it?
Do you have the perfect one? Let us know!
Meanwhile let us check out how this works with scrolling content. We keep Andrea's nice login card and add a bunch of other things to it and put it all in a scrolling view. Hmm scrollbars next to the body content, not so nice...
Can we fix this easily? Sure, let's disable the scrollbars for the child and put our own scrollbars outside of it all...
This seems to work OK, right? The scrollbars are now on the edge, so that is good. But there is an issue, if you touch or mouse wheel scroll from the expanding margins that do not contain any content, it does not scroll!

Do you have a simple fix for this?
Let us know! 💙
The HomePage contains some other interesting features. First the the constrained body (1) having a custom scroll view (2), with sliver lists, sliver grids and sliver to box adapters. We can toggle theme mode (3), see theme colors (4) and Andrea's sign-in card (5) is there too😅
The theme toggle is using #Flutter toggle buttons, you can make pretty cool stuff with it, and it is easy to use!
So let's back up a bit, the theme looks a bit fancy pants! What is going here?
The MaterialApp setup is very basic, a light and a dark theme with a call back to toggle the mode, sure you can use system mode too.
Using simple #Flutter theming, no magic. I wrapped themes in an AppTheme class with a suitable name.
The theming has some perhaps not entirely basic things going on. It is still using basic Material colors, but with some alpha blend flair and slight transparency on the app bar 😀
We can also add needed helpers and some more elaborate sub-themes that we need to the same AppTheme class, and do some tuning to card and input decoration, as well elevated buttons and toggle buttons theme. As a few simple sub-theme examples 😇💙
All in all, pretty straight forward! 🙏😃
You can play with this example in a DartPad here:
dartpad.dev/?id=f2f45a57d4… and find the source in a GIST here:
gist.github.com/rydmike/f2f45a…

Got a nice solution that also scrolls from the expanding side margins? 🤔

Please do let us know! 😇💙

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Mike Rydstrom

Mike Rydstrom Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @RydMike

Jul 31
In a tweet @KhalidWarsa asked how to use the Material ThemeBuilder to get these colors into a Material 3 ColorScheme. While you can, it will not give you code where it is easy make a new scheme via code in #FlutterDev. I suggested using FlexSeedScheme to make the ColorScheme.
1/n Image
Here an example resulting light and dark #Flutter ColorScheme. Below we will look at how to get there and possible more tweaks to it. This scheme was made with package FlexSeedScheme where you can control the result using SeedColorScheme.fromSeeds
2/n pub.dev/packages/flex_…

Image
Image
For the sample I used the Adaptive Theme Demo sample, made for the Fluttercon 24 talk "Everything Material All At Once"

3/ndocs.google.com/presentation/d…
Read 14 tweets
Nov 14, 2021
FlexColorScheme V4 for #FlutterDev has a daunting amount of cool new features, including Material3 like looks 😎💙
#Flutter package here:
pub.dev/packages/flex_…
Try it with the Themes Playground here:
rydmike.com/flexcolorschem…
My quick takes feature highlight tweets in a thread
👇
FlexColorScheme V4 #FlutterDev 1/10
When opting in on new sub themes, border radius defaults to new Material 3/You guide values and varies by Widget type. Change it to whatever you want for all #Flutter Widgets, 4 dp as before, square or super round, via a single radius value💙😀
FlexColorScheme V4 #FlutterDev 2/10
When opting in on new sub themes, the Material 3 FAB border radius can feel a bit "too new" in #Flutter. Keep it circular even with M3 defaults, and other border radius settings too, if you so prefer 🙏😇💙
Read 11 tweets
Nov 13, 2021
New and hipper #Flutter FlexColorScheme V4 is out, rough on docs, but we don't mind, cause my golly it is so fun to folly with themes in the playground rydmike.com/flexcolorschem… Go grab the pack and put it on the stack pub.dev/packages/flex_… #FlutterDev 💙
Wait, what, it is doing this crazy thing, it's like #Flutter flexy color blends, with lots of modes and styles. Flex it here, flex it there, what are all these blendy things?
To try it, is to love it, play with it for fun 'till you grok all #Flutter flexy colors in a their schemy M3 like material bonanza for You, try it here if you will rydmike.com/flexcolorschem…
Read 7 tweets
Oct 4, 2021
Ever noticed how messy and different the behavior of the #Android system back button or back navigation swipe gesture is on different applications that have a bottom navigation bar or a top tab view? You can do what you like in #Flutter and otherwise too. I found 5 patterns: 🧵👇
1. BACK always pops entire app, regardless of where you are on bottom destination, examples:

- Philips Hue app @philipshuedev
- Dropbox (persists last used)
- MS apps, like Word, Excel, PPT

For me this is the worst pattern, more on why later.
2. BACK if not on 1st destination, go to 1st, then next back pops app:

- Twitter
- WhatsApp, uses a top tab view, you can swipe between them, a back swipe is different and that takes you to main chats tab if you are not on it, and next after that pops the app.

I'm OK with this.
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(