import 'package:flutter/material.dart'; buildNewHead(BuildContext context, Function clear, String title) { return Container( width: MediaQuery.of(context).size.width, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( onTap: () => Navigator.pop(context), child: Container( margin: EdgeInsets.all(20), height: 30, width: 30, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), color: Theme.of(context).colorScheme.secondary, ), child: ClipRRect( borderRadius: BorderRadius.only( topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0), bottomLeft: Radius.circular(30), bottomRight: Radius.circular(30), ), child: Align( alignment: Alignment.center, child: Icon( Icons.arrow_back_ios, color: Colors.white, )), ), ), ), Text(title), InkWell( onTap: () => clear(), child: Container( margin: EdgeInsets.all(20), padding: EdgeInsets.all(05), height: 40, width: 80, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), color: Theme.of(context).colorScheme.secondary, ), child: Center( child: Text( "Clear", style: TextStyle(color: Colors.white), ), ), ), ), ], ), ); }