mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
67 lines
2.1 KiB
Dart
67 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_web/pages/home/bloc/home_bloc.dart';
|
|
import 'package:syncrow_web/pages/home/bloc/home_state.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
|
|
class WebAppBar extends StatelessWidget {
|
|
final Widget? title;
|
|
final List<Widget>? body;
|
|
const WebAppBar({super.key, this.title, this.body});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<HomeBloc, HomeState>(builder: (context, state) {
|
|
return Container(
|
|
height: 100,
|
|
decoration: const BoxDecoration(color: ColorsManager.secondaryColor),
|
|
padding: const EdgeInsets.all(10),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Expanded(
|
|
child: title!,
|
|
),
|
|
if (body != null)
|
|
Expanded(
|
|
flex: 2,
|
|
child: Wrap(
|
|
spacing: 15, // Adjust the spacing as needed
|
|
children: body!,
|
|
),
|
|
),
|
|
Row(
|
|
children: [
|
|
const SizedBox(
|
|
width: 10,
|
|
),
|
|
const SizedBox.square(
|
|
dimension: 40,
|
|
child: CircleAvatar(
|
|
backgroundColor: Colors.white,
|
|
child: SizedBox.square(
|
|
dimension: 35,
|
|
child: CircleAvatar(
|
|
backgroundColor: Colors.grey,
|
|
child: FlutterLogo(),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 10,
|
|
),
|
|
if (HomeBloc.user != null)
|
|
Text(
|
|
'${HomeBloc.user!.firstName.toString()} ${HomeBloc.user!.lastName.toString()} ',
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
});
|
|
}
|
|
}
|