passo_mobile_app/lib/screens/offline/passo/passo_offline_dashboard.dart

68 lines
2.2 KiB
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
2024-02-08 00:52:29 +00:00
import 'package:unit2/bloc/offline/offline_passo/land/land_property_owner_bloc/land_property_owner_bloc.dart';
import 'package:unit2/model/offline/offline_profile.dart';
import 'package:unit2/screens/offline/passo/building_home_offline.dart';
2024-02-08 00:52:29 +00:00
import 'package:unit2/screens/offline/passo/land_home_offline.dart';
import 'package:unit2/theme-data.dart/colors.dart';
import 'package:unit2/widgets/empty_data.dart';
import '../../../bloc/offline/offline_passo/building/owner_info_bloc/crud_bloc.dart';
class PassoOfflineDashBoard extends StatefulWidget {
2024-02-08 00:52:29 +00:00
final OfflineProfile offlineProfile;
const PassoOfflineDashBoard(this.offlineProfile, {super.key});
@override
_PassoOfflineDashBoard createState() => _PassoOfflineDashBoard();
}
class _PassoOfflineDashBoard extends State<PassoOfflineDashBoard> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 3,
child: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
const SliverAppBar(
backgroundColor: primary,
title: Text('Faas Dashboard'),
centerTitle: true,
pinned: true,
floating: true,
bottom: TabBar(
isScrollable: true,
tabs: [
Tab(child: Text('Building')),
Tab(child: Text('Land')),
Tab(child: Text('Machineries')),
],
),
),
];
},
body: TabBarView(
children: <Widget>[
BlocProvider(
create: (context) => CrudBloc()..add(FetchTodos()),
2024-02-08 00:52:29 +00:00
child: BuildingHomeOffline(widget.offlineProfile),
),
2024-02-08 00:52:29 +00:00
BlocProvider(
create: (context) =>
LandPropertyOwnerBloc()..add(LoadLandPropertyOwner()),
child: LandHomeOffline(widget.offlineProfile),
),
EmptyData(
message: "Sorry, this page is under construction.",
)
],
),
)),
);
}
}