Showcaseview package highlighting CupertinoTabScaffold (used as BottomNavBar) [Flutter] - flutter

I am using showCaseView package and when I'm highlighting widgets, cupertinoTabScaffold is also highlighted. ShowCaseWidget wrapping MaterialApp widget so TabScaffold and all other widgets wrapped by ShowCase package. Has anyone encountered this, how to solve this issue?

I changed the color of CupertinoTabScaffold depending on whether "showCaseView" is active now, or not:
tabBar: CustomCupertinoTabBar(
backgroundColor:
Provider.of<NotifyShowcaseState>(context).isShowcaseActive //I've created ChangeNotifier class for updating state
? const Color(0x99BDBDBD) //dimmed grey if showCase is active
: null, //default white color, if showCase is inActive
....
),

Related

How can I disable background widgets in flutter

What I want to achieve is like when you use the alert dialog widget :
When the dialog box shows everything in the background is darkened and disabled. I want to do that but I don't want to use a dialogbox , I have a Container that slides from the bottom of the screen, it's inside a Stack widget.
How can I achieve this?
Wrap your widget with Scaffold and set the backgroundColor to
// change the color as you like
backgroundColor: Colors.black.withOpacity(0.3),

[ Flutter :: notched FloatingActionButton weird issue ]

Well this weird bug seems to have appeared when i recently updated flutter and dart sdk via my android studio IDE.
It worked like a charm before...
here what happens :
this is what is expected
this is what i can have before a rebuild sometimes there is no notch at all...
So, to put words on the problem, the first picture is what i got so far and what i expect to have...
but recently, i did upgrade flutter N dart via the command line and had to face this weird bug...
Depending on the device here what i have :
first build of the screen : incomplete notch margin or even none at all !
when i do interact with a button or whatever provoke a screen rebuild : the notch is good again !
For example, the 2 screenshots come from the exact same screen, nothing changed but an only checkbox checked forcing the screen to rebuild after dirty state...
The problem is that i can't see anything to do since the code is as simple as :
bottomNavigationBar: BottomAppBar(
shape: CircularNotchedRectangle(),
...
floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked,
floatingActionButton: SizedBox(
height: 85.0,
width: 85.0,
child: FittedBox(
child: FloatingActionButton(
So, is it a known Flutter bug and just have to wait for a bugFix ?
Or can i do something and, if so, what ?
Thanks in advance ! :)
I have the same issue trying to change the page with the navigator and rebuilding one page that has the same bottom app bar with this notch, I think that there is some bug between the fab notch and the navigator.
The workaround in my case is to keep the same route for all the pages and manage more pages changing the widget structure with the state, so if you have 3 pages with this notch you can keep the same page route and change one big sub-widget for each page changing, for example, a state variable that keeps the page like an int that encode one page with a specific number, and when you update this variable the interface rebuild changing this page widget.
This is my workaround, hope that this bug could be solved early but meanwhile this work.
Some images of the bug:
I have this rendering behavior after the first app start and after each rebuild on the same page, note that I have the fab notch in my homepage so at the first start the rendering is good:
I have this behavior after each change of route page with all the Navigator methods, even if in the page the bottom app bar has the same configuration and should render the notch:
If could help someone I recreate the navigator with an inherited widget and a stateful widget on top of the widget tree, this approach gets around the bug, here is my app implementation:
https://github.com/simone-viozzi/progetto-programmazione-mobile/tree/main/flutter_app

Change another widget with a checkbox Flutter

I'm new to Flutter and I found a pretty cool design of a todoapp on Dribble so I wanted to create the app.
Here's the design :
I wonder how with the my callBack Function of my CheckBox I could change the color of the text part of the tile to this blue.
My tile is currently a row containing a checkbox and a Container with the text in. So I would like to when i click on the checkbox, the background color of my container turns to blue.
I dont' have a any idea how to do that.
If you have some ideas please tell me.
Flutter apps work with app states, these states contain the information about the screens pushed by the app.
What you need to do is to update the state of your current widget, and change the values that set that background to X color.
Here you have multiple docs about state management: https://flutter.dev/docs/development/data-and-backend/state-mgmt/options, I really recommend for beginners to start with the setState method as is the easiest one.
Also, if you don't know how to manage states I will really recommend to follow the docs to understand how widget works and are build over flutter apps: https://flutter.dev/docs/development/ui/widgets-intro
Well, I just needded to put this in the color property of my container knowing that isChecked is true when my checkbox is clicked.
child: Container(
height: 50,
decoration: BoxDecoration(
borderRadius : BorderRadius.circular(15),
color: widget.isChecked ? Color(0xFF2765f9) : Color(0xFF292E3C),

MaterialApp ThemeData iconTheme

I have some ListTile widgets around my app, and all of them have an icon.
From here I see that I need to override my ListTile with
ListTileTheme(
iconColor: Colors.blue,
child: ..
)
since the ListTile.iconColor is gray by default and doesn't fallback to ThemeData.iconTheme.iconColor.
I wonder if there is a way to specify the list tile theme in ThemeData, so I don't have to create a new widget just for that.
For now, there isn't, but this feature may arrive in the next flutter release: https://github.com/flutter/flutter/issues/31247

What is the difference between Material and MaterialApp in Flutter?

I am developing an app using Flutter. If I choose MaterialApp as the parent widget of my app, all Text widgets in my app are underlined yellow. On the other hand, if I just use Material as the parent widget, no yellow lines are shown under the Text widgets.
What is the difference between Material and MaterialApp?
MaterialApp is a widget that introduces many interesting tools such as Navigator or Theme to help you develop your app.
Material is, on the other hand, a widget used to define a UI element respecting Material rules. It defines what elevation is, shape, and stuff. Then reused by many material widgets such as Appbar or Card or FloatingButton.
The yellow underlines you can find in Text is introduced by MaterialApp as a fallback Theme. It is here for debug purpose, to warn you that you need to use Material somewhere above your Text.
In short, use both. You should have a MaterialApp near the root of your app. And then use widgets that introduce a Material instance (Such a Scaffold, Appbar, Dialog, ...) when you want to use Text or InkWell.
MaterialApp : The MaterialApp configures the top-level Navigator to search for routes or to define Home.
Material : For child UI widgets rendering & effects.