136 lines
4.2 KiB
Dart
136 lines
4.2 KiB
Dart
import 'package:flutter/gestures.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:hub/features/home/index.dart';
|
|
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
|
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
|
import 'package:hub/shared/components/molecules/drawer/index.dart';
|
|
import 'package:hub/shared/components/molecules/locals/index.dart';
|
|
import 'package:hub/shared/components/molecules/menu/index.dart';
|
|
import 'package:hub/shared/components/molecules/modules/index.dart';
|
|
|
|
class HomePageWidget extends StatefulWidget {
|
|
const HomePageWidget({super.key});
|
|
|
|
@override
|
|
State<HomePageWidget> createState() => _HomePageWidgetState();
|
|
}
|
|
|
|
class _HomePageWidgetState extends State<HomePageWidget> {
|
|
final scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocProvider(
|
|
create: (context) => HomeBloc()..add(HomeEvent()),
|
|
child: Scaffold(
|
|
key: scaffoldKey,
|
|
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
|
drawerEnableOpenDragGesture: true,
|
|
drawerDragStartBehavior: DragStartBehavior.start,
|
|
drawer: CustomDrawer(),
|
|
appBar: buildAppBar(context),
|
|
body: buildPage(context),
|
|
),
|
|
);
|
|
}
|
|
|
|
AppBar buildAppBar(BuildContext context) {
|
|
return AppBar(
|
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
|
automaticallyImplyLeading: false,
|
|
leading: FlutterFlowIconButton(
|
|
borderRadius: 20.0,
|
|
borderWidth: 1.0,
|
|
buttonSize: 40.0,
|
|
fillColor: FlutterFlowTheme.of(context).primary,
|
|
icon: const Icon(
|
|
Icons.menu_rounded,
|
|
color: Colors.white,
|
|
size: 28.0,
|
|
),
|
|
onPressed: () async {
|
|
scaffoldKey.currentState!.openDrawer();
|
|
},
|
|
),
|
|
title: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(8.0),
|
|
child: Image.asset(
|
|
'assets/images/logo.png',
|
|
width: 15.0,
|
|
height: 15.0,
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
Text(
|
|
'FRE ACCESS',
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
|
color: FlutterFlowTheme.of(context).info,
|
|
letterSpacing: 0.0,
|
|
useGoogleFonts: GoogleFonts.asMap().containsKey(FlutterFlowTheme.of(context).bodyMediumFamily),
|
|
),
|
|
),
|
|
].divide(const SizedBox(width: 8.0)),
|
|
),
|
|
actions: const [],
|
|
centerTitle: true,
|
|
elevation: 0.0,
|
|
);
|
|
}
|
|
|
|
Container buildPage(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: FlutterFlowTheme.of(context).primary,
|
|
),
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Wrap(
|
|
spacing: 0.0,
|
|
runSpacing: 0.0,
|
|
alignment: WrapAlignment.start,
|
|
crossAxisAlignment: WrapCrossAlignment.start,
|
|
direction: Axis.horizontal,
|
|
runAlignment: WrapAlignment.start,
|
|
verticalDirection: VerticalDirection.down,
|
|
clipBehavior: Clip.none,
|
|
children: [
|
|
buildLocal(),
|
|
buildBody(),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget buildBody() {
|
|
return Container(
|
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(bottom: 40),
|
|
child: MenuFactory(
|
|
menuEntry: MenuEntries.home,
|
|
menuItem: MenuItem.button,
|
|
menuView: MenuView.list_grid,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget buildLocal() {
|
|
return LocalProfileComponentWidget();
|
|
}
|
|
}
|