Comments (11)
BackdropNavigationBackLayer
in my opinion is just a simple drop in to do "navigation" with backdrop.
I recommend you simply use ListView
with backLayer
and build from there.
BackdropNavigationBackLayer
is simply the following:
@override
Widget build(BuildContext context) {
return ListView.separated(
shrinkWrap: true,
itemCount: items.length,
itemBuilder: (context, position) => InkWell(
child: items[position],
onTap: () {
// fling backdrop
Backdrop.of(context).fling();
// call onTap function and pass new selected index
onTap?.call(position);
},
),
separatorBuilder:
separatorBuilder ?? (builder, position) => separator ?? Container(),
);
}
Similarly other widgets like BackdropToggleButton
, BackdropSubHeader
, etc in this package (except Backdrop
and BackdropScaffold
) are just drop in for simple use (or reference) cases.
from backdrop.
Ok then.
@proninyaroslav Can you file PR for customising InkWell
options in BackdropNavigationBackLayer
?
from backdrop.
@proninyaroslav you are right, thanks for pointing this out!
The current implementation is ready, you can see it here proninyaroslav@f5da2da
If you want, create a pull request. But why do you add a Padding
of 8.0 around BackdropNavigationBackLayer
? I think we could not take this as general solution because someone might not want any padding and wouldn't be able to remove it then...
I suggest to expose not only customInkWellBorder
as an attribute of BackdropNavigationBackLayer
but expose all properties of the used InkWell
and prefix them with "item". Like customBorder
-> itemCustomBorder
(please rename it like this), splashColor
-> itemSplashColor
, borderRadius
-> itemBorderRadius
etc.
I don't know whether events like onLongPress
etc. should also be exposed, but I think yes. What do you think @daadu @proninyaroslav?
from backdrop.
If you want, create a pull request. But why do you add a Padding of 8.0 around BackdropNavigationBackLayer?
This is a demo app, not a widget. Just to make it look better with rounded corners. I can delete it that if necessary.
I suggest to expose not only customInkWellBorder as an attribute of BackdropNavigationBackLayer but expose all properties of the used InkWell and prefix them with "item". Like customBorder -> itemCustomBorder (please rename it like this), splashColor -> itemSplashColor, borderRadius -> itemBorderRadius etc.
Yes, I think this is the best solution.
from backdrop.
Ok, so if @daadu agrees on this I will make the changes and create a pull request.
from backdrop.
As far as demo is concerned, setting proper property of theme with ThemeData.splashColor
would do the job
from backdrop.
@daadu
You're right, but using BackdropNavigationBackLayer
, we assume that we can pass any widget there with our own style. But because InkWell
is the parent for these widgets, we cannot customize the style of the ink splash.
In this case:
- It would be possible to simplify the widget by passing only text strings and icons there, not widgets, so as not to be misleading.
- It's also possible to pass exclusively
ListTile
widgets, then there is no need to useInkWell
, at the same time we allow to make the items fully customizable. - It might not make sense to expose all the properties of
InkWell
, but only those that have a basic purpose for customizing an ink splash. And the border is one of them.
from backdrop.
Sorry for responding late @proninyaroslav.
@WieFel What are your views?
from backdrop.
1. It would be possible to simplify the widget by passing only text strings and icons there, not widgets, so as not to be misleading.
The widget still has to be customizable. Only allowing to pass text and icon would not suffice, in my opinion.
2. It's also possible to pass exclusively `ListTile` widgets, then there is no need to use `InkWell`, at the same time we allow to make the items fully customizable.
The ListView
that encloses the list still has to manage the navigation's onTap
and the ripple effect when tapping the list's elements. Therefore, the InkWell
is needed.
3. It might not make sense to expose all the properties of `InkWell`, but only those that have a basic purpose for customizing an ink splash. And the border is one of them.
You are right. Maybe we start with exposing only properties necessary for customizing the splash effect
@daadu you are right with saying "BackdropNavigationBackLayer is just a simple drop in". Therefore we should add not too much functionality to it. But I think allowing to customize the InkWell
splash can be added...
from backdrop.
@daadu @proninyaroslav I will create the pull request, as I personally need the features as well asap.
from backdrop.
This feature has landed with v0.4.7
on pub.dev.
from backdrop.
Related Issues (20)
- Merge example and demo project HOT 5
- Abstract out "backdrop core" from `BackdropScaffold`
- Add a shadow to the front layer
- Custom shape on the front layer HOT 7
- How to show back layer without scrim on front? HOT 5
- Slivers AppBar HOT 7
- cannot paste if backdrop is revealed HOT 6
- I can't get edge swipe to go back to work with BackdropScaffold. Any helpful tips? HOT 1
- flutter beta: SchedulerBinding is now null-safe HOT 2
- BoxShadow on front layer HOT 3
- Backdrop is not compiling after upgrading to Flutter 3.10 HOT 2
- En Flutter 3.10 no compila Por 2 Lineas en el Widget AppBar (brightness y textTheme), las cuales estan en desuso pero el compilador las toma en cuenta, eliminando esas 2 lines el paquete funciona perfectamente HOT 3
- Variable to know if back layer is expanded or collapsed HOT 1
- Manually opening Backdrop HOT 9
- Pressing Back button cause visible frontLayer HOT 10
- Reveal backlayer with natural gestures HOT 1
- Make a parameter out of front layer elevation HOT 6
- BackdropScaffold usage gif example needs an update! HOT 1
- Avoid SubHeader spawn on top of Front Layer HOT 2
- Use AppBar.SystemOverlayStyle instead of AppBar.Brightness HOT 2
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 backdrop.