dreampad/lib/app/shared/widgets/my_back_button.dart

43 lines
991 B
Dart
Raw Normal View History

2023-11-28 10:44:58 +08:00
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../constants/images.dart';
import '../constants/styles.dart';
class MyBackButton extends StatelessWidget {
const MyBackButton({
super.key,
this.onPressed,
});
final VoidCallback? onPressed;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
onPressed?.call();
},
child: Container(
height: 41.h,
color: Colors.transparent,
child: Text.rich(
TextSpan(
children: [
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Images.back,
),
const WidgetSpan(child: RSizedBox(width: 2.0)),
TextSpan(
text: '返回',
style: TextStyles.mediumWhiteShadow26_034,
),
],
),
),
),
);
}
}