feat:增加网络请求

This commit is contained in:
2025-07-14 19:43:41 +08:00
parent 8a1b507166
commit 3f12b03648
10 changed files with 4030 additions and 47 deletions

10
lib/api/session.dart Normal file
View File

@@ -0,0 +1,10 @@
import 'package:food_hub_app/models/session.dart';
import 'package:food_hub_app/utils/HttpUtil.dart';
Future<Session?> loginApi(String username, String password) {
return HttpUtil().post<Session>(
"/session",
queryParameters: {"username": username, "password": password},
converter: (data) => Session.fromJson(data),
);
}

80
lib/models/session.dart Normal file
View File

@@ -0,0 +1,80 @@
import 'package:json_annotation/json_annotation.dart';
part 'session.g.dart';
@JsonSerializable()
class SaTokenInfo {
String? tokenName;
String? tokenValue;
bool? isLogin;
dynamic loginId;
String? loginType;
int? tokenTimeout;
int? sessionTimeout;
int? tokenSessionTimeout;
int? tokenActiveTimeout;
String? loginDeviceType;
String? tag;
SaTokenInfo({
this.tokenName,
this.tokenValue,
this.isLogin,
this.loginId,
this.loginType,
this.tokenTimeout,
this.sessionTimeout,
this.tokenSessionTimeout,
this.tokenActiveTimeout,
this.loginDeviceType,
this.tag,
});
factory SaTokenInfo.fromJson(Map<String, dynamic> json) => _$SaTokenInfoFromJson(json);
Map<String, dynamic> toJson() => _$SaTokenInfoToJson(this);
}
@JsonSerializable()
class User {
String? username;
int? gender;
String? phoneNumber;
String? email;
DateTime? birthDate;
String? avatar;
List<String>? area;
String? address;
String? job;
List<String>? tags;
String? description;
String? id;
User({
this.id,
this.username,
this.gender,
this.phoneNumber,
this.email,
this.birthDate,
this.avatar,
this.area,
this.address,
this.job,
this.tags,
this.description,
});
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
Map<String, dynamic> toJson() => _$UserToJson(this);
}
@JsonSerializable()
class Session {
SaTokenInfo? saToken;
User? userInfo;
Session({this.saToken, this.userInfo});
factory Session.fromJson(Map<String, dynamic> json) => _$SessionFromJson(json);
Map<String, dynamic> toJson() => _$SessionToJson(this);
}

85
lib/models/session.g.dart Normal file
View File

@@ -0,0 +1,85 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'session.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SaTokenInfo _$SaTokenInfoFromJson(Map<String, dynamic> json) => SaTokenInfo(
tokenName: json['tokenName'] as String?,
tokenValue: json['tokenValue'] as String?,
isLogin: json['isLogin'] as bool?,
loginId: json['loginId'],
loginType: json['loginType'] as String?,
tokenTimeout: (json['tokenTimeout'] as num?)?.toInt(),
sessionTimeout: (json['sessionTimeout'] as num?)?.toInt(),
tokenSessionTimeout: (json['tokenSessionTimeout'] as num?)?.toInt(),
tokenActiveTimeout: (json['tokenActiveTimeout'] as num?)?.toInt(),
loginDeviceType: json['loginDeviceType'] as String?,
tag: json['tag'] as String?,
);
Map<String, dynamic> _$SaTokenInfoToJson(SaTokenInfo instance) =>
<String, dynamic>{
'tokenName': instance.tokenName,
'tokenValue': instance.tokenValue,
'isLogin': instance.isLogin,
'loginId': instance.loginId,
'loginType': instance.loginType,
'tokenTimeout': instance.tokenTimeout,
'sessionTimeout': instance.sessionTimeout,
'tokenSessionTimeout': instance.tokenSessionTimeout,
'tokenActiveTimeout': instance.tokenActiveTimeout,
'loginDeviceType': instance.loginDeviceType,
'tag': instance.tag,
};
User _$UserFromJson(Map<String, dynamic> json) => User(
id: json['id'] as String?,
username: json['username'] as String?,
gender: (json['gender'] as num?)?.toInt(),
phoneNumber: json['phoneNumber'] as String?,
email: json['email'] as String?,
birthDate:
json['birthDate'] == null
? null
: DateTime.parse(json['birthDate'] as String),
avatar: json['avatar'] as String?,
area: (json['area'] as List<dynamic>?)?.map((e) => e as String).toList(),
address: json['address'] as String?,
job: json['job'] as String?,
tags: (json['tags'] as List<dynamic>?)?.map((e) => e as String).toList(),
description: json['description'] as String?,
);
Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
'username': instance.username,
'gender': instance.gender,
'phoneNumber': instance.phoneNumber,
'email': instance.email,
'birthDate': instance.birthDate?.toIso8601String(),
'avatar': instance.avatar,
'area': instance.area,
'address': instance.address,
'job': instance.job,
'tags': instance.tags,
'description': instance.description,
'id': instance.id,
};
Session _$SessionFromJson(Map<String, dynamic> json) => Session(
saToken:
json['saToken'] == null
? null
: SaTokenInfo.fromJson(json['saToken'] as Map<String, dynamic>),
userInfo:
json['userInfo'] == null
? null
: User.fromJson(json['userInfo'] as Map<String, dynamic>),
);
Map<String, dynamic> _$SessionToJson(Session instance) => <String, dynamic>{
'saToken': instance.saToken,
'userInfo': instance.userInfo,
};

