处理警告问题

This commit is contained in:
2022-05-26 14:26:37 +08:00
parent 4a635f3570
commit a6897f6324
73 changed files with 452 additions and 93 deletions

View File

@@ -1,19 +1,19 @@
import 'dart:convert';
import 'package:http/http.dart' as Http;
import 'package:http/http.dart' as http;
class HttpApi {
final String BaseApi = 'http://api.gl.shangkelian.cn/api/';
final String baseApi = 'http://api.gl.shangkelian.cn/api/';
/// post
ApiPost(String api, {Map? body}) async {
String apiUrl = BaseApi + api;
apiPost(String api, {Map? body}) async {
String apiUrl = baseApi + api;
var url = Uri.parse(apiUrl);
var response = await Http.post(url, body: body);
var response = await http.post(url, body: body);
int newCode = response.statusCode;
Map data = jsonDecode(response.body);
if (newCode == 200) {
print('请求成功返回值$data');
// print('请求成功返回值$data');
return data;
}
// print(apiUrl);

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'pages/tabs/tabs.dart';
import 'pages/auth/auth.dart';
// import 'pages/auth/auth.dart';
void main() {
runApp(

View File

@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
const tMainColor = Color(0xfffdbb03);

View File

@@ -1,3 +1,11 @@
/*
* @Author: zhangdongxue zhangdongxue@uz.cn
* @Date: 2022-05-26 13:16:03
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
* @LastEditTime: 2022-05-26 14:25:36
* @FilePath: /gl_dao/lib/pages/store/store.dart
* @Description: 商城首页
*/
import 'package:flutter/material.dart';
import '../auth/auth.dart';
@@ -13,7 +21,7 @@ class StorePages extends StatefulWidget {
class _StorePagesState extends State<StorePages> {
@override
void initState() {
HttpApi().ApiPost(
HttpApi().apiPost(
'user/auth/sms',
body: {
'mobileNo': '18245180131',
@@ -27,7 +35,7 @@ class _StorePagesState extends State<StorePages> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('DTX商城'),
title: const Text('DTX商城1'),
shadowColor: Colors.transparent,
),
body: Center(