mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
41 lines
1.4 KiB
Dart
41 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart';
|
|
import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
|
|
|
class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
const DefaultAppBar({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<NavCubit, NavState>(
|
|
builder: (context, state) {
|
|
return BlocBuilder<SpacesCubit, SpacesState>(
|
|
builder: (context, state) {
|
|
return Padding(
|
|
padding: const EdgeInsets.only(
|
|
top: 20,
|
|
),
|
|
child: AppBar(
|
|
backgroundColor: Colors.transparent,
|
|
leadingWidth: 150,
|
|
toolbarHeight: Constants.appBarHeight,
|
|
leading: SpacesCubit.spaces.isNotEmpty
|
|
? NavCubit.appBarLeading[
|
|
NavCubit().bottomNavItems[NavCubit.pageIndex].label]
|
|
: null,
|
|
actions: NavCubit.appBarActions[
|
|
NavCubit().bottomNavItems[NavCubit.pageIndex].label],
|
|
),
|
|
);
|
|
},
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => Size.fromHeight(Constants.appBarHeight);
|
|
}
|