How to Move bottomsheet along with keyboard which has textfield(autofocused is true)?

To fix this issue Add isScrollControlled = true to BottomSheetDialog it’ll allow the bottom sheet to take the full required height which gives more insurance that the keyboard does not cover TextField. Add Keyboard padding using MediaQuery.of(context).viewInsets.bottom Note If your BottomSheetModel is Column make sure you add mainAxisSize: MainAxisSize.min, otherwise the sheet will cover the … Read more

Flutter remove all routes

I was able to accomplish this with the following code: Navigator.of(context) .pushNamedAndRemoveUntil(‘/login’, (Route<dynamic> route) => false); The secret here is using a RoutePredicate that always returns false (Route<dynamic> route) => false. In this situation it removes all of the routes except for the new /login route I pushed.

How to change status bar color in Flutter?

Update Flutter 2.0 (Recommended): On latest Flutter version, you should use: AppBar( systemOverlayStyle: SystemUiOverlayStyle( // Status bar color statusBarColor: Colors.red, // Status bar brightness (optional) statusBarIconBrightness: Brightness.dark, // For Android (dark icons) statusBarBrightness: Brightness.light, // For iOS (dark icons) ), ) Only Android (more flexibility): import ‘package:flutter/services.dart’; void main() { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( systemNavigationBarColor: Colors.blue, // navigation … Read more

Force Flutter navigator to reload state when popping

There’s a couple of things you could do here. @Mahi’s answer while correct could be a little more succinct and actually use push rather than showDialog as the OP was asking about. This is an example that uses Navigator.push: import ‘package:flutter/material.dart’; class SecondPage extends StatelessWidget { @override Widget build(BuildContext context) { return Container( color: Colors.green, … Read more

How to make button width match parent?

Update: With Flutter 2.0 RaisedButton is deprecated and replaced by ElevatedButton. you can use minimumSize like this: ElevatedButton( style: ElevatedButton.styleFrom( minimumSize: Size.fromHeight(40), // fromHeight use double.infinity as width and 40 is the height ), onPressed: () {}, child: Text(‘Text Of Button’), ) Old answer for Flutter less than 2.0: The correct solution would be to … Read more

InkWell not showing ripple effect

I think adding color to the container is covering over the ink effect https://api.flutter.dev/flutter/material/InkWell/InkWell.html This code seems to work body: new Center( child: new Container( child: new Material( child: new InkWell( onTap: (){print(“tapped”);}, child: new Container( width: 100.0, height: 100.0, ), ), color: Colors.transparent, ), color: Colors.orange, ), ), just click the middle square. Edit: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)