dart

Expand DataTable to fill height in Flutter

限于喜欢 提交于 2021-02-08 07:24:57
问题 I have a problem with flutter. I need to fill a DataTable in the height of screen. I tried to add the dataTable inside a Flex widget, but I don't get changes. When I set the heigh of the Container, that's work let me a white space at the button of the screen Thank you! and i'm sorry for mi poor english This my code: products.addAll(Product.getExampleList()); var table = Container( child: SingleChildScrollView( scrollDirection: Axis.horizontal, child:SizedBox( child: Column( children: <Widget>

Calculate logical pixels from millimeters

大兔子大兔子 提交于 2021-02-08 06:26:14
问题 I have a design with widths, heights, paddings... in millimeters. I'm now trying to figure out how to convert those numbers to the logical pixel system Flutter uses. I found the docs for the device pixel ratio but I'm not sure how to interpret that number and I quote: The Flutter framework operates in logical pixels, so it is rarely necessary to directly deal with this property. So I am not sure if this is the way to go. My question comes down to this: Is there an easy way to calculate from

How to draw custom shape in flutter and drag that shape around?

扶醉桌前 提交于 2021-02-08 06:14:28
问题 At the moment I can draw rectangles using CustomPainter. Below the code inside the paint method of my CustomPainter. for (var rectPoints in rectangles) { paint.color = rectPoints.color; paint.strokeWidth = rectPoints.strokeWidth; if (rectPoints.selected != null && rectPoints.selected == true) { paint.color = Colors.black45; } var rect = Rect.fromLTWH( rectPoints.startPoint.dx, rectPoints.startPoint.dy, rectPoints.endPoint.dx - rectPoints.startPoint.dx, rectPoints.endPoint.dy - rectPoints

How to draw custom shape in flutter and drag that shape around?

北城余情 提交于 2021-02-08 06:14:24
问题 At the moment I can draw rectangles using CustomPainter. Below the code inside the paint method of my CustomPainter. for (var rectPoints in rectangles) { paint.color = rectPoints.color; paint.strokeWidth = rectPoints.strokeWidth; if (rectPoints.selected != null && rectPoints.selected == true) { paint.color = Colors.black45; } var rect = Rect.fromLTWH( rectPoints.startPoint.dx, rectPoints.startPoint.dy, rectPoints.endPoint.dx - rectPoints.startPoint.dx, rectPoints.endPoint.dy - rectPoints

Divide screen into 4 different parts evenly

百般思念 提交于 2021-02-08 05:39:34
问题 Help me Guys I am new to the flutter development I am trying to make this type of layout here is the layout I wanted but I am getting this layout Look of the layout is this here is my code friends please help out friends I had started the development of the flutter recently guys I had tried the fitted box and expanded class as well Home.dart class HomeScreen extends StatefulWidget { @override State<StatefulWidget> createState() { HomeScreen_Page homecreatestate() => HomeScreen_Page(); return

How to pass data to previous screen in Flutter using Navigator? (need to handle all cases: swipe to go back, press back, etc)

别说谁变了你拦得住时间么 提交于 2021-02-08 05:17:43
问题 Let's say I'm passing data between screens using default way with Navigator.pop: @override void selectUserAction(BuildContext context) async { final result = await Navigator.of(context).push( MaterialPageRoute(builder: (context) => SelectUserPage())); final User selectedUser = result as UserModel; } Navigator.pop(context, selectedUser); So everything goes well in that case. And I know I can handle back button interaction (onPressed) using AppBar leading property like this: leading: IconButton

Flutter App is Incompatible With Nearly Everything?

人盡茶涼 提交于 2021-02-08 04:38:31
问题 I have built a Flutter app that works perfectly on my phone, but none of the others I have tried it on. Here's the Git repo. My problem is that when I try to install from the APK I build, all the devices I'm trying to install it on say that the app is "incompatible." I have tried the app on the following devices: Samsung Galaxy J3 Huawei P10 Samsung Galaxy Core Prime LG something-or-other It works on my Samsung Galaxy S8, and the Samsung Galaxy S7. Any and all help is greatly appreciated, as

How can I update map data that's in a array in firebase? (Flutter)

↘锁芯ラ 提交于 2021-02-08 03:06:28
问题 I'm using flutter web and firebase for a project and got stuck on a problem. I'm trying to update a map in an array in firestore. using this: var val = []; val.add({'groupUID': groupUID, 'inviteStatus': status}); var userInviteUID; await users .document(uid) .get() .then((value) => userInviteUID = value.data['inviteUID']); await invites .document(userInviteUID) .updateData({'invites': FieldValue.arrayUnion(val)}); I got this result: firestore structure What I want to do is just change the 1

How can I update map data that's in a array in firebase? (Flutter)

邮差的信 提交于 2021-02-08 03:00:11
问题 I'm using flutter web and firebase for a project and got stuck on a problem. I'm trying to update a map in an array in firestore. using this: var val = []; val.add({'groupUID': groupUID, 'inviteStatus': status}); var userInviteUID; await users .document(uid) .get() .then((value) => userInviteUID = value.data['inviteUID']); await invites .document(userInviteUID) .updateData({'invites': FieldValue.arrayUnion(val)}); I got this result: firestore structure What I want to do is just change the 1

Change color of multiple buttons one after the other in Flutter

半世苍凉 提交于 2021-02-08 02:49:49
问题 On clicking the Go button I want button 1 to turn red. Then turn back white. Then button 2 should turn red & then reverts back to white. Then 3, 4 and so on. I can design my callback button such that button 1 turns red. I am not sure, how to turn it back to white after 2 second & then turn the next button red & so on. main.dart class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State<MyApp> { final String apptitle = 'Test';