dart

How do I rotate something 15 degrees in Flutter?

こ雲淡風輕ζ 提交于 2021-02-05 20:13:56
问题 The Flutter docs show an example of rotating a "div" by 15 degrees, both for HTML/CSS and Flutter code: The Flutter code is: var container = new Container( // gray box child: new Center( child: new Transform( child: new Text( "Lorem ipsum", ), alignment: FractionalOffset.center, transform: new Matrix4.identity() ..rotateZ(15 * 3.1415927 / 180), ), ), ); And the relevant parts are new Transform and alignment: FractionalOffset.center and transform: new Matrix4.identity()..rotateZ(15 * 3.1415927

How to make flutter app draw behind android navigation bar and make navigation bar fully transparent?

故事扮演 提交于 2021-02-05 19:14:07
问题 I would like to make my Flutter app take up the entire screen in Android while still showing both the status bar and the navigation bar, with both of them transparent, to achieve the full screen look like in iOS. The status bar color can be easily changed, but right now I'm facing problems with getting the app to fill up the screen and making the navigation bar transparent at the same time. By default, the app is not drawn below the navigation bar at all (I've set the status bar color to be

How to make flutter app draw behind android navigation bar and make navigation bar fully transparent?

只谈情不闲聊 提交于 2021-02-05 19:07:18
问题 I would like to make my Flutter app take up the entire screen in Android while still showing both the status bar and the navigation bar, with both of them transparent, to achieve the full screen look like in iOS. The status bar color can be easily changed, but right now I'm facing problems with getting the app to fill up the screen and making the navigation bar transparent at the same time. By default, the app is not drawn below the navigation bar at all (I've set the status bar color to be

Inkwell not showing ripple when used with Container decoration

拥有回忆 提交于 2021-02-05 14:55:25
问题 I want to add a ripple on an item, it is working fine until I add a gradient on the item using BoxDecoration . Widget build(BuildContext context) { return Container( margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), child: Material( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)), elevation: 6.0, shadowColor: Colors.grey[50], child: InkWell( onTap: () {}, child: Container( decoration: BoxDecoration( gradient: LinearGradient( begin: AlignmentDirectional

Inkwell not showing ripple when used with Container decoration

北城以北 提交于 2021-02-05 14:55:14
问题 I want to add a ripple on an item, it is working fine until I add a gradient on the item using BoxDecoration . Widget build(BuildContext context) { return Container( margin: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0), child: Material( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4.0)), elevation: 6.0, shadowColor: Colors.grey[50], child: InkWell( onTap: () {}, child: Container( decoration: BoxDecoration( gradient: LinearGradient( begin: AlignmentDirectional

How to show/hide password in TextFormField?

六眼飞鱼酱① 提交于 2021-02-05 14:22:58
问题 Currently I have my password TextFormField like this: TextFormField( decoration: const InputDecoration( labelText: 'Password', icon: const Padding( padding: const EdgeInsets.only(top: 15.0), child: const Icon(Icons.lock), )), validator: (val) => val.length < 6 ? 'Password too short.' : null, onSaved: (val) => _password = val, obscureText: true, ); I want a button like interaction which will make password visible and invisible. Can I do it inside TextFormField ? Or I will have to make a Stack

How to show/hide password in TextFormField?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 14:20:16
问题 Currently I have my password TextFormField like this: TextFormField( decoration: const InputDecoration( labelText: 'Password', icon: const Padding( padding: const EdgeInsets.only(top: 15.0), child: const Icon(Icons.lock), )), validator: (val) => val.length < 6 ? 'Password too short.' : null, onSaved: (val) => _password = val, obscureText: true, ); I want a button like interaction which will make password visible and invisible. Can I do it inside TextFormField ? Or I will have to make a Stack

How to show/hide password in TextFormField?

谁说我不能喝 提交于 2021-02-05 14:20:09
问题 Currently I have my password TextFormField like this: TextFormField( decoration: const InputDecoration( labelText: 'Password', icon: const Padding( padding: const EdgeInsets.only(top: 15.0), child: const Icon(Icons.lock), )), validator: (val) => val.length < 6 ? 'Password too short.' : null, onSaved: (val) => _password = val, obscureText: true, ); I want a button like interaction which will make password visible and invisible. Can I do it inside TextFormField ? Or I will have to make a Stack

What is the @macro annotation in Flutter and Dart documentation

丶灬走出姿态 提交于 2021-02-05 10:43:06
问题 When I'm reading the source code I often see something like this (from TextField): /// {@macro flutter.widgets.editableText.keyboardType} final TextInputType keyboardType; What does the @macro mean? I found the answer so I'm posting it below as a self-answer Q&A. 回答1: A @macro is a way to insert some dartdoc documentation that has been written somewhere else. That way you don't have duplicate docs that you have to maintain. The string that follows @macro is the name of a template, which

The modifier async can not by applied to the body of a setter

寵の児 提交于 2021-02-05 09:48:48
问题 How can I use hashIt function in setter if editor gives this error The modifier async can not by applied to the body of a setter Future<String> hashIt(String password) async { return await PasswordHash.hashStorage(password); } set hashPass(String pass) async { // error here final hash = await hashIt(pass); _hash = hash; } compiller message: Error: Setters can't use 'async', 'async*', or 'sync*'. 回答1: The reason a setter cannot be async is that an async function returns a future, and a setter