You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					139 lines
				
				4.4 KiB
			
		
		
			
		
	
	
					139 lines
				
				4.4 KiB
			| 
											4 years ago
										 | import 'package:cached_network_image/cached_network_image.dart'; | ||
|  | import 'package:teso/Classes/TesoUser.dart'; | ||
|  | import 'package:teso/Pages/Sub_Pages/Notifications/newMessage.dart'; | ||
|  | import 'package:teso/providers/pageAnimations.dart'; | ||
|  | import 'package:teso/util/consts.dart'; | ||
|  | import 'package:flutter/material.dart'; | ||
|  | 
 | ||
|  | buildNotficationHeader( | ||
|  |     BuildContext context, | ||
|  |     Color fcurrentColor, | ||
|  |     Color fcurrentColor1, | ||
|  |     Color fTextColor1, | ||
|  |     Color fTextColor2, | ||
|  |     Function navigationTapped, | ||
|  |     bool status, | ||
|  |     TesoUser user) { | ||
|  |   return Container( | ||
|  |     // margin: EdgeInsets.symmetric(
 | ||
|  |     //   horizontal: MediaQuery.of(context).size.width / 5,
 | ||
|  |     // ),
 | ||
|  |     child: Row( | ||
|  |       mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
|  |       children: <Widget>[ | ||
|  |         Visibility( | ||
|  |           visible: status, | ||
|  |           child: Container( | ||
|  |             width: 50, | ||
|  |             height: 50, | ||
|  |             decoration: BoxDecoration( | ||
|  |               shape: BoxShape.circle, | ||
|  |               //color: Colors.grey,
 | ||
|  |             ), | ||
|  |             child: ClipRRect( | ||
|  |               borderRadius: BorderRadius.only( | ||
|  |                 topLeft: Radius.circular(40.0), | ||
|  |                 topRight: Radius.circular(40.0), | ||
|  |                 bottomLeft: Radius.circular(40), | ||
|  |                 bottomRight: Radius.circular(40), | ||
|  |               ), | ||
|  |               child: user.thumbnail_dp == null | ||
|  |                   ? Center( | ||
|  |                       child: Text( | ||
|  |                         user.username.characters | ||
|  |                             .characterAt(0) | ||
|  |                             .toString() | ||
|  |                             .toUpperCase(), | ||
|  |                       ), | ||
|  |                     ) | ||
|  |                   : CachedNetworkImage( | ||
|  |                       imageUrl: userdpURL + user.thumbnail_dp, | ||
|  |                       imageBuilder: (context, imageProvider) => FadeInImage( | ||
|  |                         height: 90, | ||
|  |                         width: 90, | ||
|  |                         fit: BoxFit.fill, | ||
|  |                         image: imageProvider, | ||
|  |                         placeholder: AssetImage("assets/images/tesoDP/dp1.png"), | ||
|  |                       ), | ||
|  |                     ), | ||
|  |             ), | ||
|  |           ), | ||
|  |         ), | ||
|  |         Container( | ||
|  |           margin: EdgeInsets.symmetric(horizontal: 5.0), | ||
|  |           // padding: EdgeInsets.symmetric(
 | ||
|  |           //   horizontal: 5.0,
 | ||
|  |           // ),
 | ||
|  |           child: Material( | ||
|  |             color: fcurrentColor == null | ||
|  |                 ? Theme.of(context).colorScheme.secondary | ||
|  |                 : fcurrentColor, | ||
|  |             elevation: 0, | ||
|  |             borderRadius: BorderRadius.circular(20.0), | ||
|  |             shadowColor: Theme.of(context).backgroundColor, | ||
|  |             child: InkWell( | ||
|  |               onTap: () => navigationTapped(0), | ||
|  |               child: Padding( | ||
|  |                 padding: const EdgeInsets.all(10.0), | ||
|  |                 child: Text( | ||
|  |                   "Updates", | ||
|  |                   style: TextStyle( | ||
|  |                     fontSize: 16, | ||
|  |                     color: fTextColor1, | ||
|  |                   ), | ||
|  |                 ), | ||
|  |               ), | ||
|  |             ), | ||
|  |           ), | ||
|  |         ), | ||
|  |         Container( | ||
|  |           margin: EdgeInsets.symmetric(horizontal: 5.0), | ||
|  |           // padding: EdgeInsets.symmetric(
 | ||
|  |           //   horizontal: 5.0,
 | ||
|  |           // ),
 | ||
|  |           child: Material( | ||
|  |             color: fcurrentColor1, | ||
|  |             elevation: 0, | ||
|  |             borderRadius: BorderRadius.circular(20.0), | ||
|  |             shadowColor: Theme.of(context).backgroundColor, | ||
|  |             child: InkWell( | ||
|  |               onTap: () => navigationTapped(1), | ||
|  |               child: Padding( | ||
|  |                 padding: const EdgeInsets.all(10.0), | ||
|  |                 child: Text( | ||
|  |                   "Inbox", | ||
|  |                   style: TextStyle( | ||
|  |                     fontSize: 16, | ||
|  |                     color: fTextColor2, | ||
|  |                   ), | ||
|  |                 ), | ||
|  |               ), | ||
|  |             ), | ||
|  |           ), | ||
|  |         ), | ||
|  |         Visibility( | ||
|  |           visible: status, | ||
|  |           child: GestureDetector( | ||
|  |             child: Container( | ||
|  |               width: 40, | ||
|  |               height: 30, | ||
|  |               decoration: BoxDecoration( | ||
|  |                 shape: BoxShape.circle, | ||
|  |                 color: Theme.of(context).colorScheme.secondary, | ||
|  |               ), | ||
|  |               // padding: EdgeInsets.symmetric(horizontal: 20.0),
 | ||
|  |               child: Icon(Icons.add, size: 25, color: Colors.white), | ||
|  |             ), | ||
|  |             onTap: () => Navigator.of(context).push( | ||
|  |               PageTransition( | ||
|  |                 child: NewMessage(), | ||
|  |                 type: PageTransitionType.downToUp, | ||
|  |               ), | ||
|  |             ), | ||
|  |           ), | ||
|  |         ), | ||
|  |       ], | ||
|  |     ), | ||
|  |   ); | ||
|  | } |