flutter-layout

How to create a bounded scrollable TabBarView

谁说胖子不能爱 提交于 2019-12-12 08:48:17
问题 I need to implement the following layout in Flutter. When the user scrolls, I want the entire layout to scroll (hiding the header and tab bar). However, I can't nest a TabBarView inside a ListView since the TabBarView doesn't have a bounded height and ListViews don't provide a bounded height to their children. I've already seen these questions, but all of them have unsatisfactory answers for this use case: How can I have a TabView with variable height content within a Scrollable View with

Show (slide in) or hide (slide out) flutter AppBar on screen tap

拟墨画扇 提交于 2019-12-12 01:25:39
问题 Please I am trying to create this effect where the AppBar slides out when the screen is tapped and slides in when it is tapped again. I am able to create something similar in SliverAppBar by setting floating and snap to true. The difference is that the appBar shows when scrolling down and hides when screen is tapped or scrolled up. Here is the sample code for the SliverAppBar: @override Widget build(BuildContext context) { return Scaffold( body: CustomScrollView( controller: _ctrlr, slivers:

How to add tabs in a container in flutter ? Not involving appbar

穿精又带淫゛_ 提交于 2019-12-11 18:47:31
问题 I am new to flutter and decided to create a project where I am trying to implement tabs in flutter for my project. The tabs are not the navigation tabs but content-driven tabs in a screen. Following is the mock of design I am trying to implement. Following is the rest of code uptill now import 'dart:async'; import 'package:flutter/material.dart'; class TimerPage extends StatefulWidget { TimerPage({Key key}) : super(key: key); TimerPageState createState() => new TimerPageState(); } class

flutter app using Eosdart package pushing transacton ERROR

本秂侑毒 提交于 2019-12-11 17:58:36
问题 im getting this error while pushing the transaction, Did i follow the procedure correctly for pushing transaction what exactly the error is void main() => runApp(AddBorrower()); class AddBorrower extends StatefulWidget { @override _AddBorrowerState createState() => _AddBorrowerState(); } class _AddBorrowerState extends State<AddBorrower> { eos.Account _account; eos.EOSClient _eosClient = eos.EOSClient( 'http://jungle2.cryptolions.io:80', 'v1', privateKeys: ["PrivateKey"]); static List<eos

Flutter CustomPainter canvas rotate pivot

允我心安 提交于 2019-12-11 17:28:02
问题 In my Android Studio project, I rotate the canvas simply as following canvas.rotate(angle, cx, cy); with cx and cy the center of the screen (i.e. the pivot). But in Flutter, there's only a single rotate method: canvas.rotate(double radians) and as you can see, when I tested the pivot it uses by drawing some rectangles and rotating it and it uses top-left as pivot point. Is there a way to instruct Flutter to use my own provided pivot point? 回答1: canvas.translate(cx, cy); canvas.rotate(angle);

Flutter - notify sibling widgets inside Column

与世无争的帅哥 提交于 2019-12-11 17:12:54
问题 I'm trying to create a functionality, where when I click on a FlatButton inside an Expanded widget, its flex changes to 2 and other siblings FlatButton s flex change to 1 . import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return Directionality( textDirection: TextDirection.ltr, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ new ButtonWidget(text:

Link two pageviews in flutter

北城余情 提交于 2019-12-11 16:59:56
问题 How to link two pageviews in flutter? i.e. if one of them goes to page x the other should go to page x as well. I thought two PageViews having the same controller would do the trick. But that doesn't seem to be the case. I tried having a list of controllers and when one of the pageviews' page changes, I'm calling jumpToPage on all the other pageviews' controllers but all the other PageViews are not in the widget runtime tree initially (They're outside the screen) thus giving out errors. In my

How can user add multiple marker on google maps flutter

徘徊边缘 提交于 2019-12-11 16:42:59
问题 How can the user add multiple markers when user long press on the map. in this code, I've done single map. when user long press on the map it will automatically add one marker but I don't know how I can add multiple markers on the map. I tried lots of codes but I am not getting the proper result. hope you understand the question. your small help can make my day. Thanks in advance. Here is the code I've tried :) import 'package:flutter/material.dart'; import 'package:geocoder/geocoder.dart';

Style clipboard in flutter

南笙酒味 提交于 2019-12-11 15:38:35
问题 I am looking for a way to style the clipboard actions without touching textTheme/button property of the main style theme. Is this even possible? 回答1: Seems like the style is directly tied to the theme. Not the best idea but if you really wanted to you would need to create a custom popup and handle all the actions yourself. This should get you started... Output: Code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { // This widget is

Center Column in Flutter

时光怂恿深爱的人放手 提交于 2019-12-11 15:08:32
问题 I have a column inside a ListTile like this: return ListTile( //contentPadding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0), leading: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ Container( padding: EdgeInsets.only(right: 12.0), decoration: BoxDecoration( border: Border( right: BorderSide( width: 1.0, ))), child: Column( children: <Widget>[ Text('Hello'), ], ), ) ]), ...more code } Shouldn't this center the