mod: 代码整理

This commit is contained in:
guozhigq
2023-07-25 23:44:09 +08:00
parent 6d9f66c420
commit 7745ea076b
74 changed files with 387 additions and 424 deletions

View File

@ -1,8 +1,9 @@
// ignore_for_file: library_private_types_in_public_api
import 'package:dismissible_page/dismissible_page.dart';
import 'package:get/get.dart';
import 'package:flutter/material.dart';
import 'package:extended_image/extended_image.dart';
import 'package:pilipala/common/widgets/appbar.dart';
import 'controller.dart';
typedef DoubleClickAnimationListener = void Function();
@ -145,6 +146,8 @@ class _ImagePreviewState extends State<ImagePreview>
],
),
);
} else {
return const SizedBox();
}
},
initGestureConfigHandler: (ExtendedImageState state) {
@ -168,7 +171,8 @@ class _ImagePreviewState extends State<ImagePreview>
bottom: 0,
child: Container(
// height: 45,
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom, top: 20),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom, top: 20),
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
@ -186,23 +190,29 @@ class _ImagePreviewState extends State<ImagePreview>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Obx(
() => Text.rich(
() => Text.rich(
TextSpan(
style: const TextStyle(
color: Colors.white,
fontSize: 18
),
style: const TextStyle(
color: Colors.white, fontSize: 18),
children: [
TextSpan(text: _previewController.currentPage.toString()),
const TextSpan(text: ' / '),
TextSpan(text: _previewController.imgList.length.toString()),
]),
TextSpan(
text:
_previewController.currentPage.toString()),
const TextSpan(text: ' / '),
TextSpan(
text: _previewController.imgList.length
.toString()),
]),
),
),
const Spacer(),
ElevatedButton(onPressed: () => _previewController.onShareImg(), child: Text('分享')),
ElevatedButton(
onPressed: () => _previewController.onShareImg(),
child: const Text('分享')),
const SizedBox(width: 10),
ElevatedButton(onPressed: () => _previewController.onSaveImg(), child: Text('保存'))
ElevatedButton(
onPressed: () => _previewController.onSaveImg(),
child: const Text('保存'))
],
),
),