Flutter

Flutter desktop - send PDF to a printer

余生长醉 提交于 2021-02-08 04:23:08
问题 I have a requirement to print PDF on the printer from the Flutter app. Is there a chance to have a possibility to do so right now? I mean that my application is going to fetch the PDF file from the server and then I would like to put it directly to the printer, so it can be printed instantly. The platform that I am targetting is windows. If this is not possible then is there a chance to execute .bat script using flutter? In the case that there would be no such possibility I could make the

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';

Project doesn't compile when using Intl package (DateFormat)

牧云@^-^@ 提交于 2021-02-07 22:35:09
问题 I'm trying to run my app after importing intl, but it won't work. In the pubspec.yaml file I have: intl: ^0.15.8 I've imported the package in three ways after some research, just to be sure. But only the first one (intl.dart) seems to be used : import "package:intl/intl.dart"; import "package:intl/intl_browser.dart"; //unused import import "package:intl/intl_standalone.dart"; //unused import I'm using it this way : DateFormat("dd-MM-yyyy").format(_chosenDate) My error after flutter run is:

How to save and get a list of lists using Shared preferences in dart/flutter

女生的网名这么多〃 提交于 2021-02-07 21:54:25
问题 I have been trying to save a list of lists using shared preferences in dart. For example, I have a list List data = [["dave","21","M"],["steven","22","F"]] and I am trying to save and load as it is but app keeps throwing Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'List<String>' I have tried converting the 2d list into a list using List new_data = data.expand((i) => i).toList(); and then saving it. But still, the exception persists even though it is a list containing

Flutter: Scheduled notification datetime

▼魔方 西西 提交于 2021-02-07 21:51:47
问题 I'm looking to integrate Flutter's plugin date_time_picker with local notification. So when I select a date&time I also schedule a notification. Here's my code..could you help me? Now I don't have any error but code is not working. class test1 extends StatefulWidget { @override _test1State createState() => _test1State(); } class _test1State extends State { FlutterLocalNotificationsPlugin fltrNotification; String _selectedParam; String task; int val; @override void initState() { super

Flutter - Firebase Messaging Snackbar not showing

半腔热情 提交于 2021-02-07 21:47:15
问题 This is the problem: notification is received by the app both with app in foreground or background (or terminated) but the snackbar for notification when the app is used doesn't work. I'm new in flutter so maybe I did some huge mistake. I am showing my code below. If you want more information just ask and thanks for the help! // Import Package import 'dart:io'; import 'package:app_gap_go/pages/admin/modifySingleMeeting.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import

What is the purpose of assigning `const` value to a `final` variable in dart? [duplicate]

心不动则不痛 提交于 2021-02-07 21:02:04
问题 This question already has answers here : What is the difference between the “const” and “final” keywords in Dart? (12 answers) Closed 2 years ago . So I was doing the first example for Flutter, and under Step 4: Create an infinite scrolling ListView , I encountered this piece of code: class RandomWordsState extends State<RandomWords> { final _suggestions = <WordPair>[]; final _biggerFont = const TextStyle(fontSize: 18.0); ... } But I found the following line a little spooky. final _biggerFont

What is the purpose of assigning `const` value to a `final` variable in dart? [duplicate]

落花浮王杯 提交于 2021-02-07 20:53:29
问题 This question already has answers here : What is the difference between the “const” and “final” keywords in Dart? (12 answers) Closed 2 years ago . So I was doing the first example for Flutter, and under Step 4: Create an infinite scrolling ListView , I encountered this piece of code: class RandomWordsState extends State<RandomWords> { final _suggestions = <WordPair>[]; final _biggerFont = const TextStyle(fontSize: 18.0); ... } But I found the following line a little spooky. final _biggerFont