import 'package:flutter/material.dart'; import 'package:teso/util/SizeConfig.dart'; import 'package:teso/util/consts.dart'; import 'package:time_elapsed/time_elapsed.dart'; buildPostAlert( {required BuildContext context, required DateTime timestamp, Icon? icons, String? thumbnail, required String message}) { return Padding( padding: EdgeInsets.symmetric(horizontal: 30.0), child: Material( elevation: 10, child: Container( width: MediaQuery.of(context).size.width, color: Theme.of(context).primaryColor, // height: 50, child: Row( children: [ Container( constraints: BoxConstraints(minHeight: 80, maxHeight: 150), width: MediaQuery.of(context).size.width - (MediaQuery.of(context).size.width) * 0.88, decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ darkAccent, accentMain, ], ), ), child: icons, ), Expanded( flex: 1, // color: Theme.of(context).primaryColor, child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Wrap( direction: Axis.horizontal, runSpacing: 10, children: [ Icon( Icons.timer, size: 15, ), Text( TimeElapsed.fromDateTime(timestamp), style: (TextStyle( color: Colors.grey, )), ), ], ), Container( width: MediaQuery.of(context).size.width * 0.527, child: Text( message, textAlign: TextAlign.left, style: TextStyle( fontSize: SizeConfig.blockSizeHorizontal * 3.5, ), ), ), Container(), ], ), ), ), // Container( // width: (MediaQuery.of(context).size.width) * 0.10, // color: Theme.of(context).primaryColor, // child: Align( // alignment: Alignment.topCenter, // child: Image( // fit: BoxFit.fill, // width: 40, // height: 40, // image: MemoryImage(base64Decode(thumbnail)), // ), // ), // ), ], ), ), ), ); }