Skip to content

Commit

Permalink
Merge branch 'v2.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
guanyiyao committed Dec 21, 2024
2 parents ab5c3a7 + 098963c commit a0b95d6
Show file tree
Hide file tree
Showing 8 changed files with 476 additions and 381 deletions.
368 changes: 211 additions & 157 deletions lib/page/admin/models_add.dart

Large diffs are not rendered by default.

432 changes: 229 additions & 203 deletions lib/page/admin/models_edit.dart

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions lib/page/component/enhanced_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,8 @@ class EnhancedInput extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width - 160,
),
child: value ?? Container(),
),
const SizedBox(width: 10),
Flexible(child: value ?? Container()),
const SizedBox(width: 5),
icon ??
const Icon(
CupertinoIcons.chevron_forward,
Expand Down
31 changes: 22 additions & 9 deletions lib/page/component/enhanced_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {

@override
Widget build(BuildContext context) {
if ((widget.labelText != null || widget.labelWidget != null) && widget.labelPosition != LabelPosition.inner) {
if ((widget.labelText != null || widget.labelWidget != null) &&
widget.labelPosition != LabelPosition.inner) {
// 上下结构
if (widget.labelPosition == LabelPosition.top) {
return Column(
Expand All @@ -167,7 +168,8 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {
),
),
const SizedBox(width: 5),
if (widget.labelHelpWidget != null) widget.labelHelpWidget!,
if (widget.labelHelpWidget != null)
widget.labelHelpWidget!,
],
),
if (widget.inputSelector != null) widget.inputSelector!,
Expand Down Expand Up @@ -253,8 +255,10 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {
fillColor: widget.customColors.textfieldBackgroundColor,
hintText: widget.hintText,
hintStyle: TextStyle(
fontSize: widget.hintTextSize ?? CustomSize.defaultHintTextSize,
color: widget.hintColor ?? widget.customColors.textfieldHintColor,
fontSize: widget.hintTextSize ??
CustomSize.defaultHintTextSize,
color: widget.hintColor ??
widget.customColors.textfieldHintColor,
),
hintTextDirection: widget.textDirection,
counterText: "",
Expand All @@ -266,16 +270,22 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {
top: widget.labelPosition == LabelPosition.top ? 0 : 10,
left: widget.enableBackground ? 15 : 0,
right: widget.enableBackground ? 15 : 0,
bottom: (widget.showCounter || widget.bottomButton != null) && widget.middleWidget == null
bottom: (widget.showCounter ||
widget.bottomButton != null) &&
widget.middleWidget == null
? 30
: 10,
),
labelText: widget.labelPosition == LabelPosition.inner ? widget.labelText : null,
labelText: widget.labelPosition == LabelPosition.inner
? widget.labelText
: null,
labelStyle: TextStyle(
color: widget.customColors.textfieldLabelColor,
),
suffixIcon: widget.suffixIcon ??
(widget.labelPosition == LabelPosition.left ? widget.inputSelector : null),
(widget.labelPosition == LabelPosition.left
? widget.inputSelector
: null),
),
cursorRadius: CustomSize.radius,
keyboardType: widget.keyboardType,
Expand Down Expand Up @@ -327,7 +337,8 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {
highlightColor: Colors.transparent,
padding: const EdgeInsets.all(0),
minWidth: 60,
shape: RoundedRectangleBorder(borderRadius: CustomSize.borderRadius),
shape: RoundedRectangleBorder(
borderRadius: CustomSize.borderRadius),
onPressed: widget.bottomButtonOnPressed,
child: widget.bottomButton!,
),
Expand All @@ -340,7 +351,9 @@ class _EnhancedTextFieldState extends State<EnhancedTextField> {

InputBorder resolveInputBorder() {
if (widget.enableBackground) {
return const OutlineInputBorder(borderRadius: CustomSize.borderRadiusAll, borderSide: BorderSide.none);
return const OutlineInputBorder(
borderRadius: CustomSize.borderRadiusAll,
borderSide: BorderSide.none);
}

return InputBorder.none;
Expand Down
4 changes: 1 addition & 3 deletions lib/page/component/model_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ class _ModelItemState extends State<ModelItem> {
child: buildTag(
customColors,
tag,
tagBgColor: selectedTag == tag
? colorToString(customColors.linkColor ?? Colors.green)
: colorToString(customColors.tagsBackground ?? Colors.grey),
tagBgColor: selectedTag == tag ? 'FF4CAF50' : '2A9E9E9E',
tagTextColor: selectedTag == tag ? 'FFFFFFFF' : null,
tagFontSize: 12,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/page/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class _LeftDrawerState extends State<LeftDrawer> {
child: Column(
children: [
SizedBox(
height: 150,
height: 180,
child: DrawerHeader(
padding: PlatformTool.isMacOS()
? const EdgeInsets.only(top: kToolbarHeight)
: const EdgeInsets.all(0),
: const EdgeInsets.only(top: 20),
margin: const EdgeInsets.all(0),
// decoration: BoxDecoration(
// color: Colors.white,
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
animated_list_plus:
dependency: "direct main"
description:
name: animated_list_plus
sha256: fb3d7f1fbaf5af84907f3c739236bacda8bf32cbe1f118dd51510752883ff50c
url: "https://pub.dev"
source: hosted
version: "0.5.2"
animated_text_kit:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ dependencies:
camerawesome: ^2.1.0
flutter_markdown_latex: ^0.3.4
auto_size_text: ^3.0.0
animated_list_plus: ^0.5.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit a0b95d6

Please sign in to comment.