flutter-layout

Detect when user is not interacting the app in Flutter

拥有回忆 提交于 2020-03-01 05:20:34
问题 I want to show some Screensaver type of screen when the user is not interacting the app for 5 minutes. So is anyone know how to achieve this kind of functionality in flutter. import 'dart:async'; import 'package:flutter/material.dart'; const timeout = const Duration(seconds: 10); const ms = const Duration(milliseconds: 1); Timer timer; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { var home = MyHomePage(title: 'Flutter Demo

Boxshadow appears behind other widgets

一个人想着一个人 提交于 2020-03-01 03:22:07
问题 I have a Container with a BoxShadow decoration at the top of a page, and below the Container is a ListView with a number of Cards in it. I want the top Container to have a drop shadow that appears in front of the items in the ListView , but this is what I get: The drop shadow seems to appear behind the Cards instead of in front of it. This is the code: Widget _buildBody(BuildContext context, ChecklistModel model){ return Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start,

Infinite List in Flutter Application

不羁的心 提交于 2020-02-27 03:49:51
问题 I am migrating my application from android to flutter and till now i have used ListView in flutter. my question is, is there any specialized technique to handle a large amount of data in the flutter? for reference, you can look at android RecyclerView . it handles in-memory views and recycles it runtime. so how to achieve functionality like RecyclerView in Flutter? or it's not necessary for the flutter? 回答1: The easiest way is to use a ListView.builder without specifying the itemCount

I want first ExpansionTile's item default is open. I want to When I click another item, current item is will close. How can I do it?

不打扰是莪最后的温柔 提交于 2020-02-25 04:17:57
问题 body: Container(color: Colors.white, child: SingleChildScrollView( child : Column( children : [ Padding(padding: EdgeInsets.only(left : 23.0, top: 23.0, right: 23.0, bottom: 5.0), child : Text("Title", style: MyTextStyles.textNormal,)), ListView.builder( padding: EdgeInsets.only(left: 13.0, right: 13.0, bottom: 25.0), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: PersonModel.icData.length, itemBuilder: (context, index) { PersonModel _model = PersonModel.icData[index];

I want first ExpansionTile's item default is open. I want to When I click another item, current item is will close. How can I do it?

六月ゝ 毕业季﹏ 提交于 2020-02-25 04:12:32
问题 body: Container(color: Colors.white, child: SingleChildScrollView( child : Column( children : [ Padding(padding: EdgeInsets.only(left : 23.0, top: 23.0, right: 23.0, bottom: 5.0), child : Text("Title", style: MyTextStyles.textNormal,)), ListView.builder( padding: EdgeInsets.only(left: 13.0, right: 13.0, bottom: 25.0), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: PersonModel.icData.length, itemBuilder: (context, index) { PersonModel _model = PersonModel.icData[index];

TextFormField hidden by keyboard - Flutter

大城市里の小女人 提交于 2020-02-24 12:18:05
问题 When focussing on the TextFormField, the keyboard hides over the TextFormField. I am using SingleScrollview with the Column widget. Below I attached a screenshot with coding. Please guide me in fixing this issue. Scaffold( resizeToAvoidBottomInset: false, resizeToAvoidBottomPadding: false, key: _scaffoldKey, body: SingleChildScrollView( child: Padding( padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), child: new Column( children: <Widget>[ _tabText(), isSignin ?

How to return part of a list of Widgets in Flutter

无人久伴 提交于 2020-02-22 05:38:05
问题 I have a page comprised of multiple sections, each consisting of a header and list of text. I would like the whole collection to scroll uniformly, as one series, and am wondering how best to break apart this logic. Imagine the following tree of widgets: ListView( children: <Widget>[ Text('Section 1 Header'), Text('Section 1 List Item 1'), Text('Section 1 List Item 2'), Text('Section 2 Header'), ... ] ) In terms of helper functions that build this cleanly, something like the following would be

How do I remove Flutter IconButton big padding?

不羁岁月 提交于 2020-02-13 08:22:26
问题 I want to have a row of IconButtons, all next to each other, but there seems to be a pretty big padding between the actual icon, and the IconButton limits. I've already set the padding on the button to 0. This is my component, pretty straightforward: class ActionButtons extends StatelessWidget { @override Widget build(BuildContext context) { return Container( color: Colors.lightBlue, margin: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0), child: Row( mainAxisAlignment:

Flutter: Pushing back button should allow the app to go to background

假装没事ソ 提交于 2020-02-05 05:16:11
问题 I am using Flutter BottomSheet to display info, and would like to keep BottomSheet always visible even when back button is clicked, and to make it work I have explicitly handled onWillPop and to keep the BottomSheet in view even when user clicks back button, changing the route etc The BottomSheet has a height of 200, and I want to keep it and yet allow the app to go background state when back button is clicked. Widget _buildBody(context) => WillPopScope( onWillPop: () async { if(navigatorKey

Dynamically created checkbox in flutter not changing the state on clicked

不羁的心 提交于 2020-02-05 03:50:07
问题 I am creating a checkbox field every time i press a button. but the generated checkbox is not changing the state when pressed, instead the next checkbox which is generated comes with the changed state. I have attached the video of how it is working currently (https://imgur.com/a/75vE5cj ) my entire code goes like this : class ToDoNotes extends StatelessWidget { @override Widget build(BuildContext context) { SizeConfig().init(context); return new MaterialApp( title: 'notes', theme: new