【发布时间】:2019-01-19 22:36:00
【问题描述】:
我正在使用 Flutter 处理移动应用程序。在这里,我想在 Flutter 中访问 WordPress 自定义帖子类型滑块。我试着喜欢这个
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() async {
List _jsonData = await getJson();
print(_jsonData);
runApp(new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Demo'),
centerTitle: true,
backgroundColor: Colors.redAccent,
),
body: new Column(
children: <Widget>[
new Text(_jsonData)
],
),
),
));
}
Future<List<Map<String,dynamic>>> getJson() async {
String apiUrl = 'http://bannermonster.com/demo.json';
http.Response response = await http.get(apiUrl);
return json.decode(response.body);
}
我的问题是我应该如何拉动 WordPress 自定义帖子类型在颤振完整的滑块数据中如何拉动。我刚开始学习颤振,谁能指出我正确的方向。这是我的代码,我没有收到任何错误。
【问题讨论】:
-
你会在你的问题中放一个 JSON 示例吗?
-
@Yamin 我添加了我的代码。
-
它在哪里?我没有看到 JSON 示例。
-
@Yamin
apiurl这里我有一个 json WP rest API。 -
如何获取数据示例?您只将路线放在那里,而不是实际的 URL。更新您的问题并举一个 WP JSON 响应的示例。
标签: android json wordpress dart flutter