admin
2022-05-12 fa705507ba574c857b1667553737d23b1b7ff495
src/main/resources/code/flutter_module/lib/ui/widget/nav.dart
@@ -18,9 +18,12 @@
class TopNavBar extends StatelessWidget {
  final String title;
  GestureTapCallback? back;
  GestureTapCallback? leftWidgetClick;
  String? rightText;
  String? leftText;
  Widget? leftWidget;
  Icon? rightIcon;
  Image? rightImage;
  GestureTapCallback? rightClick;
  final Color textColor;
  final Color backGround;
@@ -31,6 +34,9 @@
      this.back,
      this.rightText,
      this.rightIcon,
      this.leftWidget,
      this.leftWidgetClick,
      this.rightImage,
      this.leftText = "",
      this.rightClick,
      this.textColor = const Color(0xFF333333),
@@ -77,7 +83,9 @@
                        )
                      ],
                    ))),
            ((rightText != null && rightText!.isNotEmpty) || rightIcon != null)
            ((rightText != null && rightText!.isNotEmpty) ||
                    rightIcon != null ||
                    rightImage != null)
                ? Positioned(
                    right: 0,
                    top: 0,
@@ -90,11 +98,12 @@
                          alignment: Alignment.center,
                          padding: const EdgeInsets.only(right: 10),
                          child: rightIcon ??
                              Text(
                                rightText!,
                                style:
                                    TextStyle(fontSize: 15, color: textColor),
                              ),
                              (rightImage ??
                                  Text(
                                    rightText!,
                                    style: TextStyle(
                                        fontSize: 15, color: textColor),
                                  )),
                        )))
                : Container(),
            InkWell(
@@ -102,24 +111,38 @@
                  if (back != null) {
                    back!();
                  } else {
                   popPage(context);
                    popPage(context);
                  }
                },
                child: Container(
                  padding: const EdgeInsets.only(left: 10),
                  height: 48,
                  child: Row(mainAxisSize: MainAxisSize.min,crossAxisAlignment: CrossAxisAlignment.center, children: [
                    Icon(
                      Icons.arrow_back_ios,
                      color: textColor,
                    ),
                    leftText!.isNotEmpty
                        ? Text(
                            leftText!,
                            style: const TextStyle(fontSize: 16),
                          )
                        : Container()
                  ]),
                  child: Row(
                      mainAxisSize: MainAxisSize.min,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        Icon(
                          Icons.arrow_back_ios,
                          color: textColor,
                        ),
                        leftText!.isNotEmpty
                            ? Text(
                                leftText!,
                                style: const TextStyle(fontSize: 16),
                              )
                            : Container(),
                        leftWidget == null
                            ? Container()
                            : InkWell(
                                onTap: () {
                                  if (leftWidgetClick == null) {
                                    return;
                                  }
                                  leftWidgetClick!();
                                },
                                child: leftWidget!,
                              )
                      ]),
                ))
          ],
        ),