dart

Best way to keep fetching new data from MySQL

落爺英雄遲暮 提交于 2021-01-29 07:17:49
问题 I need some suggestions or help please. I am trying to do a small real time chat application, most tutorials that I have been looking basically use firebase, but I have been using MySQL already for other parts of my small projects, I am not sure if I understood Stream correctly, but as far as I know I think that the data does keep fetching, I tried it but it didn't update the new data, and besides StreamBuilder being a little hard to use, I went for the easiest method using a regular http and

type 'int' is not subtype of type 'String' on Flutter

醉酒当歌 提交于 2021-01-29 07:16:07
问题 I modified description value to 1 on my database. List<DataEquipmentReg> values = snapshot.data; assetArray.add('${values[i].eq_no.toString()} : ${values[i].description.toString()}'); After edit description value to String , Error is not coming DataEquipmentReg POJO Class class DataEquipmentReg { final String eq_no; final String description; } Widget Text(assetArray[index].toString(),), Database in sqlite await db.execute("""CREATE TABLE EquipmentRegTable(eq_no STRING, description STRING)""")

Change background color of ListTile upon selection and custom height of tiles flutter

落花浮王杯 提交于 2021-01-29 07:07:23
问题 I've made a GridView , but now I have some ListTiles in this GridView that I need to be selected Upon selection, I want the background color to change. And I am also facing one more issue, I want to custom the heights of these ListTile , but I am not getting any success to do so. I am gonna attach the picture the output that I am getting and the output that I want. What I am getting: What I want: Here is the code: class _SelectLanguageNewState extends State<SelectLanguageNew> { List<Results>

Unhandled Exception: type 'String' is not a subtype of type 'double' even if a double is given

送分小仙女□ 提交于 2021-01-29 07:02:42
问题 I'm fetching coordinates from Firestore to fill my map with stores locations. The Google Map Marker needs a LatLng object (that takes two double as parameters) with the latitude and longitude of a point. But, for each increment, I get the following exception: type 'String' is not a subtype of type 'double' (verbose down below). However, the points do appear on the map, which should mean that the values ARE of type double... I used the following code to identify the latitude and longitude type

Change background color of ListTile upon selection and custom height of tiles flutter

自闭症网瘾萝莉.ら 提交于 2021-01-29 06:56:41
问题 I've made a GridView , but now I have some ListTiles in this GridView that I need to be selected Upon selection, I want the background color to change. And I am also facing one more issue, I want to custom the heights of these ListTile , but I am not getting any success to do so. I am gonna attach the picture the output that I am getting and the output that I want. What I am getting: What I want: Here is the code: class _SelectLanguageNewState extends State<SelectLanguageNew> { List<Results>

How to convert String index to character index in Dart

[亡魂溺海] 提交于 2021-01-29 06:55:04
问题 If I have an arbitrary String like this: final family = '\u{1F468}\u{200D}\u{1F469}\u{200D}\u{1F467}'; // 👨‍👩‍👧 final myString = 'Let me introduce my $family to you.'; And I know the String index of the character after the family emoji (the space) is 28 , how do I find the String index of the first code unit of the family emoji? In other words, how to I find the length in UTF-16 code units of the family emoji? I've asked a similar question before, but that was before the characters package

How to convert String index to character index in Dart

≡放荡痞女 提交于 2021-01-29 06:53:47
问题 If I have an arbitrary String like this: final family = '\u{1F468}\u{200D}\u{1F469}\u{200D}\u{1F467}'; // 👨‍👩‍👧 final myString = 'Let me introduce my $family to you.'; And I know the String index of the character after the family emoji (the space) is 28 , how do I find the String index of the first code unit of the family emoji? In other words, how to I find the length in UTF-16 code units of the family emoji? I've asked a similar question before, but that was before the characters package

Retrieving Data From Firestore in time

强颜欢笑 提交于 2021-01-29 06:47:50
问题 I have looked all over the internet for how to fix this problem and I can't find a solution anywhere. I am using flutter with firestore to make an app. I want to make it so when the user logins into the app at the top shows their name (simple right). I can get data from firestore: Future<void> getName() async { print("Attemping to get name!"); final firestoreInstance = await FirebaseFirestore.instance; FirebaseAuth auth = FirebaseAuth.instance; String uid = auth.currentUser.uid.toString();

cannot access the body fields of a Request without content-type - Flutter

↘锁芯ラ 提交于 2021-01-29 06:38:29
问题 I am having an issue making an HTTP PUT requests in a flutter. I can print the data on the console but when I tried to parse it to the endpoint that performs a PUT request, it return a response of 404 please can anyone help me? and this is the message: cannot access the body fields of a Request without content-type "application/x-www-form-urlencoded" Here is the actual problem: for (Products i in selectedProducts) { var stockupdate = { "oid": i.oid, // I can't get the oid here "unitInStock":

Flutter GridView.builder how to update

被刻印的时光 ゝ 提交于 2021-01-29 06:21:04
问题 I am trying to build an Flutter App with a GriView of cards and I want to add a new Card every time I hit the floatingActionButton . But how to update my view? I know the items are added to my list, but the GridView doesn't show the change. List<Widget> cardsList = []; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { return new Scaffold( appBar: AppBar( title: Text('Team Kitty'), ), body: GridView.builder( itemCount: cardsList.length,