2023-01-19 17:50:11 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import '../routes.dart';
|
|
|
|
|
|
|
|
class StandardAppBar {
|
2023-01-25 18:51:53 +00:00
|
|
|
static AppBar build(BuildContext context, String title,
|
|
|
|
{List<Widget>? actions}) {
|
2023-01-19 17:50:11 +00:00
|
|
|
return AppBar(
|
2023-01-25 18:51:53 +00:00
|
|
|
title: Text(
|
|
|
|
title,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
),
|
2023-01-19 17:50:11 +00:00
|
|
|
actions: [
|
2023-01-25 18:51:53 +00:00
|
|
|
if (actions != null) ...actions,
|
2023-01-19 17:50:11 +00:00
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context).popUntil((route) {
|
|
|
|
return route.settings.name == ScreenPaths.timelines;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
icon: const Icon(Icons.home),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|