mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 00:51:19 +00:00
87 lines
2.8 KiB
Dart
87 lines
2.8 KiB
Dart
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';
|
|
|
|
import 'custom_clipper.dart';
|
|
|
|
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
final double _preferredHeight = 55;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Size size = MediaQuery.of(context).size;
|
|
final index = Provider.of<Index>(context);
|
|
final notchInset = MediaQuery.of(context).padding;
|
|
return Container(
|
|
alignment: Alignment.bottomCenter,
|
|
child: Stack(
|
|
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: <Widget>[
|
|
/*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';
|
|
}
|
|
} |