Flutter Listview:从更新的 MySQL 创建一个 Json 列表?

问题描述

我正在尝试为我的 Flutter 应用程序创建一个简单的发布-订阅样式 byte command_type = 1; byte command_class = 5; byte command_code = 0x14; int arg0 = 0; int arg1 = 0; // We kNow the message plus the checksum has length 12 var packedMessage2 = new byte[12]; // We use the new Span feature var span = new Span<byte>(packedMessage2); // We can directly set the single bytes span[0] = command_type; span[1] = command_class; span[2] = command_code; // The pack is <,so little endian. Note the use of Slice: first the position (3 or 7),then the length of the data (4 for int) BinaryPrimitives.WriteInt32LittleEndian(span.Slice(3,4),arg0); BinaryPrimitives.WriteInt32LittleEndian(span.Slice(7,arg1); // The checksum // The sum is modulo 255,because it is a single byte. // the unchecked is normally useless because it is standard in C#,but we write it to make it clear var sum = unchecked((byte)packedMessage2.Take(11).Sum(x => x)); // We set the sum span[11] = sum; // Without checksum Console.WriteLine(string.Concat(packedMessage2.Take(11).Select(x => $@"\x{x:x2}"))); // With checksum Console.WriteLine(string.Concat(packedMessage2.Select(x => $@"\x{x:x2}"))); ,其中列表视图是从网络服务器上的 JSON 列表更新的。每当有人回复原始帖子时,此列表视图就会更新。

我在 Flutter 端使用了来自 Github 的 Tensor-Programming 代码https://github.com/tensor-programming/flutter_streams/blob/master/lib/main.dart

我想在我的网络服务器上创建一个 JSON 列表,而不是使用 https://jsonplaceholder.typicode.com/photos,只要将一行插入到数据库中,它就会从 MysqL 二进制日志或直接从 PHP 或 Nodejs 创建/更新。

但问题是我可能会在服务器上得到很多很多 JSON 文本文件

所以问题是;这个 JSON 列表应该放在哪里?作为普通的文本文件?这是否意味着服务器上会有很多很多文本文件,因为每个 JSON 列表都是定制的?

或者我应该忘记 MysqL 并使用诸如 https://rethinkdb.com 之类的东西?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...