mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-15 22:56:15 +08:00
opt: pic btn
This commit is contained in:
@@ -536,43 +536,45 @@ class _CreatePanelState extends State<CreatePanel> {
|
|||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (_pathList.length != 9 && index == _pathList.length) {
|
if (_pathList.length != 9 && index == _pathList.length) {
|
||||||
return Material(
|
return Material(
|
||||||
child: Ink(
|
borderRadius: BorderRadius.circular(12),
|
||||||
width: 75,
|
child: InkWell(
|
||||||
height: 75,
|
borderRadius: BorderRadius.circular(12),
|
||||||
decoration: BoxDecoration(
|
onTap: () async {
|
||||||
borderRadius: BorderRadius.circular(12),
|
List<XFile> pickedFiles =
|
||||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
await _imagePicker.pickMultiImage(
|
||||||
),
|
limit: 9,
|
||||||
child: InkWell(
|
imageQuality: 100,
|
||||||
onTap: () async {
|
);
|
||||||
List<XFile> pickedFiles =
|
if (pickedFiles.isNotEmpty) {
|
||||||
await _imagePicker.pickMultiImage(
|
for (int i = 0; i < pickedFiles.length; i++) {
|
||||||
limit: 9,
|
if (_pathList.length == 9) {
|
||||||
imageQuality: 100,
|
SmartDialog.showToast('最多选择9张图片');
|
||||||
);
|
if (i != 0) {
|
||||||
if (pickedFiles.isNotEmpty) {
|
_pathStream.add(_pathList);
|
||||||
for (int i = 0; i < pickedFiles.length; i++) {
|
}
|
||||||
if (_pathList.length == 9) {
|
break;
|
||||||
SmartDialog.showToast('最多选择9张图片');
|
} else {
|
||||||
if (i != 0) {
|
_pathList.add(pickedFiles[i].path);
|
||||||
_pathStream.add(_pathList);
|
if (i == pickedFiles.length - 1) {
|
||||||
}
|
_pathStream.add(_pathList);
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
_pathList.add(pickedFiles[i].path);
|
|
||||||
if (i == pickedFiles.length - 1) {
|
|
||||||
_pathStream.add(_pathList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_pathList.isNotEmpty && !_isEnable) {
|
|
||||||
_isEnable = true;
|
|
||||||
_isEnableStream.add(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
if (_pathList.isNotEmpty && !_isEnable) {
|
||||||
borderRadius: BorderRadius.circular(12),
|
_isEnable = true;
|
||||||
child: const Center(child: Icon(Icons.add)),
|
_isEnableStream.add(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Ink(
|
||||||
|
width: 75,
|
||||||
|
height: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
color:
|
||||||
|
Theme.of(context).colorScheme.secondaryContainer,
|
||||||
|
),
|
||||||
|
child: Center(child: Icon(Icons.add)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user