| | |
| | | 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; |
| | |
| | | this.back, |
| | | this.rightText, |
| | | this.rightIcon, |
| | | this.leftWidget, |
| | | this.leftWidgetClick, |
| | | this.rightImage, |
| | | this.leftText = "", |
| | | this.rightClick, |
| | | this.textColor = const Color(0xFF333333), |
| | |
| | | ) |
| | | ], |
| | | ))), |
| | | ((rightText != null && rightText!.isNotEmpty) || rightIcon != null) |
| | | ((rightText != null && rightText!.isNotEmpty) || |
| | | rightIcon != null || |
| | | rightImage != null) |
| | | ? Positioned( |
| | | right: 0, |
| | | top: 0, |
| | |
| | | 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( |
| | |
| | | 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!, |
| | | ) |
| | | ]), |
| | | )) |
| | | ], |
| | | ), |