I wanted to know which is the most powerful between a flutter button and a homemade button and the inconvenience of a homemade button?
For exemple, flutter buttons: ElevatedButton, TextButton, OutlinedButton
And an exemple of a homemade button:
Container(
child: GestureDetector(
onTap: () {},
child: Text('click'),
),
)
You should decide to use a button depending on the type of work you want to do
onstream Gesture Detector has a lot property for each type of touch and press and Text Button Icon Button Outlined Button Elevated Button and other provided buttons not has a lot touch property BUT has somw animation and simple to use for new comers in flutter
Related
I'm trying to implement a function that will be called when user press back button.
Working exactly how i expect in UWP, but the issue is with android.
In android I got two back button,
One at top Navigation (Let's call it navbackbutton ), and other we get at bottom, the three android button "background apps,Home and back button(android backbutton),
Android back button is firing onBackpressed override method but navbackbutton is not, it is just taking me to the previous page.
I dont understand why it is happening and how to fix it.
Page.OnBackButtonPressed is only triggered with the hardware back button on Android .
You can override OnOptionsItemSelected within MainActivity to hook the navigation back button event , refer to here .
Another way is that customize NavigationPage.TitleView(a layout with a back button and title label) to replace the default navigation bar and then you can get the back button event .
I have turn my oracle apex web application to mobile. I am facing an issue with apex header over lapsing the mobile phone header.
i thought that i can change the header and the body top position with CSS. but when i did that , when user scroll we can see region going up (see picture 2)
Any help how to solve this?
Thanks
I wrapped my web url inside flutter webview to make it accessible on playstore.
Apex is not really a native mobile app so the issue was the apex application navigation bar was overlapsing the mobile phone navbar.
Solution
i just have to add an appbar within the wrapper.
return new MaterialApp(
home: new WebviewScaffold(url: 'https://www.your_apex_app_url.com',
appBar: PreferredSize(
preferredSize: Size.fromHeight(1.0),
child: AppBar(
automaticallyImplyLeading: false,
),
),
Thanks.
I have an image saved in a dedicated directory in my flutter project. The entire directory is included as asset in pubspec.yaml, the code where it is shown is this:
Drawer(
child: ListView(
children: <Widget>[
Image(image: AssetImage('immagini/liberty_square.jpg')),
SizedBox(height: 4),
ListTile(
// contents
),
// etc...
],
),
);
Drawer is located in a StatefulWidget. The image weighs about 2MB. It's a photo of a square in a town. I haven't used DrawerHeader to avoid paddings and margins.
In the android simulator (android studio), the image is loaded immediately as I open the Drawer, instead in my two real devices I have problems.
At app start I open the Drawer, but I can't see the image. Sometimes I have to wait some seconds to see the image, but other times I have to close and re-open the Drawer many times to see the image.
This happens both in test mode (android studio) and in production mode (apk installed and opened, without a pc).
I have thought to pre-load, but the image is an asset, not downloaded from network.
Try using precached image to load the image before the drawer is built.
Go to the widget that contains your drawer and add this to your initState:
precacheImage(new AssetImage('immagini/liberty_square.jpg'));
Then just call your image the same way you do now.
I am using xamarin.forms button control. I have set the background image to that button using custom renderer for android. I need to show the down state of the button if I click on the button. How can I do this?
I am trying to add a custom button in the new Xcode 4 Interface Builder. In the old one with Xcode 3, you could just drag in any of the button types, change their style to custom, and add in your own image to make a custom button. Now it seems the "custom" style is missing, and when the image is changed, it is just overlaid on one of the other button types. How can I add custom buttons now?
EDIT: I see that the custom button option exists on the iOS Xcode 4 still, but it seems to now be gone for a OSX Cocoa application. Why is this and how can I recreate this funcionality?
I found that you can recreate the custom button by making a button with Style: Square, Type: Switch, Visual: Bordered and Transparent unchecked, and then add your own image in the Image box.