how can I edit a flutter "barcode_scan 1.0.0" plugin - flutter

I'm using the "barcode_scan 1.0.0" plugin that is available in dartlang (this is the link: https://pub.dartlang.org/packages/barcode_scan). Now the question, I want to know if anyone knows how to edit the screen when the camera appears ready to read codes:
1) I need to add an appbar with a title.
2) I need to block the automatic screen rotation.
3) I would like you to read codes at 90 degrees. A red bar is also included but at 90 degrees.
I will thank you very much if you can guide me to solve the problem.
regards

You can't with that package because it won't provides you with a way to fit a reader widget in your widget tree (its just calling a native API).
Based on your requirements, you can use some of the other available packages with the same purpose. I can name you a few that support being placed on your widget tree:
fast_qr_reader_view
qr_mobile_vision
flutter_mobile_vision

Related

Can I build a Frontend in FlutterFlow then export to Flutter to finish coding?

I am learning flutter and dart at the moment. I came across FlutterFlow and I was wondering, could I use FlutterFlow to build the UI of the app, then turn around, take the code, and add it to my IDE and finish coding it with Flutter and dart there?
As I found, you can view the code of the UI and copy it from Developer Menu -> View Code as shown in the following image:
You will see the code with a copy button in the top right corner as shown in the following image:
Bounce:
When you click on a widget in the screen, it shows only the code of it to let you focus on its implementation.
Edit:
In the same developer menu, there is a Download Code button which allows you to download the source code of the application but it's not available in the Free Plan, Standard and Pro only.
Lastly: As a piece of personal advice, if you are learning Flutter, then stay away from tools like FlutterFlow until you reach a good level in Flutter Development, so these tools become just an acceleration for your work, not too highly dependent on them.
Yes, it's possible. You must either be using the "standard" plan to be able to export the source code of the app or, if you just need a tool to create the UI for a flutter app, you can then use the playground area of flutterflow to have access to the source code of that view.

What is LeftNav in material-ui?

I keep seeing references to a component called "LeftNav" in the material-ui react library (example: Material UI - Open LeftNav / Drawer on AppBar click), but I can't find anything about it in the documentation. What is it? How does it differ from Drawer? Why is it apparently undocumented, despite being hugely popular (at least judging by the number of questions I see about how to use it)? What is its toggle() method for, and is there a similar method for Drawer (the documentation suggests not, but for all I would know by reading the documentation there was no such component as LeftNav at all, so I don't think the documentation can really be trusted here)?
<LeftNav/> is the same as <Drawer/>. The name was changed from "LeftNav" to "Drawer" with the release of material-UI version 0.15. Take a look at the change log here and you will see this.

How to get the screen dimension of a eclipse view and IJavaElement

I writed an eclipse plugin that visualize some Java classes as UML in a view part. You choose a package in the Package Explorer and after rigth click on the package you can visualized it by clicking on a self created command menuitem in the menu. The visualization is created with the prefuse library.
My next goal was to make it possible to use it for multitouch. I use the Multitouch Library from PQLabs multitouch SDK. Now, on a multitouch screen, I can move my UML model, resize it etc.
But I was not able to get the informations from the Package Explorer. I tried to find out the location of the Package Explorer and IJavaElements on the screen but failed. My idea was to compare the x and y points from my finger (which I get from the PQL Labs SDK) with the x and y coordinates from the IJavaElements. I failed from the start, I could not be able that a touch point recognizes if it is in the border of the Package Explorer view or not. The only thing I got was the bounds of the whole Display. I searched the internet and stackoverflow but did not find something that was useful.
I do not know if it is possible or not but I will appreciate when somebody can give me information or directed me to good links.
I don't know much about the Package Explorer, but with the Project Explorer (Common Navigator) (which you should also address), there is a TreeViewer associated with it (in this case the class is CommonViewer). You can get that by doing CommonNavigator.getCommonViewer(). Once you have the TreeViewer, you can then get to the underlying SWT Tree and from there use the standard SWT methods to get the position of the tree relative to the enclosing window. There are also methods where you can get the bounds of a tree cell. Have a look at the SWT Snippets (Google it) to help you work with the Tree.
For the Package Explorer it will be similar; you will have to look at the source code.
As described in Francis' answer you should be able to get the TreeViewer, and TreeViewer#getControl() would provide the underlying control.
When you fetch the position and size of a control via control.getBounds(), those would be relative to the coordinates of the shell/window. If you need the absolute display/screen coordinates, see control.toDisplay(some_x, some_y)
I want to share my steps on how I solved my problem. After the advices I digged deeper into the jdt Java infrastructure of the Java IDE. To get the TreeViewer of the Package Explorer I had to cast the "PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.jdt.ui.PackageExplorer")" into a "PackageExplorerPart" which is in the "org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart". The further steps I did were:
treeViewer = packageExplorerPart.getTreeViewer();
tree = (Tree) treeViewer.getControl();
After that I created a "Point" with the coordinates x and y, which were passed by touching the screen. But, the point location were representing the whole screen and to get the correct coordinates for the Package Explorer I converted the point with the method tree.toControl(...). At last, I checked if an item was given with method tree.getItem(....).

where's the code for Calculator showcase?

Where can I see the code for the calculator? I mean the one with fancy background? By the way, it looks very nice!!
In general, I could not find enough material for custom-made decoration, by searching the documents. Please let me know where I can learn deeper about rendering and widget decoration.
Thanks in advance :)
You can find the source code of the calculator page in the qooxdoo SDK under
qooxdoo/application/showcase/source/class/showcase/page/theme/calc/
There is also a standalone version of the calculator on github. You can find more information about theming in the qooxdoo manual:
Theming
Appearance
Custom Themes
Decorators

How to use GdkPixBuf?

I want to display a simple GIF image in a VBox using GTK+ from C. I know that I need to use a GdkPixbuf. But as usual there are no example of doing it. Can anyone provide help?
Also: In GTK+ how can we add a PNG image as background to a widget? Can anyone provide an example?
Forgot something to add this:
forgot to tell u that i am using Glade to develop GUI...
And i have created vBox in Glade and in one of the blocks of the vBox i need to display FIG Image....
Sorry of this...
gdk_pixbuf_new_from_file() -- but see unwind's answer for a better way to do it using a GtkImage widget.
You need to set the background pixmap field in the widget's style structure:
GtkRcStyle *newstyle = gtk_widget_get_modifier_style(widget);
newstyle->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup(pngfilename);
gtk_widget_modify_style(widget, newstyle);
PS. You can often find code examples by doing a Google search for the function you need an example of. The GTK docs usually don't contain examples for every single function, because that would clutter them up, and the documentation of functions like gdk_pixbuf_new_from_file() is usually pretty straightforward. I've noticed you often post this kind of question and I'm wondering if you are looking for the documentation in the right place. For example, are you using the excellent reference tool DevHelp? On the other hand, the GTK documentation is really missing some important information in a few places. If you have some improvements, why not contribute to the documentation?
A vbox in GTK+ is a widget, that displays other widgets as its children, stacking them vertically.
Unsurprisingly, there is a GTK+ widget dedicated to displaying images; it's called GtkImage. You should use the gtk_image_new_from_file() call to create one, passing it your GIF filename, and then just add that to your vbox. There's no need to create the underlying GDK image yourself.