flutter-layout

Create text input bar always pinned to bottom

巧了我就是萌 提交于 2020-06-17 13:16:12
问题 I'm trying to create a Row widget that will be pinned to the bottom always like the below screenshot. I currently have a large container containing text (open to changing this to a card) followed by smaller cards which are scrollable. I would like to pin a bar to the bottom so a user can enter text and add a card. I'm not sure how to pin this to the bottom of the UI without interfering with the cards causing a pixel overflow. What is the best way to achieve this? I'd ideally like to achieve a

Error 'textBaseline != null' after flutter upgrade

冷暖自知 提交于 2020-06-17 13:00:25
问题 so i got the error below after upgrading flutter on master, building for web. Apart from upgrading flutter I didn't change anything. Switching branches and upgrading flutter again did not seem to work, as well as flutter clean and pub upgrade/ packages get. [+5273 ms] ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ [ +318 ms] The following assertion was thrown building InputDecorator(decoration: InputDecoration(hintMaxLines: [ +104 ms] "1",

Dart/flutter how to change the timer inside periodic after every time

旧巷老猫 提交于 2020-06-17 12:55:20
问题 I'm making a custom logic for showing ads in my app, so when the user opens the app after 1 min pops up an ad then supposed this 1 min to get increased by 1 min every time, So x be 2 then 3 then 4 ...etc. I tried to do so, but didn't work for me ( showing the ad every 1 min not increase it ); int x = 1; Timer.periodic(Duration(minutes: x), (timer) { x = x + 1; interstitialAd.load(); }); 回答1: I think you cannot do it. You can alternatively cancel the current timer and start a new timer based

Dart/flutter how to change the timer inside periodic after every time

核能气质少年 提交于 2020-06-17 12:54:47
问题 I'm making a custom logic for showing ads in my app, so when the user opens the app after 1 min pops up an ad then supposed this 1 min to get increased by 1 min every time, So x be 2 then 3 then 4 ...etc. I tried to do so, but didn't work for me ( showing the ad every 1 min not increase it ); int x = 1; Timer.periodic(Duration(minutes: x), (timer) { x = x + 1; interstitialAd.load(); }); 回答1: I think you cannot do it. You can alternatively cancel the current timer and start a new timer based

Flutter nested Rows MainAxisAlignment

狂风中的少年 提交于 2020-06-17 08:29:24
问题 I want to do this : But here is what I actually got : Here is my code : Row itemTransaction(BuildContext context, Transaction transaction) { /// This is the function that will build each item of our transaction list. return new Row( children: <Widget>[ new Container( width: MediaQuery.of(context).size.width / 6, height: MediaQuery.of(context).size.width / 6, child: new Image.asset( (transaction.sent) ? "images/tx_output.png" : "images/tx_input.png", ), ), new Column( children: <Widget>[ new

Programmatically Lighten or Darken a hex color in dart

会有一股神秘感。 提交于 2020-06-14 07:50:07
问题 I am trying to convert this hash color code #159424 (GREEN-COLOR) to more darken and lighten programmatically. How to do this please help? make green color darker toDarkColor(String hashColor){ // how to convert that hash string to make green color darker? } make green color lighter toLightColor(String hashColor){ // how to convert that hash string to make green color lighter? } 回答1: You can use tinycolor package: TinyColor.fromString("#159424").darken(10).color Edit: You can convert Color

Flutter: How to add a TextField or TextFormField programmatically

纵然是瞬间 提交于 2020-06-14 07:47:35
问题 I have created a form in with formkey and and form data variable as Map<String, String> _formdata = {}; formdata contains field such as profile data. Among those there is a field say Pets, It has two fields name and age. I want to add a button that will allow user to add more pets. This form should be visible only when clicking the button. User can add multiple pets by clicking this button. class MyPets extends StatefulWidget { @override _MyPetsState createState() => _MyPetsState(); } class

Flutter – two text in a row with left one overflowing gracefully

徘徊边缘 提交于 2020-06-14 05:55:32
问题 How do I get two side-by-side Text widgets to only allow the left-most one to overflow gracefully? One text widget in a column is easy to overflow gracefully. Two text widgets side-by-side in a row is problematic. Stack overflow wants more details but honestly I'm probably just wasting more of your time at this point. Widget _listItem({String title, String subtitle}){ return Row( children: <Widget>[ _listItemIcon(), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start,

Flutter – two text in a row with left one overflowing gracefully

不打扰是莪最后的温柔 提交于 2020-06-14 05:55:08
问题 How do I get two side-by-side Text widgets to only allow the left-most one to overflow gracefully? One text widget in a column is easy to overflow gracefully. Two text widgets side-by-side in a row is problematic. Stack overflow wants more details but honestly I'm probably just wasting more of your time at this point. Widget _listItem({String title, String subtitle}){ return Row( children: <Widget>[ _listItemIcon(), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start,

How to put opacity for container in flutter

久未见 提交于 2020-06-13 14:29:21
问题 I want to put opacity for container which contain hexadecimal color code. I am new to flutter. Please help me. Here is the code. Thanks in advance. final body = Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0), padding: EdgeInsets.all(28.0), decoration: new BoxDecoration( color: const Color(0xFF0E3311),//here i want to add opacity border: new Border.all(color: Colors.black54, ), borderRadius: new BorderRadius.only( topLeft: const