This commit is contained in:
jantunesmesias 2024-08-23 11:22:32 -03:00
parent 102ec7815e
commit 4e6e96c64c
2 changed files with 65 additions and 92 deletions

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:hub/components/molecular_components/menu_item/menu_item.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_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
class MenuButtonWidget extends MenuEntry { class MenuButtonWidget extends MenuEntry {
const MenuButtonWidget({ const MenuButtonWidget({
@ -33,96 +32,66 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
onTap: () async { onTap: () async {
await widget.action?.call(); await widget.action?.call();
}, },
child: Container( child: Padding(
width: 120.0, padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
height: 100.0, child: Container(
decoration: BoxDecoration( width: 120.0,
color: FlutterFlowTheme.of(context).primaryBackground, height: 100.0,
boxShadow: [ decoration: BoxDecoration(
BoxShadow( color: FlutterFlowTheme.of(context).primaryBackground,
blurRadius: 4.0, boxShadow: [
color: FlutterFlowTheme.of(context).customColor5, BoxShadow(
offset: const Offset( blurRadius: 4.0,
0.0, color: FlutterFlowTheme.of(context).customColor5,
2.0, offset: const Offset(
), 0.0,
) 2.0,
], ),
borderRadius: BorderRadius.circular(24.0), )
shape: BoxShape.rectangle, ],
border: Border.all( borderRadius: BorderRadius.circular(24.0),
color: FlutterFlowTheme.of(context).alternate, shape: BoxShape.rectangle,
width: 0.5, border: Border.all(
color: FlutterFlowTheme.of(context).alternate,
width: 0.5,
),
), ),
), child: Padding(
child: Padding( padding: const EdgeInsets.all(4.0),
padding: const EdgeInsets.all(4.0), child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ if (widget.icon != null)
Align( Container(
alignment: const AlignmentDirectional(0.0, 0.0), alignment: Alignment.topLeft,
child: Row( padding: const EdgeInsets.only(left: 8.0),
mainAxisSize: MainAxisSize.max, child: Icon(
mainAxisAlignment: MainAxisAlignment.center, widget.icon,
children: [ size: 24.0,
Expanded( color: FlutterFlowTheme.of(context).primaryText,
child: Align( ),
alignment: const AlignmentDirectional(-1.0, 0.0), ),
child: Padding( Flexible(
padding: const EdgeInsetsDirectional.fromSTEB( child: Text(
8.0, 0.0, 0.0, 0.0), widget.title ?? '',
child: Container( overflow: TextOverflow.ellipsis,
width: 30.0, maxLines: 2,
height: 30.0, textAlign: TextAlign.start,
decoration: BoxDecoration( style: FlutterFlowTheme.of(context).titleLarge.override(
color: FlutterFlowTheme.of(context) fontFamily: 'Nunito',
.primaryBackground, color: FlutterFlowTheme.of(context).primaryText,
shape: BoxShape.circle, fontSize: 14.0,
), letterSpacing: 0.0,
alignment: const AlignmentDirectional(0.0, 0.0), fontWeight: FontWeight.w500,
child: Icon( useGoogleFonts:
widget.icon, GoogleFonts.asMap().containsKey('Nunito'),
color: FlutterFlowTheme.of(context).accent1,
size: 24.0,
),
),
), ),
), ),
),
],
), ),
), ],
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)),
), ),
), ),
), ),

View File

@ -60,16 +60,20 @@ class _MenuStaggeredViewComponentWidgetState
crossAxisCount: 3, crossAxisCount: 3,
crossAxisSpacing: 10.0, crossAxisSpacing: 10.0,
mainAxisSpacing: 10.0, mainAxisSpacing: 10.0,
childAspectRatio: 1,
mainAxisExtent: 100,
), ),
itemCount: widget.options.length, itemCount: widget.options.length,
padding: const EdgeInsets.all(14), padding: const EdgeInsets.all(0),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
height: 100, height: MediaQuery.of(context).size.height,
width: 100, width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: const EdgeInsets.all(0),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(0),
color: Colors.transparent, color: Colors.transparent,
boxShadow: const [ boxShadow: const [
BoxShadow( BoxShadow(