Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gmd_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile
gmd_flutter
Commits
9181a728
Commit
9181a728
authored
May 17, 2019
by
Q14
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装网络库请求
parent
b0695e84
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
12 deletions
+39
-12
HomePage.dart
lib/Home/HomePage.dart
+36
-9
ALNetWork.dart
lib/netWork/ALNetWork.dart
+0
-0
DioUtil.dart
lib/netWork/DioUtil.dart
+0
-0
pubspec.lock
pubspec.lock
+3
-3
No files found.
lib/Home/HomePage.dart
View file @
9181a728
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'../netWork/DioUtil.dart'
;
// import '../netWork/DioUtil.dart';
// import 'package:dio/dio.dart';
// import 'dart:async';
class
HomePage
extends
StatefulWidget
{
class
HomePage
extends
StatefulWidget
{
@override
@override
...
@@ -6,15 +10,38 @@ class HomePage extends StatefulWidget {
...
@@ -6,15 +10,38 @@ class HomePage extends StatefulWidget {
}
}
class
_HomePageState
extends
State
<
HomePage
>
{
class
_HomePageState
extends
State
<
HomePage
>
{
void
_incrementCounter
()
{
void
_incrementCounter
()
async
{
setState
(()
{
// print('Come------');
// This call to setState tells the Flutter framework that
// // print('objectaaa');
// something has changed in this State, which causes it to rerun
// DioUtil().get('/api/v1/suggestion',
// the build method below so that the display can reflect the
// data: {
// updated values. If we changed _counter without calling
// 'content': 'aaa',
// setState(), then the build method would not be called again,
// // 'phone': '18601965003'
// and so nothing would appear to happen.
// },
});
// errorCallback: (statusCode) {
// print('NNNNNNNN');
// print('Http error code : $statusCode');
// }
// ).then((data) {
// print('AAAAAAAA');
// print('Http response: $data');
// });
// try {
// Response response = await Dio().post("https://earth.iyanzhi.com/api/v1/suggestion", queryParameters: {'content': 'aaa','phone': '18601965003'
// });
// print(response);
// } catch (e) {
// print(e);
// }
// FormData formData = new FormData.from({
// "username": "username",
// "password": "password",
// });
DioUtil
().
requestR
(
Method
.
post
,
"/api/v1/suggestion"
,
data:
{
"content"
:
"add"
,
"phone"
:
"aaa"
});
}
@override
@override
...
...
lib/netWork/ALNetWork.dart
View file @
9181a728
This diff is collapsed.
Click to expand it.
lib/netWork/DioUtil.dart
View file @
9181a728
This diff is collapsed.
Click to expand it.
pubspec.lock
View file @
9181a728
...
@@ -7,7 +7,7 @@ packages:
...
@@ -7,7 +7,7 @@ packages:
name: async
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "2.
1
.0"
version: "2.
2
.0"
boolean_selector:
boolean_selector:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -94,7 +94,7 @@ packages:
...
@@ -94,7 +94,7 @@ packages:
name: quiver
name: quiver
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "2.0.
2
"
version: "2.0.
3
"
sky_engine:
sky_engine:
dependency: transitive
dependency: transitive
description: flutter
description: flutter
...
@@ -141,7 +141,7 @@ packages:
...
@@ -141,7 +141,7 @@ packages:
name: test_api
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "0.2.
4
"
version: "0.2.
5
"
typed_data:
typed_data:
dependency: transitive
dependency: transitive
description:
description:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment