I'm new to flutter and I want to make an application like WhatsApp
I decided to know design dimensions and I went to
I found the dimensions in dps when I applied the stated dimensions on the app bar this was the result while this is the original app bar, so how can I apply material design dimensions (dps, px, etc...) in Flutter
All material design widgets in Flutter satisfies material design guidelines by default. For example a Floating action button comes with a default marigin witch you don't need to specify manually. So you don't need to provide custom padding or marigin to your appbar action items.
You can wrap any widget in a Container. Than you can set width and height if it has none.
A lot of widgets do have it though.
For example, IconButton that you can put in actions of AppBar has iconSize
IconButton(iconSize: 36.0,icon: Icon(Icons.search,));
But if you want asymmetrical touch field you can combine few widgets together
InkWell(
child: new Container(
width: 36.0,
height: 24.0,
child: Icon(
Icons.search,
),
));
There are many combinations available, so its best to ask specific question for a specific component.
Related
I've created a Star Rating component for use in feedback screens and views. Please check the Stackblitz URL that I've given here. I've put in some more notes in there.
https://stackblitz.com/edit/angular-ivy-4fnkj1?file=src/app/app.component.ts
I'm not very knowledgeable on SVG scaling and deep nest styling of Angular. I want to basically create a reusable StarRating component that can be used in several places but what basically changes is the size of the component (the size of the stars).
Let's say that I have a feedback form wherein I want the user to be able to choose rating by clicking on the stars. In this case, I want the stars to be large. At the same time I have a different component listing all reviews in which I want to show rating using this same component like maybe below the review comment.
Or in the other cases, I want the stars to resize based on different screen sizes.
Right now the size is fixed because I have it hard-coded in the HTML template. How do I make it dynamic
I'm using Angular v10.2.4 along with some Bootstrap styles.
I am working with WidgetKit and I found that the text component initialised with init(Date, style: Text.DateStyle) is creating automatically updating texts. This is something special because iOS widgets usually require to set a timeline about when to update the view. Unfortunately scheduling these updates is in the hands of the operating system, bases on a limited budget and thus, is unreliable.
Do you know about other SwiftUI views, that are automatically updating (and might also be passively updating in a widget)? Animated shapes would also be nice to have.
I have already tried using publishing timers, which won't work in widgets.
According to Apple's documentation, the only self-updating SwiftUI view is Text, configured to display a relative date or time. See Displaying Dynamic Dates in Widgets for details.
The options are:
Text(futureDate, style: .relative)
Text(futureDate, style: .offset)
Text(futureDate, style: .timer)
Text(aprilFirstDate, style: .date)
Text("Date: \(aprilFirstDate, style: .date)")
Text(startDate ... endDate)
Text("The meeting will take place: \(startDate ... endDate)")
When I started my first flutter web business application my goal was to place the MaterialApp navigator just inside the place where I want all pages to be loaded. Therefore I used the MaterialApp builder to accomplish that. This builder gives me the context and navigator and I can return the widget tree I desire.
Everything was great, I created and returned a widget tree that looked like the code below:
Scaffold(
appBar: MyAppBar(),
body: Row(children: [
MySideBar(),
Expanded(
child: navigatorFromTheMaterialAppBuider,
),
]),
)
By doing this way I have a fixed sidebar and appbar, and all pages are loaded without any rebuild on the fixed part.
The problem began when I needed to place some widgets that depends on the Overlay class inside my sidebar. Because sidebar is outside the MaterialApp navigator an overlay can't be found. Another side effect of doing this kind of layout was that any widget placed inside my pages and therefore inside the navigator displayed its overlay entries with the exact offset of the sidebar width and appbar height.
To avoid change that layout structure and make appbar and sidebar part of every page of my web application, I'd like to know if there is a way of placing an Overlay above the navigator (or even above the MaterialApp widget) that can override the MaterialApp navigator overlay for the entire tree of widgets.
I created a dartpad sample code to make it clearer.
https://dartpad.dev/140e1e8a9ca0620301b43d0313e20bdb
I have a screen in my react-native app where I am showing details of a record. It's a pretty simple screen where on the left column, I have a label describing the item and on the right, I have the value of the item. For one of the values, I have to render a ListView and I am not able to properly align it. Below is the sample app on rnplay with the symptoms:
Sample app on rnplay
Please run on iOS. Here ComponentListView is a reusable component that I am using to render ListView and it takes a component and data as it props and render each entry in the data using the passed in component. Here the list is BackupList and the component to render in each row is BackupSummary. If you run the app, you will observe that the backups are not aligned properly. I ran it in the Inspector on the simulator and looks like the ListView starts from where Varun Accepted is seen. I am not sure why. Right now there is just one item in the this.props.backupContacts but there could be more. I have tried many different flexbox properties such as alignItems, justifyContent, alignSelf in order to get it to work with no success.
Please let me know if you know how to fix it.
Put your ListView inside a View and apply css on View, something like this
<View style={{display:'flex', flexDirection:'row', justifyContent:'center'}}>
<ListView/>
</View>
I saw the example where it was described how to create with FontImage a material design 'like' image; something like:
FontImage img = FontImage.createMaterial(FontImage.MATERIAL_THUMB_UP, style);
But i am in the CodeName One designer and i am trying to give such icon style to a simple button and i dont the way to do it.
Any hint?
We won't introduce the material design icon font to the old GUI builder as we are in the process of moving to a new rewrite of the GUI builder: https://www.codenameone.com/blog/gui-builder-walkthru.html
Currently we don't have material design icons there either so I've added an RFE for that, thanks for the idea.
Notice that you can set the icon by code which is probably not what you are asking. Just use the beforeShow callback and set the icon on the component.