Bad: flutter Math Confusion - dart

I create a widget that contains a Drawer but I can't use it, I get this error.
i get this error in use the drawer widget
The code of drawer widget

Actually the error you provide us has noting to do with drawer widget, this error is produced from Image Widget, so I do recommend checking your Image.network() widget, I think the path you provide is not acceptable, maybe you should use Image.asset()

Related

Is it possible to create a collapsible sidebar with Kivy and/or KivyMD?

I'm working on a project for the GUI of an app written in Python that requires a collapsible sidebar like this one:
https://www.youtube.com/watch?v=-vQIcBKdhyk&t=9s
I already created a good portion of the GUI in Kivy and KivyMD. Applied also the Navigation Drawer that works as expected. However, it is fully retracted when not active, so not exactly what was asked.
Anyone managed to create something like this?
Thank you all in advance
Using Navigation Drawer component in KivyMD, it was possible to create something almost as required. Yet, there is no partial view (with little icons that would expand when the drawer were toggled).

How to add Buttons to a iOS 14 Widget

I'm trying to add buttons to a widget having family type ".systemLarge". I want to execute some code without opening the app.
Anyone knows how to do that?
For example the Shortcuts App Widget includes buttons you can tap to execute a shortcut without opening the app.
Widgets are read only. The Shortcuts app is an exception.
https://developer.apple.com/documentation/widgetkit/creating-a-widget-extension
Widgets present read-only information and don’t support interactive elements such as scrolling elements or switches. WidgetKit omits interactive elements when rendering a widget’s content.
You can add Link controls on medium and large size widgets to get a button like behavior.
This won't allow you to create interactive widgets, which change their content by clicking elements inside the widgets.
But you will be able to tell which "link" was clicked based on the widgetUrl provided when your app gets activated through the widget.
See the chapter Respond to User Interactions here:
https://developer.apple.com/documentation/widgetkit/creating-a-widget-extension

Flutter Vertical Drawer

I'm new to flutter, and after doing some searching, can't find a widget similar to the Drawer for the top of the page coming down, instead of the left or right side of the page coming out. Is there such a widget or a way to create one?
Not an easy task, but Flutter is open source. You can create your own version of Scaffold and Drawer with a vertical orientation. Just copy and modify the source code.
As of this date the Drawer widget doesn't support this, and there is no 'Vertical Drawer' widget in the Flutter widget catalog.
Thankfully, Akshath Jain created a nice SlidingUpPanel widget which does the trick nicely. For my use case I just needed it to slide from the bottom. I haven't tested it myself, but there is a slideDirection property which you can set to SlideDirection.DOWN and it should do what you're asking for.

Access Flutter route outside MaterialApp

I have a "fixed" custom app bar Widget that sits outside my Material App. I want this app bar to constantly sit at the top and the Widget views to change.
I would like this app bar widget to be able to listen to the routes being updated in the MaterialApp and react accordingly.
I think I need to use a RouteObserver but am struggling to have this app bar subscribe to any route events. I have tried broadcasting a stream to notify any widgets listening to it but this fires from the initState lifecycle hook so only is fired once and not received when calling Navigator.pop()
I have tried this https://docs.flutter.io/flutter/widgets/RouteObserver-class.html.
Any ideas on how this can be achieved?
I'm not sure if this is the correct way of handling the Route outside MaterialApp but this is how I have solved the problem.
I moved to use the Fluro navigator https://github.com/goposse/fluro which has given me a nicer route framework to use.
I now have a Static method that handles the Fluro route as well as broadcasting a view change Stream event to any components listening for my new Application.doRoute(context, path).
Inside the Application.doRoute(..) I add to my own custom _history List which has a context and path for each new Route. I can then call another static function called Application.doBack() which then pops the last item in the _history and broadcasts the view change Stream again.
I now can have root display list level Widgets react to changes within the MaterialApp.
Navigator.pushNamed and Navigator.pop() have now been replaced with Application.doRoute() and Application.goBack()

Mozilla "Jetpack" Add-On: Anchor Panel to Widget

I'm making a Jetpack extension in which a widget opens a panel. Clicking the widget opens the panel as expected (anchored in the lower-right corner to the widget). But if I call widget.panel.show() from my code, the panel opens detached from the widget, centered in the screen, floating in space.
In short, how can I fix this?
Can I simulate a click event on the widget (somehow) instead of calling widget.panel.show()?
Can I force the panel to anchor to the widget?
This question has a solution that worked in the previous Jetpack API, but I can't translate to the new interface:
Using positioning 'Panel' in new Jetpack API
panel.show(require("tab-browser").activeTab.ownerDocument.getElementById('widget:yourAddonId#package.json-yourWidgetId'));
Works for me with Addon SDK 1.8.1
Where:
yourAddonId#package.json - your addon id from package.json
yourWidgetId - your widget id
panel.show(widget)
isn't working?

Resources