import 'package:wanisdriver/widgets/custom_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import '../utils/colors.dart'; class PurpleHeader extends StatelessWidget { String title; PurpleHeader({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { return Stack( children: [ SvgPicture.asset( 'assets/images/topcurvehistoryscreen.svg', // Replace with your image asset path fit: BoxFit.cover, height: MediaQuery.of(context).size.height * 0.2, color: Theme.of(context).brightness == Brightness.dark ?AppColors.darkPrimaryColor:AppColors.primaryColor, ), Positioned( top: MediaQuery.of(context).size.height * 0.08, left: MediaQuery.of(context).size.width * 0.05, child: Txt( text: title, style: const TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, letterSpacing: 1, color: Colors.white, ), ), ), ], ); } } class PurpleHeaderWithReturnBtn extends StatelessWidget { String title; PurpleHeaderWithReturnBtn({Key? key, required this.title}) : super(key: key); @override Widget build(BuildContext context) { return Stack( children: [ /*SvgPicture.asset( 'assets/images/topcurvehistoryscreen.svg', // Replace with your image asset path fit: BoxFit.fill, height: MediaQuery.of(context).size.height * 0.19, color: Theme.of(context).brightness == Brightness.dark ?AppColors.darkPrimaryColor:AppColors.primaryColor, ),*/ Positioned( top: MediaQuery.of(context).size.height * 0.08, left: MediaQuery.of(context).size.width * 0.05, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ InkWell( onTap: () => Navigator.pop(context), child: const Icon(Icons.arrow_back_ios,color: Colors.white,)), Txt( text: title, style: const TextStyle( fontSize: 32.0, fontWeight: FontWeight.bold, letterSpacing: 1, color: Colors.black, ), ), ], ), ), ], ); } }