mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 18:13:31 +00:00
31 lines
932 B
Dart
31 lines
932 B
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../globals.dart';
|
|
import '../services/auth_service.dart';
|
|
|
|
class StandardAppBar {
|
|
static AppBar build(BuildContext context, String title,
|
|
{bool withDrawer = false, List<Widget>? actions}) {
|
|
final service = getIt<AccountsService>();
|
|
return AppBar(
|
|
leading: withDrawer
|
|
? service.loggedIn
|
|
? Builder(builder: (context) {
|
|
return IconButton(
|
|
onPressed: () {
|
|
Scaffold.of(context).openDrawer();
|
|
},
|
|
icon: CachedNetworkImage(
|
|
imageUrl: service.currentProfile.avatar));
|
|
})
|
|
: null
|
|
: null,
|
|
title: Text(
|
|
title,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
actions: actions,
|
|
);
|
|
}
|
|
}
|