import 'package:flutter/material.dart'; //import 'package:flutter_svg/svg.dart'; import 'package:myhomie_app/Screens/Main/MainPage.dart'; import 'package:myhomie_app/Screens/Main/index.dart'; import 'package:myhomie_app/constants.dart'; import 'package:provider/provider.dart'; class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { final double _preferredHeight = 50; @override Widget build(BuildContext context) { Size size = MediaQuery.of(context).size; final index = Provider.of(context); final notchInset = MediaQuery.of(context).padding; return Container( alignment: Alignment.bottomCenter, child: Stack( //mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ /*Positioned( top: -20, left: -1, child: SvgPicture.asset( 'assets/images/hungry/top_bar.svg', width: size.width * 1.01, ) ),*/ Positioned( bottom: 0, child: ClipPath( //clipper: WaveClipper(), clipBehavior: Clip.hardEdge, child: Container( height: size.height * 0.4, width: MediaQuery.of(context).size.width, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.centerRight, end: Alignment.centerLeft, colors: [ /*Color(0xFFDD79C2), Color(0xFFB65FBE), Color(0xFF9146BA), Color(0xFF7633B8), Color(0xFF6528B6), Color(0xFF6025B6)*/ Color(0xFF306bac), Color(0xFF308aae), Color(0xFF309cb0), ], ), ), ), ), ), Positioned.fill( child: Padding( padding: EdgeInsets.only(top: notchInset.top + 10), child: Align( alignment: Alignment.topCenter, child: Text( index.getTitle(), style: kHeadingTextStyle, ), ), ), ), /*IconButton(icon: Icon(Icons.menu), onPressed: () {}), Text( getPageTitle(), style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500), ), IconButton(icon: Icon(Icons.favorite), onPressed: () {}),*/ ], ), ); } @override Size get preferredSize => Size.fromHeight(_preferredHeight); getPageTitle() { return currentIndex == 0 ? 'MyHomie' : 'other'; } }