From 4e6e96c64c04281ad67454f47f10cdc7eecf70e4 Mon Sep 17 00:00:00 2001 From: jantunesmesias Date: Fri, 23 Aug 2024 11:22:32 -0300 Subject: [PATCH] WIP --- .../menu_button_item_widget.dart | 145 +++++++----------- .../menu_staggered_view_component_widget.dart | 12 +- 2 files changed, 65 insertions(+), 92 deletions(-) diff --git a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart index 7a3aedd7..6085e5f6 100644 --- a/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart +++ b/lib/components/atomic_components/menu_button_item/menu_button_item_widget.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:hub/components/molecular_components/menu_item/menu_item.dart'; import 'package:hub/flutter_flow/flutter_flow_theme.dart'; -import 'package:hub/flutter_flow/flutter_flow_util.dart'; class MenuButtonWidget extends MenuEntry { const MenuButtonWidget({ @@ -33,96 +32,66 @@ class _MenuButtonWidgetState extends State { onTap: () async { await widget.action?.call(); }, - child: Container( - width: 120.0, - height: 100.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context).primaryBackground, - boxShadow: [ - BoxShadow( - blurRadius: 4.0, - color: FlutterFlowTheme.of(context).customColor5, - offset: const Offset( - 0.0, - 2.0, - ), - ) - ], - borderRadius: BorderRadius.circular(24.0), - shape: BoxShape.rectangle, - border: Border.all( - color: FlutterFlowTheme.of(context).alternate, - width: 0.5, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0), + child: Container( + width: 120.0, + height: 100.0, + decoration: BoxDecoration( + color: FlutterFlowTheme.of(context).primaryBackground, + boxShadow: [ + BoxShadow( + blurRadius: 4.0, + color: FlutterFlowTheme.of(context).customColor5, + offset: const Offset( + 0.0, + 2.0, + ), + ) + ], + borderRadius: BorderRadius.circular(24.0), + shape: BoxShape.rectangle, + border: Border.all( + color: FlutterFlowTheme.of(context).alternate, + width: 0.5, + ), ), - ), - child: Padding( - padding: const EdgeInsets.all(4.0), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Align( - alignment: const AlignmentDirectional(-1.0, 0.0), - child: Padding( - padding: const EdgeInsetsDirectional.fromSTEB( - 8.0, 0.0, 0.0, 0.0), - child: Container( - width: 30.0, - height: 30.0, - decoration: BoxDecoration( - color: FlutterFlowTheme.of(context) - .primaryBackground, - shape: BoxShape.circle, - ), - alignment: const AlignmentDirectional(0.0, 0.0), - child: Icon( - widget.icon, - color: FlutterFlowTheme.of(context).accent1, - size: 24.0, - ), - ), + child: Padding( + padding: const EdgeInsets.all(4.0), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (widget.icon != null) + Container( + alignment: Alignment.topLeft, + padding: const EdgeInsets.only(left: 8.0), + child: Icon( + widget.icon, + size: 24.0, + color: FlutterFlowTheme.of(context).primaryText, + ), + ), + Flexible( + child: Text( + widget.title ?? '', + overflow: TextOverflow.ellipsis, + maxLines: 2, + textAlign: TextAlign.start, + style: FlutterFlowTheme.of(context).titleLarge.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).primaryText, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), ), - ), - ), - ], + ), ), - ), - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Align( - alignment: const AlignmentDirectional(0.0, 0.0), - child: Text( - widget.title ?? '', - overflow: TextOverflow.ellipsis, - maxLines: 2, // Add this line - softWrap: false, // Add this line - style: FlutterFlowTheme.of(context).titleLarge.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).primaryText, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ), - ], - ), - ), - ].divide(const SizedBox(height: 0.0)), + ], + ), ), ), ), diff --git a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart index a572414c..3e4178c7 100644 --- a/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart +++ b/lib/components/organism_components/menu_staggered_view_component/menu_staggered_view_component_widget.dart @@ -60,16 +60,20 @@ class _MenuStaggeredViewComponentWidgetState crossAxisCount: 3, crossAxisSpacing: 10.0, mainAxisSpacing: 10.0, + childAspectRatio: 1, + mainAxisExtent: 100, ), itemCount: widget.options.length, - padding: const EdgeInsets.all(14), + padding: const EdgeInsets.all(0), shrinkWrap: true, itemBuilder: (context, index) { return Container( - height: 100, - width: 100, + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + alignment: Alignment.center, + padding: const EdgeInsets.all(0), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(0), color: Colors.transparent, boxShadow: const [ BoxShadow(