relatica/lib/controls/standard_appbar.dart
2023-01-25 12:51:53 -06:00

26 lines
610 B
Dart

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