mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 06:19:35 +00:00
媒体库上拉刷新,下拉加载
This commit is contained in:
parent
bdd85efcd8
commit
ebcbe1774a
20 changed files with 351 additions and 126 deletions
33
lib/shared/utils/components.dart
Normal file
33
lib/shared/utils/components.dart
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import 'package:easy_refresh/easy_refresh.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:vaani/generated/l10n.dart';
|
||||
|
||||
class Components {
|
||||
Components._();
|
||||
static ClassicHeader easyRefreshHeader(BuildContext context) {
|
||||
return ClassicHeader(
|
||||
dragText: S.of(context).erDragText,
|
||||
armedText: S.of(context).erArmedText,
|
||||
readyText: S.of(context).erReadyText,
|
||||
processingText: S.of(context).erProcessingText,
|
||||
processedText: S.of(context).erProcessedText,
|
||||
noMoreText: S.of(context).erNoMoreText,
|
||||
failedText: S.of(context).erFailedText,
|
||||
messageText: S.of(context).erMessageText,
|
||||
);
|
||||
}
|
||||
|
||||
static ClassicFooter easyRefreshFooter(BuildContext context) {
|
||||
return ClassicFooter(
|
||||
dragText: S.of(context).erDragTextUp,
|
||||
armedText: S.of(context).erArmedText,
|
||||
readyText: S.of(context).erReadyText,
|
||||
processingText: S.of(context).erProcessingText,
|
||||
processedText: S.of(context).erProcessedText,
|
||||
noMoreText: S.of(context).erNoMoreText,
|
||||
failedText: S.of(context).erFailedText,
|
||||
messageText: S.of(context).erMessageText,
|
||||
infiniteOffset: 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
38
lib/shared/utils/custom_dialog.dart
Normal file
38
lib/shared/utils/custom_dialog.dart
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:vaani/generated/l10n.dart';
|
||||
|
||||
class DialogUtils {
|
||||
DialogUtils._();
|
||||
|
||||
// 自定义删除 dialog
|
||||
static deleteDialog(
|
||||
BuildContext context, {
|
||||
String? name,
|
||||
required Function() onPressed,
|
||||
}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).delete),
|
||||
content: Text(S.of(context).deleteDialog(name ?? '')),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
onPressed();
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(S.of(context).yes),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(S.of(context).no),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue