dart

How to make a widget's size same as another widget in Flutter

白昼怎懂夜的黑 提交于 2021-01-29 08:43:35
问题 The length of the texts on right is not fixed. I want to make the height of the line on left same as the texts area height. Is there a way to align a widget to another widget like Android's RelativeLayout or ConstraintLayout in Flutter? my code: Container( padding: EdgeInsets.fromLTRB(100, 0, 100, 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container( color: Color(0xFFEEEEEE), width: 4, height: 80, margin: EdgeInsets.only(right: 10), ), Expanded( child:

Errors in my dart code and other errors with android studio

白昼怎懂夜的黑 提交于 2021-01-29 08:38:40
问题 Note: I am a beginner in flutter and dart so please make the answers understandable When I opened the avd manager and ran the phone, it showed "unable to locate adb" and then opened the phone. (It's takes a long time to load) When I ran the program in android studio, I got these errors: (also got the same errors in flutter console) C:\Flutter SDK\flutter\bin\cache\dart-sdk\bin\dart.exe" --enable-asserts --enable-vm-service:58163 C:\Users\user\my_app\lib\main.dart lib/main.dart: Warning:

How to delete data using http.delete Flutter

青春壹個敷衍的年華 提交于 2021-01-29 08:36:12
问题 I'm Learning CRUD( Create,Read,Update,Delete) using rest api , I'm already GET & POST data, How to implement "http.delete()" in Flutter ? I'm already Using this function, i can get ID for deleting data, but not deleting. Future deleteMahasiswa(Map<String, dynamic> id) async { final response = await http.delete('${Urls.BASE_API_URL}/mahasiswa/delete?id=$id'); return response.statusCode == 200; } class Urls { static const BASE_API_URL = 'http://192.168.43.159/wpu-rest-server/apii/'; static

Flutter does not generate a lib/main.dart

旧时模样 提交于 2021-01-29 08:34:01
问题 After opening a simulator, when I run: flutter create first_app on my Dev folder directory in my User account, and then I run: cd first_app flutter run I am given an error message saying that there is no lib/main.dart directory, which is true; flutter didn't create a main file/method for me. This consequently makes it impossible to run the app. I am only starting out with Flutter, so I have yet to learn how to create a main method etc... My visualstudio code has already installed the Flutter

How to tell flutter widget that keyboard doesnt change screen size

荒凉一梦 提交于 2021-01-29 08:20:04
问题 I was looking for a way to split my background in my flutter application using a wave, and I found this piece of code: Design a background from 2 images in flutter It works perfectly, and I could adapt it to my needs. The only thing I don't understand is that every time I open my keyboard and type something into an input field, the wave is recalculated. I thought if I used a StatelessWidget, that wouldn't happen. Does anyone have an idea how I can fix this problem? Thank you very much. 来源:

在应用开发中,我为什么选择 Flutter 而不是 React Native ?

北城以北 提交于 2021-01-29 08:16:06
点击上方“ 逆锋起笔 ”, 公众号回复 pdf 领取大佬们推荐的学习资料 作者 | Sanket Doshi 译者 | 核子可乐 策划 | 李俊辰 作为一位开发人员,我想在本文中与大家聊聊跨平台开发领域的两大核心选项——Flutter 与 React Native 框架,并介绍我自己为什么更偏爱 Flutter。 时至今日,React Native 与 Flutter 已经成为两大领先跨平台开发框架。这两套框架之所以极具人气,是因为它们不仅能够简化开发、代码重用等常规工作,同时提供高度原生化的界面外观以及强有力的技术支持。 虽然二者的价值主张相似,但有很多方面仍存在不少差别。双方都能帮助开发人员更快、更轻松地构建并发布应用程序,但作为成熟度更高的框架选项,React Native 的社区规模更大;而 Flutter 则提供更多内置工具,可帮助用户减少对第三方工具的依赖。 我之所以更倾向于 Flutter,当然是觉得它在很多方面比 React Native 的表现更好。在解释具体原因之前,咱们不妨先聊聊这些框架的基本情况,以及它们分别适合处理的应用项目类型。 React Native React Native 是由 Facebook 公司于 2015 年开发并发布的。这是一套开源跨平台应用程序开发框架,适用于移动及 Web 等多种应用程序项目。 自 React Native 以来

Issue with PersistentBottomNavBar: MediaQuery.of(context)

馋奶兔 提交于 2021-01-29 08:12:13
问题 I have some issues with PersistentBottomNavBar package in my Flutter App. It gives me an error with MediaQuery.of(context) message: 'it called with a context that does not contain a MediaQuery'. I can't imagine what's going on here. Maybe it's because I'm using persistentBottomNavbar inside MultiProvider widget? I've tried to get rid of MultiProvider with MaterialApp widgets and return only PersistentTabView widget as a build widget. But it couldn't help me. The code I have: import 'package

Flutter - PlatformException : error, Invalid document reference. Document references must have an even number of segments, but users has 1, null

旧巷老猫 提交于 2021-01-29 08:06:55
问题 I wanted to get my users data from cloud firestore. It worked first but now it is raising a error. "PlatformException (PlatformException(error, Invalid document reference. Document references must have an even number of segments, but users has 1, null))" String name = "", email = "", pnumber = "", imgUrl = "", bio = "", posted = "", applied = "", rating = "", saved = ""; String url; final formKey = new GlobalKey<FormState>(); final databaseReference = Firestore.instance; String uID; @override

Flutter - PlatformException : error, Invalid document reference. Document references must have an even number of segments, but users has 1, null

☆樱花仙子☆ 提交于 2021-01-29 08:06:46
问题 I wanted to get my users data from cloud firestore. It worked first but now it is raising a error. "PlatformException (PlatformException(error, Invalid document reference. Document references must have an even number of segments, but users has 1, null))" String name = "", email = "", pnumber = "", imgUrl = "", bio = "", posted = "", applied = "", rating = "", saved = ""; String url; final formKey = new GlobalKey<FormState>(); final databaseReference = Firestore.instance; String uID; @override

Flutter: The instance member'stars' can't be accessed in an initializer. Error

让人想犯罪 __ 提交于 2021-01-29 08:01:06
问题 https://flutter.dev/docs/development/ui/layout#nesting-rows-and-columns When I was looking at the linked page above import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart' show debugPaintSizeEnabled; void main() { debugPaintSizeEnabled = true; // Remove to suppress visual layout runApp(MyApp()); } class MyApp extends StatelessWidget { Widget stars=Row( mainAxisSize: MainAxisSize.min, children: [ Icon(Icons.star, color: Colors.green[500]), Icon(Icons.star, color: Colors