222
lib/utils/HttpUtil.dart Normal file
View File

@@ -0,0 +1,222 @@
import 'package:dio/dio.dart';
import 'package:food_hub_app/widgets/common/index.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class HttpUtil {
static final HttpUtil _instance = HttpUtil._internal();
factory HttpUtil() => _instance;
late Dio _dio;
String baseUrl = "http://172.29.101.108:8100/";
// 请求头配置
Map<String, dynamic> headers = {
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json',
};
// 超时时间
final int timeout = 5;
HttpUtil._internal() {
// 初始化Dio实例
BaseOptions options = BaseOptions(
baseUrl: baseUrl,
connectTimeout: Duration(seconds: timeout),
receiveTimeout: Duration(seconds: timeout),
headers: headers,
);
_dio = Dio(options);
// 添加请求拦截器
_dio.interceptors.add(
InterceptorsWrapper(
onRequest: (options, handler) {
print("请求URL: ${options.uri}");
if (options.data != null) {
print("请求参数: ${options.data}");
}
// 可以在此添加token等操作
// options.headers['Authorization'] = 'Bearer your_token';
return handler.next(options);
},
),
);
// 添加响应拦截器
_dio.interceptors.add(
InterceptorsWrapper(
onResponse: (response, handler) {
print("响应状态码: ${response.statusCode}");
print("响应数据: ${response.data}");
return handler.next(response);
},
),
);
// 添加错误拦截器
_dio.interceptors.add(
InterceptorsWrapper(
onError: (DioException e, handler) {
if (e.response != null) {
final responseData = e.response?.data;
if (responseData is Map<String, dynamic>) {
// 服务器返回标准JSON错误格式
print(responseData['message']?.toString());
showErrorToast('错误');
} else {
// 非JSON格式错误
print('网络错误: ${e.message}');
}
}
return handler.next(e);
},
),
);
}
// 基础请求方法(处理所有类型的请求)
Future<T?> _request<T>(
String path, {
required String method,
dynamic data,
Map<String, dynamic>? queryParameters,
T Function(dynamic data)? converter,
}) async {
try {
Response response = await _dio.request(
path,
data: data,
queryParameters: queryParameters,
options: Options(method: method),
);
// 处理响应数据
if (converter != null) {
return converter(response.data);
}
// 如果没有转换器且T是dynamic直接返回原始数据
if (T == dynamic) {
return response.data as T;
}
// 没有转换器时尝试直接返回(可能不安全,建议提供转换器)
return response.data as T?;
} catch (e) {
_handleError(e);
rethrow;
}
}
// GET请求
Future<T?> get<T>(
String path, {
Map<String, dynamic>? queryParameters,
T Function(dynamic data)? converter,
}) => _request(
path,
method: "GET",
queryParameters: queryParameters,
converter: converter,
);
// POST请求
Future<T?> post<T>(
String path, {
dynamic data,
Map<String, dynamic>? queryParameters,
T Function(dynamic data)? converter,
}) => _request(
path,
method: "POST",
data: data,
queryParameters: queryParameters,
converter: converter,
);
// PUT请求
Future<T?> put<T>(
String path, {
dynamic data,
Map<String, dynamic>? queryParameters,
T Function(dynamic data)? converter,
}) => _request(
path,
method: "PUT",
data: data,
queryParameters: queryParameters,
converter: converter,
);
// DELETE请求
Future<T?> delete<T>(
String path, {
dynamic data,
Map<String, dynamic>? queryParameters,
T Function(dynamic data)? converter,
}) => _request(
path,
method: "DELETE",
data: data,
queryParameters: queryParameters,
converter: converter,
);
// 文件上传
Future<dynamic> upload(
String path,
String filePath, {
Map<String, dynamic>? queryParameters,
}) async {
try {
FormData formData = FormData.fromMap({
'file': await MultipartFile.fromFile(filePath),
});
Response response = await _dio.post(
path,
data: formData,
queryParameters: queryParameters,
);
return response.data;
} catch (e) {
_handleError(e);
rethrow;
}
}
// 错误处理
void _handleError(dynamic error) {
if (error is DioException) {
switch (error.type) {
case DioExceptionType.connectionTimeout:
print("连接超时");
break;
case DioExceptionType.sendTimeout:
print("发送超时");
break;
case DioExceptionType.receiveTimeout:
print("接收超时");
break;
case DioExceptionType.cancel:
print("请求取消");
break;
case DioExceptionType.badCertificate:
print("证书错误");
case DioExceptionType.badResponse:
print("错误响应");
case DioExceptionType.connectionError:
print("连接错误");
case DioExceptionType.unknown:
print("未知错误");
break;
}
} else {
print("未知错误: $error");
}
}
}

3063
lib/views/data.dart Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:food_hub_app/api/session.dart';
import 'package:food_hub_app/widgets/common/index.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
@@ -23,8 +24,10 @@ class _LoginPage extends State<LoginPage> {
{"title": "wechat", "icon": Icons.wechat},
];
void loginClick(BuildContext context) {
Navigator.pushNamed(context, '/home');
void loginClick(BuildContext context) async {
await loginApi("Cxx", "1232");
// Navigator.pushNamed(context, '/home');
return;
// 表单校验通过才会继续执行

View File

@@ -1,5 +1,7 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:graphic/graphic.dart';
import 'data.dart';
class StatsPage extends StatefulWidget {
const StatsPage({super.key});
@@ -9,26 +11,90 @@ class StatsPage extends StatefulWidget {
}
class _StatsPage extends State<StatsPage> {
var _smooth = false;
var _stepped = false;
@override
Widget build(BuildContext context) {
// 月度做菜次数数据
final List<FlSpot> spots = [
FlSpot(0, 13), FlSpot(1, 32), FlSpot(2, 121),
FlSpot(3, 31), FlSpot(4, 34), FlSpot(5, 45)
];
// 月份标签
final List<String> months = [
'1月', '2月', '3月', '4月', '5月', '6月'
];
return LineChart(
LineChartData(
lineBarsData: [
LineChartBarData(
spots: spots,
return SingleChildScrollView(
child: Center(
child: Column(
children: <Widget>[
Container(
margin: const EdgeInsets.only(top: 10),
width: 350,
height: 300,
child: Chart(
data: basicData,
variables: {
'genre': Variable(
accessor: (Map map) => map['genre'] as String,
),
'sold': Variable(accessor: (Map map) => map['sold'] as num),
},
marks: [
IntervalMark(
label: LabelEncode(
encoder: (tuple) => Label(tuple['sold'].toString()),
),
elevation: ElevationEncode(
value: 0,
updaters: {
'tap': {true: (_) => 5},
},
),
color: ColorEncode(
value: Defaults.primaryColor,
updaters: {
'tap': {false: (color) => color.withAlpha(100)},
},
),
),
],
axes: [Defaults.horizontalAxis, Defaults.verticalAxis],
selections: {'tap': PointSelection(dim: Dim.x)},
tooltip: TooltipGuide(),
crosshair: CrosshairGuide(),
),
),
Container(
padding: const EdgeInsets.fromLTRB(20, 40, 20, 5),
child: const Text(
'Transposed Bar Chart',
style: TextStyle(fontSize: 20),
),
),
Container(
margin: const EdgeInsets.only(top: 10),
width: 350,
height: 300,
child: Chart(
data: basicData,
variables: {
'genre': Variable(
accessor: (Map map) => map['genre'] as String,
),
'sold': Variable(accessor: (Map map) => map['sold'] as num),
},
transforms: [Proportion(variable: 'sold', as: 'percent')],
marks: [
IntervalMark(
position: Varset('percent') / Varset('genre'),
label: LabelEncode(
encoder: (tuple) => Label(tuple['sold'].toString()),
),
color: ColorEncode(
variable: 'genre',
values: Defaults.colors10,
),
modifiers: [StackModifier()],
),
],
coord: PolarCoord(transposed: true, dimCount: 1, dimFill: 1.05),
),
),
],
),
),
);
}

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// import 'package:fluttertoast/fluttertoast.dart';
Widget formLabelText({required String labelText, bool isRequired = false}) {
@@ -61,14 +62,14 @@ Text buttonText({required String text}) {
// );
// }
//
// void showErrorToast(String message) {
// Fluttertoast.showToast(
// msg: message,
// toastLength: Toast.LENGTH_SHORT,
// gravity: ToastGravity.CENTER,
// timeInSecForIosWeb: 1,
// backgroundColor: Colors.red,
// textColor: Colors.white,
// fontSize: 16.0,
// );
// }
void showErrorToast(String message) {
Fluttertoast.showToast(
msg: message,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.CENTER,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0,
);
}

View File

@@ -1,6 +1,30 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f
url: "https://pub.flutter-io.cn"
source: hosted
version: "85.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: abf63d42450c7ad6d8188887d16eeba2f1ff92ea8d8dc673213e99fb3c02b194
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.5.7"
args:
dependency: transitive
description:
name: args
sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.7.0"
async:
dependency: transitive
description:
@@ -17,6 +41,70 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.2"
build:
dependency: transitive
description:
name: build
sha256: "51dc711996cbf609b90cbe5b335bbce83143875a9d58e4b5c6d3c4f684d3dda7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.4"
build_config:
dependency: transitive
description:
name: build_config
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.4"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: ee4257b3f20c0c90e72ed2b57ad637f694ccba48839a821e87db762548c22a62
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.4"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "382a4d649addbfb7ba71a3631df0ec6a45d5ab9b098638144faf27f02778eb53"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.5.4"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "85fbbb1036d576d966332a3f5ce83f2ce66a40bea1a94ad2d5fc29a19a0d3792"
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.1.2"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27"
url: "https://pub.flutter-io.cn"
source: hosted
version: "8.10.1"
characters:
dependency: transitive
description:
@@ -25,6 +113,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.0"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.3"
clock:
dependency: transitive
description:
@@ -33,6 +129,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
code_builder:
dependency: transitive
description:
name: code_builder
sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.10.1"
collection:
dependency: transitive
description:
@@ -41,6 +145,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.19.1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.2"
cross_file:
dependency: transitive
description:
@@ -49,6 +161,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.4+2"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.6"
cupertino_icons:
dependency: "direct main"
description:
@@ -57,6 +177,30 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.8"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "5b236382b47ee411741447c1f1e111459c941ea1b3f2b540dde54c210a3662af"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.0"
dio:
dependency: "direct main"
description:
name: dio
sha256: "253a18bbd4851fecba42f7343a1df3a9a4c1d31a2c1b37e221086b4fa8c8dbc9"
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.8.0+1"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
easy_refresh:
dependency: transitive
description:
@@ -65,14 +209,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.4.0"
equatable:
dependency: transitive
description:
name: equatable
sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.7"
fake_async:
dependency: transitive
description:
@@ -81,6 +217,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.2"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.flutter-io.cn"
source: hosted
version: "7.0.1"
file_selector_linux:
dependency: transitive
description:
@@ -113,14 +257,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.3+4"
fl_chart:
dependency: "direct main"
fixnum:
dependency: transitive
description:
name: fl_chart
sha256: "577aeac8ca414c25333334d7c4bb246775234c0e44b38b10a82b559dd4d764e7"
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
version: "1.1.1"
flutter:
dependency: "direct main"
description: flutter
@@ -181,6 +325,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
fluttertoast:
dependency: "direct main"
description:
name: fluttertoast
sha256: "25e51620424d92d3db3832464774a6143b5053f15e382d8ffbfd40b6e795dcf1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "8.2.12"
form_builder_validators:
dependency: "direct main"
description:
@@ -189,6 +341,38 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "11.1.2"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.3"
graphic:
dependency: "direct main"
description:
name: graphic
sha256: af3a5a967d95ce2c2c9f7dee83c21f8bd6e6a458341820920cf15c0311cdaddc
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.0"
graphs:
dependency: transitive
description:
name: graphs
sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.2"
http:
dependency: transitive
description:
@@ -197,6 +381,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.0"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.2.2"
http_parser:
dependency: transitive
description:
@@ -277,6 +469,38 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.19.0"
io:
dependency: transitive
description:
name: io
sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.7.2"
json_annotation:
dependency: "direct main"
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.9.0"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
sha256: c50ef5fc083d5b5e12eef489503ba3bf5ccc899e487d691584699b4bdefeea8c
url: "https://pub.flutter-io.cn"
source: hosted
version: "6.9.5"
leak_tracker:
dependency: transitive
description:
@@ -309,6 +533,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.1.1"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
matcher:
dependency: transitive
description:
@@ -341,6 +573,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
path:
dependency: transitive
description:
@@ -373,6 +613,46 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.8"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.2.0"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.5.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925"
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
simple_gesture_detector:
dependency: transitive
description:
@@ -386,6 +666,22 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "4f81479fe5194a622cdd1713fe1ecb683a6e6c85cd8cec8e2e35ee5ab3fdf2a1"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.6"
source_span:
dependency: transitive
description:
@@ -410,6 +706,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
@@ -466,6 +770,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.7"
timing:
dependency: transitive
description:
name: timing
sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.2"
typed_data:
dependency: transitive
description:
@@ -490,6 +802,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "14.3.1"
watcher:
dependency: transitive
description:
name: watcher
sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.2"
web:
dependency: transitive
description:
@@ -498,6 +818,30 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.3"
yaml:
dependency: transitive
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.7.0 <4.0.0"
flutter: ">=3.29.0"

View File

@@ -1 +1,110 @@
name: food_hub_app
name: food_hub_app
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: ^3.7.0
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons fonts to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
dio: ^5.7.0
timelines_plus: ^1.0.7
table_calendar: ^3.1.3
flutter_form_builder: ^10.0.0
form_builder_validators: ^11.1.2
graphic: ^2.6.0
intl: ^0.19.0
tdesign_flutter: ^0.2.3
json_annotation: ^4.9.0
fluttertoast: ^8.2.0
dependency_overrides:
tdesign_flutter_adaptation: 3.16.0
image_picker: 1.0.8
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0
build_runner: ^2.4.5
json_serializable: ^6.7.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons fonts is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the fonts family name, and a "fonts" key with a
# list giving the asset and other descriptors for the fonts. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
fonts:
- family: CustomFont
fonts:
- asset: fonts/custom.ttf