add scroll bar
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 517 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 622 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 647 B |
BIN
assets/launcher_icon/icon.png
Normal file
After Width: | Height: | Size: 419 B |
8
flutter_launcher_icons.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
flutter_launcher_icons:
|
||||||
|
android: true
|
||||||
|
ios: true
|
||||||
|
image_path: "assets/launcher_icon/icon.png"
|
||||||
|
windows:
|
||||||
|
generate: true
|
||||||
|
image_path: "assets/launcher_icon/icon.png"
|
||||||
|
icon_size: 48
|
@ -427,7 +427,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
@ -484,7 +484,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||||
CLANG_ANALYZER_NONNULL = YES;
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
CLANG_CXX_LIBRARY = "libc++";
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 379 B |
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 500 B |
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 404 B |
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 497 B |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 571 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 528 B |
After Width: | Height: | Size: 449 B |
After Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 571 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 622 B |
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 485 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 637 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 651 B |
@ -2,6 +2,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:async/async.dart';
|
import 'package:async/async.dart';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
@ -18,7 +19,10 @@ class Logistics extends StatefulWidget {
|
|||||||
class _LogisticsState extends State<Logistics> {
|
class _LogisticsState extends State<Logistics> {
|
||||||
List<dynamic> goodsList = [];
|
List<dynamic> goodsList = [];
|
||||||
String _orderPayWay = "";
|
String _orderPayWay = "";
|
||||||
|
|
||||||
|
// String _logistics = "";
|
||||||
List _packages = [];
|
List _packages = [];
|
||||||
|
bool _packageInit = false;
|
||||||
int _activePackage = 0;
|
int _activePackage = 0;
|
||||||
final TextEditingController _goodsNameController =
|
final TextEditingController _goodsNameController =
|
||||||
TextEditingController(text: "");
|
TextEditingController(text: "");
|
||||||
@ -43,6 +47,8 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
GoRouterState.of(context).uri.queryParameters["orderNumber"];
|
GoRouterState.of(context).uri.queryParameters["orderNumber"];
|
||||||
String? orderPayWay =
|
String? orderPayWay =
|
||||||
GoRouterState.of(context).uri.queryParameters["orderPayWay"];
|
GoRouterState.of(context).uri.queryParameters["orderPayWay"];
|
||||||
|
String? logistics =
|
||||||
|
GoRouterState.of(context).uri.queryParameters["logistics"];
|
||||||
_orderPayWay = orderPayWay!;
|
_orderPayWay = orderPayWay!;
|
||||||
|
|
||||||
if (orderNumber?.isEmpty ?? true) {
|
if (orderNumber?.isEmpty ?? true) {
|
||||||
@ -54,6 +60,30 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
queryParameters: {"orderNumber": orderNumber});
|
queryParameters: {"orderNumber": orderNumber});
|
||||||
});
|
});
|
||||||
goodsList = response.data["value"];
|
goodsList = response.data["value"];
|
||||||
|
|
||||||
|
if (logistics != null && logistics.isNotEmpty && !_packageInit) {
|
||||||
|
try {
|
||||||
|
List packages = jsonDecode(logistics);
|
||||||
|
|
||||||
|
_packages = packages;
|
||||||
|
|
||||||
|
if (_orderPayWay != "套餐商品") {
|
||||||
|
for (var p in _packages) {
|
||||||
|
p["goods"].forEach((g) {
|
||||||
|
var targetGoods = goodsList
|
||||||
|
.firstWhere((tg) => g["id"] == tg["id"], orElse: () => null);
|
||||||
|
if (targetGoods != null) {
|
||||||
|
targetGoods["goodsNum"] -= g["num"];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_packageInit = true;
|
||||||
|
} catch (e) {
|
||||||
|
e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +103,7 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
if (hasUnAddedGoods) {
|
if (hasUnAddedGoods) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
content: Text("有未添加至包裹的商品"),
|
content: Text("有未添加至包裹的商品"),
|
||||||
|
showCloseIcon: true,
|
||||||
backgroundColor: Colors.redAccent,
|
backgroundColor: Colors.redAccent,
|
||||||
));
|
));
|
||||||
return;
|
return;
|
||||||
@ -90,6 +121,7 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
||||||
backgroundColor: Colors.redAccent,
|
backgroundColor: Colors.redAccent,
|
||||||
|
showCloseIcon: true,
|
||||||
content: Text("有未填写的数据")));
|
content: Text("有未填写的数据")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -184,8 +216,9 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
ScaffoldMessenger.of(context)
|
ScaffoldMessenger.of(context)
|
||||||
.showSnackBar(
|
.showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text(
|
content: Text("请填写完整商品信息"),
|
||||||
"请填写完整商品信息")));
|
showCloseIcon: true,
|
||||||
|
));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int goodsNum = int.parse(
|
int goodsNum = int.parse(
|
||||||
@ -216,77 +249,89 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
child: const Text("添加到包裹"))
|
child: const Text("添加到包裹"))
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: ListView.builder(
|
: goodsList
|
||||||
itemCount: goodsList
|
|
||||||
.where((el) => el["goodsNum"] > 0)
|
.where((el) => el["goodsNum"] > 0)
|
||||||
.length,
|
.isNotEmpty
|
||||||
itemBuilder: (context, index) {
|
? ListView.builder(
|
||||||
final goods = goodsList
|
itemCount: goodsList
|
||||||
.where((el) => el["goodsNum"] > 0)
|
.where(
|
||||||
.toList()[index];
|
(el) => el["goodsNum"] > 0)
|
||||||
return ListTile(
|
.length,
|
||||||
trailing: IconButton(
|
itemBuilder: (context, index) {
|
||||||
icon: const Icon(Icons.add),
|
final goods = goodsList
|
||||||
onPressed: () {
|
.where((el) =>
|
||||||
// 检查商品及规格是否已存在于目标包裹
|
el["goodsNum"] > 0)
|
||||||
int targetIndex = _packages[
|
.toList()[index];
|
||||||
_activePackage]["goods"]
|
return ListTile(
|
||||||
.indexWhere((el) =>
|
trailing: IconButton(
|
||||||
el["id"] ==
|
icon: const Icon(Icons.add),
|
||||||
goods["id"] &&
|
onPressed: () {
|
||||||
goods["wisdGoodsSpec"]
|
// 检查商品及规格是否已存在于目标包裹
|
||||||
["id"] ==
|
int targetIndex = _packages[
|
||||||
el["specId"]);
|
_activePackage]
|
||||||
if (targetIndex != -1) {
|
|
||||||
setState(() {
|
|
||||||
_packages[_activePackage]
|
|
||||||
["goods"]
|
|
||||||
[targetIndex]
|
|
||||||
["num"] += 1;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
_packages[_activePackage]
|
|
||||||
["goods"]
|
["goods"]
|
||||||
.add({
|
.indexWhere((el) =>
|
||||||
"id": goods["id"],
|
el["id"] ==
|
||||||
"specId":
|
goods["id"] &&
|
||||||
goods["wisdGoodsSpec"]
|
goods["wisdGoodsSpec"]
|
||||||
|
["id"] ==
|
||||||
|
el["specId"]);
|
||||||
|
if (targetIndex != -1) {
|
||||||
|
setState(() {
|
||||||
|
_packages[_activePackage]
|
||||||
|
["goods"]
|
||||||
|
[targetIndex]
|
||||||
|
["num"] += 1;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
_packages[_activePackage]
|
||||||
|
["goods"]
|
||||||
|
.add({
|
||||||
|
"id": goods["id"],
|
||||||
|
"specId": goods[
|
||||||
|
"wisdGoodsSpec"]
|
||||||
["id"],
|
["id"],
|
||||||
"name":
|
"name": goods[
|
||||||
goods["goodsName"],
|
"goodsName"],
|
||||||
"spec":
|
"spec": goods?[
|
||||||
goods?["wisdGoodsSpec"]
|
"wisdGoodsSpec"]
|
||||||
?[
|
?[
|
||||||
"specName"] ??
|
"specName"] ??
|
||||||
"",
|
"",
|
||||||
"num": 1
|
"num": 1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var curGoods =
|
var curGoods =
|
||||||
goodsList.firstWhere(
|
goodsList.firstWhere(
|
||||||
(el) =>
|
(el) =>
|
||||||
el["id"] ==
|
el["id"] ==
|
||||||
goods["id"],
|
goods["id"],
|
||||||
orElse: () => -1);
|
orElse: () => -1);
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
curGoods["goodsNum"] -= 1;
|
curGoods["goodsNum"] -= 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
leading: Image.network(
|
||||||
|
goods["goodsPhoto"],
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
"${goods["goodsName"]} - ${goods?["wisdGoodsSpec"]?["specName"] ?? ''}"),
|
||||||
|
subtitle: Text(
|
||||||
|
"数量 : ${goods?["goodsNum"]}"),
|
||||||
|
);
|
||||||
|
})
|
||||||
|
: const Center(
|
||||||
|
child: Icon(
|
||||||
|
CupertinoIcons.circle,
|
||||||
|
size: 36,
|
||||||
),
|
),
|
||||||
leading: Image.network(
|
)),
|
||||||
goods["goodsPhoto"],
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
),
|
|
||||||
title: Text(
|
|
||||||
"${goods["goodsName"]} - ${goods?["wisdGoodsSpec"]?["specName"] ?? ''}"),
|
|
||||||
subtitle: Text(
|
|
||||||
"数量 : ${goods?["goodsNum"]}"),
|
|
||||||
);
|
|
||||||
})),
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 20,
|
width: 20,
|
||||||
),
|
),
|
||||||
@ -300,10 +345,39 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
itemBuilder:
|
itemBuilder:
|
||||||
(BuildContext context, int index) {
|
(BuildContext context, int index) {
|
||||||
return PackageCard(
|
return PackageCard(
|
||||||
|
logisticsNumber: _packages[index]
|
||||||
|
["logisticsNumber"],
|
||||||
|
onDeleteGoods: (goods) {
|
||||||
|
if (goods["num"] == 1) {
|
||||||
|
setState(() {
|
||||||
|
_packages[index]["goods"] =
|
||||||
|
_packages[index]["goods"]
|
||||||
|
.where((el) =>
|
||||||
|
el["id"] !=
|
||||||
|
goods["id"])
|
||||||
|
.toList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setState(() {
|
||||||
|
goods["num"] -= 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (_orderPayWay != "套餐商品") {
|
||||||
|
setState(() {
|
||||||
|
goodsList.firstWhere(
|
||||||
|
(e) =>
|
||||||
|
goods["id"] ==
|
||||||
|
e["id"],
|
||||||
|
orElse: () => null)?[
|
||||||
|
"goodsNum"] += 1;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
onLogisticsChanged: (value) {
|
onLogisticsChanged: (value) {
|
||||||
_packages[index]
|
_packages[index]
|
||||||
["logisticsNumber"] = value;
|
["logisticsNumber"] = value;
|
||||||
},
|
},
|
||||||
|
orderPayWay: _orderPayWay,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
_activePackage = index;
|
_activePackage = index;
|
||||||
@ -312,6 +386,23 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
onClose: () {
|
onClose: () {
|
||||||
var curId =
|
var curId =
|
||||||
_packages[index]["id"];
|
_packages[index]["id"];
|
||||||
|
if (_orderPayWay != "套餐商品") {
|
||||||
|
_packages[index]["goods"]
|
||||||
|
.forEach((el) {
|
||||||
|
var targetGoods =
|
||||||
|
goodsList.firstWhere(
|
||||||
|
(goodsItem) =>
|
||||||
|
goodsItem["id"] ==
|
||||||
|
el["id"],
|
||||||
|
orElse: () => -1);
|
||||||
|
if (targetGoods != -1) {
|
||||||
|
setState(() {
|
||||||
|
targetGoods["goodsNum"] +=
|
||||||
|
el["num"];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
_activePackage =
|
_activePackage =
|
||||||
_activePackage >= index
|
_activePackage >= index
|
||||||
@ -341,6 +432,7 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
"goods": []
|
"goods": []
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
_activePackage += 1;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: const Text("添加包裹"))
|
child: const Text("添加包裹"))
|
||||||
@ -351,10 +443,14 @@ class _LogisticsState extends State<Logistics> {
|
|||||||
);
|
);
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
return const Center(
|
return const Center(
|
||||||
child: Icon(
|
child: Column(
|
||||||
Icons.error_outline,
|
children: [
|
||||||
color: Colors.red,
|
Icon(
|
||||||
size: 60,
|
Icons.error_outline,
|
||||||
|
color: Colors.red,
|
||||||
|
size: 60,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -375,21 +471,36 @@ class PackageCard extends StatefulWidget {
|
|||||||
required this.onLogisticsChanged,
|
required this.onLogisticsChanged,
|
||||||
required this.totalPackagesCount,
|
required this.totalPackagesCount,
|
||||||
required this.onClose,
|
required this.onClose,
|
||||||
|
required this.orderPayWay,
|
||||||
|
required this.onDeleteGoods,
|
||||||
|
required this.logisticsNumber,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool isActive;
|
final bool isActive;
|
||||||
final Function() onTap;
|
final Function() onTap;
|
||||||
final Function() onClose;
|
final Function() onClose;
|
||||||
|
final Function(Map<String, dynamic> goods) onDeleteGoods;
|
||||||
final Map<String, dynamic> package;
|
final Map<String, dynamic> package;
|
||||||
final int index;
|
final int index;
|
||||||
final Function(String) onLogisticsChanged;
|
final Function(String) onLogisticsChanged;
|
||||||
final int totalPackagesCount;
|
final int totalPackagesCount;
|
||||||
|
final String orderPayWay;
|
||||||
|
final String logisticsNumber;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PackageCard> createState() => _PackageCardState();
|
State<PackageCard> createState() => _PackageCardState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PackageCardState extends State<PackageCard> {
|
class _PackageCardState extends State<PackageCard> {
|
||||||
|
final TextEditingController _logisticsController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// TODO: implement initState
|
||||||
|
super.initState();
|
||||||
|
_logisticsController.text = widget.logisticsNumber;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
@ -417,6 +528,7 @@ class _PackageCardState extends State<PackageCard> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
TextField(
|
||||||
|
controller: _logisticsController,
|
||||||
onChanged: widget.onLogisticsChanged,
|
onChanged: widget.onLogisticsChanged,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
border: OutlineInputBorder(), labelText: "物流单号"),
|
border: OutlineInputBorder(), labelText: "物流单号"),
|
||||||
@ -427,13 +539,26 @@ class _PackageCardState extends State<PackageCard> {
|
|||||||
DataTable(columns: const [
|
DataTable(columns: const [
|
||||||
DataColumn(label: Text("名称")),
|
DataColumn(label: Text("名称")),
|
||||||
DataColumn(label: Text("规格")),
|
DataColumn(label: Text("规格")),
|
||||||
DataColumn(label: Text("数量"))
|
DataColumn(label: Text("数量")),
|
||||||
|
DataColumn(label: Text("操作"))
|
||||||
], rows: [
|
], rows: [
|
||||||
for (var goodsItem in widget.package["goods"])
|
for (var goodsItem
|
||||||
|
in widget.package["goods"].asMap().entries)
|
||||||
DataRow(cells: [
|
DataRow(cells: [
|
||||||
DataCell(Text("${goodsItem["name"]}")),
|
DataCell(Text("${goodsItem.value["name"]}")),
|
||||||
DataCell(Text("${goodsItem["spec"]}")),
|
DataCell(Text("${goodsItem.value["spec"]}")),
|
||||||
DataCell(Text("${goodsItem["num"]}")),
|
DataCell(Text("${goodsItem.value["num"]}")),
|
||||||
|
DataCell(SizedBox(
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
child: IconButton(
|
||||||
|
icon: const Icon(CupertinoIcons.delete),
|
||||||
|
iconSize: 16,
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
onPressed: () {
|
||||||
|
widget.onDeleteGoods(goodsItem.value);
|
||||||
|
}),
|
||||||
|
)),
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
|
@ -5,6 +5,8 @@ import 'package:file_picker/file_picker.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class OrderList extends StatefulWidget {
|
class OrderList extends StatefulWidget {
|
||||||
const OrderList({super.key});
|
const OrderList({super.key});
|
||||||
@ -61,155 +63,163 @@ class _OrderListState extends State<OrderList> {
|
|||||||
Card(
|
Card(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: /*Scrollbar(
|
child: Scrollbar(
|
||||||
// controller: scrollController,
|
controller: scrollController,
|
||||||
child:*/
|
child: SingleChildScrollView(
|
||||||
SingleChildScrollView(
|
controller: scrollController,
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: DataTable(
|
child: DataTable(
|
||||||
columns: _headers.map((el) {
|
columns: _headers.map((el) {
|
||||||
return DataColumn(label: Text(el));
|
return DataColumn(label: Text(el));
|
||||||
}).toList(),
|
}).toList(),
|
||||||
rows: _data.asMap().entries.map((row) {
|
rows: _data.asMap().entries.map((row) {
|
||||||
return DataRow(
|
return DataRow(
|
||||||
cells: row.value.asMap().entries.map((col) {
|
cells: row.value.asMap().entries.map((col) {
|
||||||
String colTitle = _headers[col.key];
|
String colTitle = _headers[col.key];
|
||||||
return DataCell(colTitle == "物流名称"
|
return DataCell(colTitle == "物流名称"
|
||||||
? Row(
|
|
||||||
children: [
|
|
||||||
Text("${col.value}"),
|
|
||||||
IconButton(
|
|
||||||
// padding: EdgeInsets.all(2),
|
|
||||||
iconSize: 12,
|
|
||||||
onPressed: () {
|
|
||||||
_logComController.text =
|
|
||||||
_data[row.key][col.key]
|
|
||||||
.toString();
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext
|
|
||||||
context) =>
|
|
||||||
AlertDialog(
|
|
||||||
// icon: const Icon(Icons.edit),
|
|
||||||
title: const Text(
|
|
||||||
"填写物流公司"),
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
TextField(
|
|
||||||
decoration:
|
|
||||||
const InputDecoration(
|
|
||||||
labelText:
|
|
||||||
"物流公司"),
|
|
||||||
controller:
|
|
||||||
_logComController,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
child: const Text(
|
|
||||||
"取消")),
|
|
||||||
ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
String
|
|
||||||
logisticsCom =
|
|
||||||
_logComController
|
|
||||||
.text;
|
|
||||||
if (logisticsCom
|
|
||||||
.isEmpty) {
|
|
||||||
ScaffoldMessenger.of(
|
|
||||||
context)
|
|
||||||
.showSnackBar(const SnackBar(
|
|
||||||
content:
|
|
||||||
Text("请输入物流公司")));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final data =
|
|
||||||
_data;
|
|
||||||
_data[row.key][
|
|
||||||
col.key] =
|
|
||||||
logisticsCom;
|
|
||||||
setState(() {
|
|
||||||
_data = data;
|
|
||||||
});
|
|
||||||
context.pop();
|
|
||||||
},
|
|
||||||
child: const Text(
|
|
||||||
"确认")),
|
|
||||||
],
|
|
||||||
));
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.edit))
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: colTitle == "物流信息"
|
|
||||||
? Row(
|
? Row(
|
||||||
children: [
|
children: [
|
||||||
_data[row.key][col.key]
|
Text("${col.value}"),
|
||||||
.toString()
|
IconButton(
|
||||||
.isNotEmpty
|
// padding: EdgeInsets.all(2),
|
||||||
? SizedBox(
|
iconSize: 12,
|
||||||
width: 120,
|
onPressed: () {
|
||||||
child: Text(
|
_logComController.text =
|
||||||
_data[row.key][col.key].toString(),
|
_data[row.key][col.key]
|
||||||
overflow:
|
.toString();
|
||||||
TextOverflow.ellipsis,
|
showDialog(
|
||||||
),
|
context: context,
|
||||||
)
|
builder:
|
||||||
: const SizedBox(),
|
(BuildContext
|
||||||
ElevatedButton(
|
context) =>
|
||||||
onPressed: () {
|
AlertDialog(
|
||||||
String orderNumber =
|
// icon: const Icon(Icons.edit),
|
||||||
_data[row.key][2]
|
title: const Text(
|
||||||
.toString();
|
"填写物流公司"),
|
||||||
String orderPayWay =
|
content: Column(
|
||||||
_data[row.key][15]
|
mainAxisSize:
|
||||||
.toString();
|
MainAxisSize
|
||||||
if (orderPayWay.isEmpty ||
|
.min,
|
||||||
orderNumber.isEmpty) {
|
children: [
|
||||||
ScaffoldMessenger.of(context)
|
TextField(
|
||||||
.showSnackBar(
|
decoration:
|
||||||
const SnackBar(
|
const InputDecoration(
|
||||||
content: Text(
|
labelText: "物流公司"),
|
||||||
"该行数据有误")));
|
controller:
|
||||||
return;
|
_logComController,
|
||||||
}
|
)
|
||||||
context.pushNamed("logistics",
|
],
|
||||||
queryParameters: {
|
),
|
||||||
"orderNumber":
|
actions: [
|
||||||
_data[row.key][2]
|
ElevatedButton(
|
||||||
.toString(),
|
onPressed:
|
||||||
"orderPayWay":
|
() {
|
||||||
_data[row.key][15]
|
context
|
||||||
.toString(),
|
.pop();
|
||||||
}).then((value) {
|
},
|
||||||
if (value != null) {
|
child: const Text(
|
||||||
var newData = _data;
|
"取消")),
|
||||||
newData[row.key][col.key] =
|
ElevatedButton(
|
||||||
value;
|
onPressed:
|
||||||
setState(() {
|
() {
|
||||||
_data = newData;
|
String
|
||||||
});
|
logisticsCom =
|
||||||
}
|
_logComController.text;
|
||||||
});
|
if (logisticsCom
|
||||||
},
|
.isEmpty) {
|
||||||
child: const Text("填写"),
|
ScaffoldMessenger.of(context)
|
||||||
)
|
.showSnackBar(const SnackBar(content: Text("请输入物流公司")));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final data =
|
||||||
|
_data;
|
||||||
|
_data[row.key][col.key] =
|
||||||
|
logisticsCom;
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
_data =
|
||||||
|
data;
|
||||||
|
});
|
||||||
|
context
|
||||||
|
.pop();
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
"确认")),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.edit))
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: Text("${col.value}"));
|
: colTitle == "物流信息"
|
||||||
}).toList());
|
? Row(
|
||||||
}).toList(),
|
children: [
|
||||||
),
|
_data[row.key][col.key]
|
||||||
)
|
.toString()
|
||||||
/*)*/
|
.isNotEmpty
|
||||||
,
|
? SizedBox(
|
||||||
|
width: 120,
|
||||||
|
child: Text(
|
||||||
|
_data[row.key]
|
||||||
|
[col.key]
|
||||||
|
.toString(),
|
||||||
|
overflow: TextOverflow
|
||||||
|
.ellipsis,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
String orderNumber =
|
||||||
|
_data[row.key][2]
|
||||||
|
.toString();
|
||||||
|
String orderPayWay =
|
||||||
|
_data[row.key][15]
|
||||||
|
.toString();
|
||||||
|
if (orderPayWay.isEmpty ||
|
||||||
|
orderNumber.isEmpty) {
|
||||||
|
ScaffoldMessenger.of(
|
||||||
|
context)
|
||||||
|
.showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text("该行数据有误"),
|
||||||
|
showCloseIcon: true,
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.pushNamed(
|
||||||
|
"logistics",
|
||||||
|
queryParameters: {
|
||||||
|
"orderNumber":
|
||||||
|
_data[row.key][2]
|
||||||
|
.toString(),
|
||||||
|
"orderPayWay":
|
||||||
|
_data[row.key][15]
|
||||||
|
.toString(),
|
||||||
|
"logistics":
|
||||||
|
_data[row.key][12]
|
||||||
|
.toString()
|
||||||
|
}).then((value) {
|
||||||
|
if (value != null) {
|
||||||
|
var newData = _data;
|
||||||
|
newData[row.key]
|
||||||
|
[col.key] = value;
|
||||||
|
setState(() {
|
||||||
|
_data = newData;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: const Text("填写"),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Text("${col.value}"));
|
||||||
|
}).toList());
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
)),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -268,18 +278,34 @@ class _OrderListState extends State<OrderList> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
var fileBytes = _excel.save();
|
var fileBytes = _excel.save();
|
||||||
String? directory =
|
String fileName = "导出订单${DateTime.now().millisecondsSinceEpoch}.xlsx";
|
||||||
await FilePicker.platform.getDirectoryPath(dialogTitle: "选择保存位置");
|
String? outputPath = await FilePicker.platform.saveFile(
|
||||||
if (directory == null || directory.isEmpty) {
|
dialogTitle: "选择保存位置",
|
||||||
|
fileName: fileName,
|
||||||
|
type: FileType.custom,
|
||||||
|
allowedExtensions: ["xlsx", "xls"]);
|
||||||
|
if (outputPath == null || outputPath.isEmpty) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File("$directory\\导出订单${DateTime.now().millisecondsSinceEpoch}.xlsx")
|
File(outputPath)
|
||||||
..createSync(recursive: true)
|
..createSync(recursive: true)
|
||||||
..writeAsBytesSync(fileBytes!);
|
..writeAsBytesSync(fileBytes!);
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||||
content: Text("导出文件成功"),
|
content: const Text("导出文件成功"),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
|
action: SnackBarAction(
|
||||||
|
label: "打开文件所在位置",
|
||||||
|
onPressed: () {
|
||||||
|
final Uri fileUrl = Uri(
|
||||||
|
scheme: "file",
|
||||||
|
path: p.dirname(outputPath),
|
||||||
|
);
|
||||||
|
launchUrl(fileUrl, mode: LaunchMode.externalApplication);
|
||||||
|
},
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
textColor: Colors.green,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||||
|
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
@ -6,7 +6,9 @@ import FlutterMacOS
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
|
import url_launcher_macos
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
}
|
}
|
||||||
|
122
pubspec.lock
@ -9,6 +9,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.4.9"
|
version: "3.4.9"
|
||||||
|
args:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: args
|
||||||
|
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.5.0"
|
||||||
async:
|
async:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -33,6 +41,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
checked_yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: checked_yaml
|
||||||
|
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.3"
|
||||||
|
cli_util:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: cli_util
|
||||||
|
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.4.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -142,6 +166,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_launcher_icons:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_launcher_icons
|
||||||
|
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.13.1"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -184,6 +216,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
|
image:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: image
|
||||||
|
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.2.0"
|
||||||
js:
|
js:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -192,6 +232,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.1"
|
version: "0.7.1"
|
||||||
|
json_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_annotation
|
||||||
|
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.9.0"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -257,7 +305,7 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.0"
|
version: "1.12.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||||
@ -413,6 +461,70 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.2"
|
version: "1.3.2"
|
||||||
|
url_launcher:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: url_launcher
|
||||||
|
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.0"
|
||||||
|
url_launcher_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_android
|
||||||
|
sha256: ceb2625f0c24ade6ef6778d1de0b2e44f2db71fded235eb52295247feba8c5cf
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.3"
|
||||||
|
url_launcher_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_ios
|
||||||
|
sha256: "7068716403343f6ba4969b4173cbf3b84fc768042124bc2c011e5d782b24fe89"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.3.0"
|
||||||
|
url_launcher_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_linux
|
||||||
|
sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
|
url_launcher_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_macos
|
||||||
|
sha256: "9a1a42d5d2d95400c795b2914c36fdcb525870c752569438e4ebb09a2b5d90de"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.2.0"
|
||||||
|
url_launcher_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_platform_interface
|
||||||
|
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.2"
|
||||||
|
url_launcher_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_web
|
||||||
|
sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.1"
|
||||||
|
url_launcher_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: url_launcher_windows
|
||||||
|
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.1"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -469,6 +581,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.5.0"
|
version: "6.5.0"
|
||||||
|
yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: yaml
|
||||||
|
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.4.1 <4.0.0"
|
dart: ">=3.4.1 <4.0.0"
|
||||||
flutter: ">=3.22.0"
|
flutter: ">=3.22.0"
|
||||||
|
@ -42,6 +42,9 @@ dependencies:
|
|||||||
path_provider: ^2.1.3
|
path_provider: ^2.1.3
|
||||||
uuid: ^4.4.0
|
uuid: ^4.4.0
|
||||||
async: ^2.11.0
|
async: ^2.11.0
|
||||||
|
url_launcher: ^6.3.0
|
||||||
|
path: ^1.9.0
|
||||||
|
flutter_launcher_icons: ^0.13.1
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||||
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 451 B |