Custom Appbar's animation Flutter - flutter-layout

I want to make app bar with animation like this. Any ideas?
GIF

You can use SliverAppBar For the animation you want to create,
SliverAppBar(
expandedHeight: height,
flexibleSpace: const FlexibleSpaceBar(
title: Text('Reading Now'),
),
For more details you can visit here

Related

SwiftUI SVG in TabBar

Now that SwiftUI can use SVG images directly, I have tried to use a set of SVG files as icons for a TabBar. Using typical TabBar code:
TabView(selection: $lastTab){
VendorView()
.tabItem {
Image ("store")
.renderingMode(.template)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 25.0, height: 25.0)
Text("Vendor")
}
.tag(0)
...
Unfortunately this does not seem to work as the SVG image is never resized to the requested 25x25 size.
Has anyone else experienced this and if so, any workarounds?
The best way to handle the issue of SVGs in the TabView as an Image() is to do the following steps:
resize your SVG in Sketch/Figma or other program to 22x22 / 24x24...
Bring said resized SVG to assets and in your Inspector select:
Render as: Template Image
Resizing: Preserve vector data
Scales: Single Scale
No need to use .resizable() nor .frame()
I have learnt new tips and original answer by: Mark Moeykens
https://stackoverflow.com/a/37627080/15382735

Direcline bot channel - How to change the botAvatarImage image background and initial background color

Is there any styling options available to change the background-color of botAvatarImage / botAvatarInitials which we are using in our Directline bot channel. ?
Also, i need to remove the borders for the botAvatarImage.
Please guide me.
Yes, there is one option to change the background.
styleOptions: {
botAvatarBackgroundColor: "transparent",
botAvatarImage: 'YOUR URL',
}
I don't think it has a border by default but you could try override the css with these classess
.webchat__defaultAvatar .webchat__imageAvatar__image
You could find the entire list of style options in here defaultStyleOptions.js

How to get rounded corners on an Electron app?

I am currently trying to get rounded corners on an Electron application I'm making. I have tried nearly every solution available on-line at the moment, but none of them make any difference.
How can I round the corners of my Electron app?
Make a frameless transparent window
const myWindow = new BrowserWindow({
transparent: true,
frame: false
})
And have something like this in the renderer, or apply the style directly to the body tag
<div style="width: 500px; height: 500px; border-radius: 5px">My window content</div>
Just make sure to also add a custom window titlebar that has -webkit-app-region: dragin order to make the window dragable from this element.
Check out the Electron Docs for further informations ;)
https://github.com/electron/electron/blob/master/docs/api/frameless-window.md#transparent-window

fabricjs call to canvas.toDataURL() resizes the dimensions of the canvas

I'm using fabricjs 1.7.17 and have seen this issue below on IE Edge, Chrome and Firefox.
where the canvas is being set with a width and height in HTML of 768px.
Within my fabricjs canvas init I've got:
editor.canvas = new fabric.Canvas('editor')
editor.canvas.setDimensions({
width: 1080,
height: 1080,
allowTouchScrolling: false,
backgroundColor: 'rgba(55, 55, 55, .33)',
rotationCursor: 'url(/static/img/rotate.cur) 10 10, crosshair'
}, {backstoreOnly: true})
The problem is when you call the editor.canvas.toDataURL() method the size of the goes from 768px to 1080px
If you call the browser's native canvas.toDataURL() method there isn't a jump in size.
Anyone bump into this and have a possible fix?
Here's a simplified jsfiddle:
https://jsfiddle.net/m8dhmbtu/23/
Click on the "Native Canvas.toDataURL()" and you'll get the results to console.log and there will be no change to the displayed canvas in the preview window.
Click on the "Fabricjs canvas.toDataURL()" and you'll also get the results (the same) to console.log however; you'll also get a jump in the size of the in the preview window...this is what I'm trying to prevent.
I think the problem is actually a bug.
You set the canvas to 1080 for backstore dimension only, meaning that the canvas will be sized but the css will be left untouched.
A dataurl will reset the canvas after the process to fix it back in case the export to data url had a multiplier.
while this can be fixed at least for the non multiplied situations, a proper fix is needed.
The proper fix consist in setting backstore only during export so that the css does not get touched.
A better fix would be to do not touch the original canvas and create one on the fly just for exporting.
please go on official fabricjs repository and open an issue for this.

how to built 300px sidebar with html content and inject into current page in chrome extension

I would like my Chrome extension to be able to inject a 300px sidebar along with data on the right side of any page when it is activated. I am looking for the best way to build the sidebar along with its HTML content.
I am able to do some small changes to the current page using contentscript.js file, but I don't know how to build entire HTML content and display it as a sidebar.
I built the sidebar using the following code in the content script file:
sidebar = $("<div id='sidebar'></div>");
sidebar.css({
'position': 'fixed',
'right': '0px',
'top': '0px',
'z-index': 9999,
'width': '290px',
'height': '100%',
'background-color': 'blue' // Confirm it shows up
});
$('body').append(sidebar);
Now my question is how to build the HTML content for that sidebar?
You can inject a Javascript code that create a bar Example this developer "Proper Menubar" creates this. With a click it enable/disable the menubar on the top of Google website.
https://chrome.google.com/webstore/detail/proper-menubar/egclcjdpndeoioimlbbbmdhcaopnedkp

Resources