147 lines
7.0 KiB
Dart
147 lines
7.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:hub/commons/components/molecules/menu_item/widget.dart';
|
|
import 'package:hub/commons/widgets/custom_icons.dart';
|
|
import 'package:hub/commons/widgets/flutter_flow_theme.dart';
|
|
import 'package:hub/commons/widgets/flutter_flow_util.dart';
|
|
import 'package:hub/commons/widgets/internationalization.dart';
|
|
|
|
|
|
|
|
|
|
class MenuButtonWidget extends MenuEntry {
|
|
const MenuButtonWidget({
|
|
Key? key,
|
|
this.action,
|
|
this.title,
|
|
this.icon,
|
|
}) : super(key: key);
|
|
|
|
final Function()? action;
|
|
final String? title;
|
|
final IconData? icon;
|
|
|
|
@override
|
|
_MenuButtonWidgetState createState() => _MenuButtonWidgetState();
|
|
}
|
|
|
|
class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
splashColor: Colors.transparent,
|
|
focusColor: Colors.transparent,
|
|
hoverColor: Colors.transparent,
|
|
highlightColor: Colors.transparent,
|
|
onTap: () async {
|
|
await widget.action?.call();
|
|
},
|
|
child: Container(
|
|
width: 100.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,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
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 ?? '',
|
|
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)),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |