Flutter

Remove dynamically a widget from a dynamically created list flutter

不羁岁月 提交于 2021-02-11 14:46:55
问题 I followed this example to remove a desired element from a list, and it worked fine. I then made some changes as the size of my list is not predefined (aka 5 in the example), but changes through a button. After adapting the code to my needs, I observed two problems: The elements hash codes changes everytime I hit + to add a new element. Is this correct as it's redrawing the list, or is incorrect? When deleting an element, besides changing the hash codes of all the other elements, only the

Convert images clicked from your phone to pdf in flutter using image_clicker and pdf package

做~自己de王妃 提交于 2021-02-11 14:39:39
问题 I am clicking images using the image_picker package and the images are returned as a File Type, I am storing all the images I click in a list of type File( because image_picker is returning a File ). Now i want to convert all the images into one pdf, for this i am using the pdf package. So, how do i do that, in the documentation they showed the way only for Text and Image, i need to know how to add files in a pdf. import 'package:flutter/material.dart'; import 'package:image_picker/image

Json parsing in dart (flutter)

守給你的承諾、 提交于 2021-02-11 14:30:40
问题 I'm new to Flutter and doesn't know much about complex json parsing. I've consulted few online articles but didn't find any suitable solution. My json is as follows { "EmployeeName":"EmployeeName", "Incidents" : [ { "Id":"1", "Text":"Text", "Photos":[ { "PhotoUrl" : "http://myphoto.com" }, { "PhotoUrl" : "http://myphoto.com" } ], "Notes" : [ { "Note":"Note" }, { "Note":"Note" } ] } ] } Any help would be great. 回答1: import 'package:flutter/material.dart'; import 'package:flutter/services.dart'

Flutter display sql data in ListTile instead of DataCell

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:24:03
问题 I am displaying a list of data fetched from my sql database using DataCell , but I don't really like how it looks and want to switch it to display it using ListTile , this is the code that I am using to display it using DataCell : return SingleChildScrollView( scrollDirection: Axis.vertical, child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: DataTable( columns: [ DataColumn( label: Text(''), ) ], rows: _chatUsers .map( (user) => DataRow(cells: [ DataCell( Text(user

same Firestore realtime database for client and user

妖精的绣舞 提交于 2021-02-11 14:23:13
问题 I want to make a Flutter app for showing shop details. I stored data in the Firestore real-time database. It's working perfectly. What I want to do now is make another app for the owner, then he can change data in Firestore and also send push notifications to shop app users. Is this possible? It would be helpful If you have any tutorials or videos.I haven't tried cloud functions because they need a credit card, Which I don't have. 来源: https://stackoverflow.com/questions/65352286/same

Firestore query single document

给你一囗甜甜゛ 提交于 2021-02-11 14:22:43
问题 In a flutter app, I need to pull the users document from firestore only if the last updated field is greater then the last updated locally. Currently this is what I do: QuerySnapshot usersData = await Firestore.instance .collection("users") .where("lastUpdated", isGreaterThan: lastUpdatedLocally) .where("userId", isEqualTo: userId) .getDocuments(); Map<String, dynamic> userData = usersData.documents.isEmpty ? {} : usersData.documents.first.data; I have three questions: Is it possible to do

Flutter, in_app_purchase is seriously hard to test

删除回忆录丶 提交于 2021-02-11 14:21:18
问题 After looking at the somewhat poor in_app_purchase pub dev documentation, after distributing the test version several times, I succeeded in sending the internal test url to the test device to download it. However, as soon as I entered the in_app_purchase screen with a real device, an app termination dialog error appeared and the app was forcibly turned off. I am really badly angry now. I don't understand why it made it so difficult to test, but I can't even see what caused the error. I did

How to highlight top item of ListView in flutter

岁酱吖の 提交于 2021-02-11 14:17:45
问题 I'm trying to make a Listview whose top element should have a different UI then the rest. And the Listview is scrollable so the item which is visible and at the top of the list should be highlighted with different UI. Refer to this image. I want when I scroll through the list the top item at that instant should have a different UI ( the highlighted orange color). How can I do this in flutter? 回答1: This is still an open Github issue about this. However, there are some packages here that can

Flutter: generate qrcode with multiple key-value pair

若如初见. 提交于 2021-02-11 14:16:51
问题 I am trying to generate qrcode in flutter. I need to add three key-values in the same. So, when i scan it, i can get the relevant information. This is first time i am working on qrcode scanning thing. So, i don't have idea about it. Here is the code. import 'package:DTG/utils/d_app_drwaer.dart'; import 'package:DTG/utils/d_appbar.dart'; import 'package:auto_route/auto_route.dart'; import 'package:device_info/device_info.dart'; import 'package:flutter/material.dart'; import 'package:qr_flutter

Flutter Getx - “Xxx” not found. You need to call “Get.put(Xxx())” - But i have called Get.put(Xxx())

醉酒当歌 提交于 2021-02-11 14:16:48
问题 I have this global bindings class to initialise some services and I need it to be initialised straight away: import 'package:get/get.dart'; import 'package:vepo/data/data_provider/local_data_provider.dart'; import 'package:vepo/data/data_source/local_data_source.dart'; import 'services/authentication_service.dart'; class GlobalBindings extends Bindings { final LocalDataProvider _localDataProvider = LocalDataProvider(); @override void dependencies() { Get.put<AuthenticationService>