import 'package:flutter/material.dart'; class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { final String title; const CustomAppBar({Key? key, required this.title}) : super(key: key); @override Size get preferredSize => const Size.fromHeight(kToolbarHeight); @override Widget build(BuildContext context) { return AppBar( backgroundColor: Colors.transparent, elevation: 5, flexibleSpace: Container( decoration: const BoxDecoration( gradient: LinearGradient( colors: [Colors.white, const Color.fromARGB(255, 4, 54, 95)], begin: Alignment.topLeft, end: Alignment.bottomRight, ), ), child: Row( children: [ const Spacer(), Align( alignment: Alignment.center, child: Text( title, style: const TextStyle( fontSize: 25, color: Colors.white, ), ), ), const Spacer(), Padding( padding: const EdgeInsets.only(right: 10.0), child: Align( alignment: Alignment.centerRight, child: Image.asset( 'assets/youmaz2.png', width: 100, height: 50, ), ), ), ], ), ), ); } }