Comments (6)
Ok, thanks!
I think there might be something I misunderstand about this package, or the flutter sdk. It just creates a more customised ThemeData at the end of the day, right?
But then it confuses me why a border: InputBorder.none
on the InputDecoration
doesn't work. Is that just part of the flutter sdk, that if InputDecorationTheme
has a border, InputBorder.none
no longer works?
from flex_color_scheme.
Hi @hamishjohnson, thanks for the issue report.
It is a correct observation, to not have any border when an input is focused is something the current does not include.
Also changing border width to 0 does not help because of how the Flutter framework handles border width 0, which actually draws a border with physical pixel 1, when you set it to 0.
Funky right :)
For the existing unfocused border case, it is handled as a separate case to just not include any border in theme when the flag is set. But alas there is no, noFocusedBorder
flag or case in FCS's current features.
Your timing is actually very good, since I am in the process of adding better M3 support and more features for FCS to the InputDecoratorTheme
. I had not actually thought about this particular theming use-case, but it makes perfect sense to add it as well.
In FlexColorScheme docs I mention that its intention is not to offer everything you can do with ThemeData
and its component sub-themes. The intent is to make common use cases quicker and easier to configure, and on the color themes side to also do things the framework simply cannot do out of the box.
That being said, configuring the InputDecorationTheme
is silly complex and tedious and including this makes sense while anyway reworking it.
Meanwhile, if you urgently need themed support for this, you can always amend and modify the ThemeData
that FlexColorScheme outputs to do it already now using copyWith
on the ThemeData
and the InputDecorationTheme
it produces.
If you are not familiar with this, there are a few related examples in the discussion, for example this one #92
In any case, thanks bringing up this feature gap and need. I plan to land support for this in next feature release that will be out shortly after Flutter Forward on Jan 25th. Might be a few days later since I will actually be physically at the event in Nairobi 😄
from flex_color_scheme.
Just to be clear @hamishjohnson, as soon as you make a global InputDecorationTheme
theme in ThemeData
that has a border, also a TextField
using InputDecoration.collapsed
will have same borders.
If you want borders otherwise on regular text fields, as a part of the theme, but automatically not when using InputDecoration.collapsed
that is not possible. You will have to wrap the part of your tree / widget, where you are using InputDecoration.collapsed
with an InputDecorationTheme
that does not include any borders.
What the new feature I'm adding will do, is let you create a global InputDecorationTheme
without any borders.
from flex_color_scheme.
There is a separate input border property for every state (enabled, focused, hover, error, focusedError, disabled) in InputDecoration, and the theme uses them all, it does not even use border at all if I recall correctly. To get rid of it, and override what the theme has defined you need to set InputBorder.none on all of them on widget level.
The InputDecorator has a bit mixed bag legacy API. It uses MaterialState property for newer parts, but older parts still sport the old style with a property per state.
I actually tried to get it to work by using only border and MaterialState, in the theme in my new wip version, it should work, but it did not work correctly. So I had to revert and still use all the individual properties. I made a note to revisit it later and make an issue report of it, if I can repeat and demonstrate the problem in isolation.
TextField and InputDecoration is quite involved and tricky. The Flutter code behind them is quite fascinating and really deep rabbit holes to study 😀
from flex_color_scheme.
Still same milestone target, but the release will be called 7.0.0, since I am introducing a few minor default style breaking changes. There are no breaking API changes though. There is a beta of it available on pub if you are feeling experimental, it includes this new property.
https://pub.dev/packages/flex_color_scheme/versions/7.0.0-dev.2
from flex_color_scheme.
Final beta of version 7 is out. There will be no additional features or API changes in the stable release. More info in this tweet thread:
https://twitter.com/RydMike/status/1637228788139302914?s=20
Feel free to try it.
Closing this feature request as delivered in version7 final beta. Well to the degree it can be supported by current InputDecorator
theme in Flutter anyway.
from flex_color_scheme.
Related Issues (20)
- Provides copywith for FlexScheme HOT 2
- Provides parameters to make the android status bar transparent HOT 1
- Can't copy all theme values from themeColors in themesplayground? This was possible before, and it worked HOT 4
- Add enhanced enum functions to `FlexScheme` to get its associated data and colors
- Building on M1 causes error HOT 2
- How to set status bar icon black ? HOT 2
- Define card shape in FCS? HOT 2
- Error: Type argument 'double' doesn't conform to the bound 'Enum?' of the type variable 'T' on 'EnumProperty'. HOT 4
- How to set a new scaffold background color with opacity HOT 1
- NavigationDrawerDestination items do not follow theme background HOT 3
- How to set tab bar indicator color at Material App theme level? HOT 1
- The example should be updated when PersistentBottomSheetController's type param has been removed HOT 2
- Add examples of Card.outlined and Card.filled in Playground HOT 3
- useMaterial3: true, doesn't work for dialogs HOT 4
- Theme for Vision Pro
- Google Fonts nit HOT 3
- Support tone-based surface and surface container ColorScheme roles HOT 1
- Using FlexColorScheme themedSystemNavigationBar I can set the system navigation bar styles, but unable to set the style of the status bar at the same time after use HOT 1
- Incomplete Theme Playground "Hot Reload Playground"
- Lack of inputDecoratorSuffixIconSchemeColor properties HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flex_color_scheme.