getTestAppBar function
- BuildContext context,
- String minutes,
- String seconds
Returns the test screen AppBar receiving as an argument the context to access the providers,
and the strings minutes and seconds that indicate how much time is left in the test.
This AppBar differs from the rest because it does not include language selection menu but includes a clock The return arrow is not included in this AppBar
Implementation
AppBar getTestAppBar(BuildContext context, String minutes, String seconds){
return AppBar(
automaticallyImplyLeading: false,
/// The height depends on the constant defined in the constants file
toolbarHeight: MediaQuery.of(context).size.height / GeneralConstants.toolbarHeightRatio,
backgroundColor: Colors.white,
actions: [ Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
/// Comunidad de Madrid Salud logo
Flexible(
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Image.asset('assets/images/saludMadridPng.png'),
),
),
/// Universidad Politecnica de Madrid logo
Flexible(
child: Padding(
padding: const EdgeInsets.all(2.0),
child: Image.asset('assets/images/upm.png'),
),
),
/// Clock showing the remaining test time
Flexible(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('$minutes:$seconds',
style: const TextStyle(
color: AppColors.blueText,
fontSize: 30
)),
],
),
),
],
),
),
],
);
}