// ignore: must_be_immutable
import 'package:flutter/material.dart';
import 'package:hub/components/atomic_components/shared_components_atoms/appbar.dart';
import 'package:hub/features/menu/index.dart';
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
import 'package:hub/flutter_flow/flutter_flow_util.dart';
import 'package:hub/flutter_flow/nav/nav.dart';

class AboutPropertyModel extends FlutterFlowModel<AboutPropertyPage> {
  dynamic item;

  VoidCallback? safeSetState;

  Future<void> initAsync() async {
    safeSetState?.call();
  }

  @override
  void initState(BuildContext context) {
    initAsync();
  }

  @override
  void dispose() {}
}

// ignore: must_be_immutable
class AboutPropertyPage extends StatefulWidget {
  dynamic pet;

  AboutPropertyPage({
    super.key,
    this.pet,
  });

  @override
  State<AboutPropertyPage> createState() => _AboutPropertyPageState();
}

class _AboutPropertyPageState extends State<AboutPropertyPage>
    with SingleTickerProviderStateMixin {
  late AboutPropertyModel _model;

  @override
  void initState() {
    super.initState();
    _model = createModel(context, () => AboutPropertyModel());
    _model.updateOnChange = true;

    _model.safeSetState = () {
      safeSetState(() {});
    };
  }

  @override
  void dispose() {
    super.dispose();
    _model.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: _buildAppBar(context),
        backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
        body: _buildBody(context));
  }

  PreferredSizeWidget _buildAppBar(BuildContext context) {
    final String title = FFLocalizations.of(context).getVariableText(
        ptText: "Sobre a Propriedade", enText: "About the Property");
    return AppBarUtil(
      key: UniqueKey(),
      appBarKey: ValueKey<String>('BackNavigationAppBar'),
      title: title,
      onBackButtonPressed: () => context.pop(),
    );
  }

  Widget _buildBody(BuildContext context) {
    return SingleChildScrollView(
      child: Container(
        color: FlutterFlowTheme.of(context).primaryBackground,
        child: Menufactory(
          entry: MenuEntry.getEntriesByType(MenuEntryType.Property),
          item: EnumMenuItem.button,
          view: MenuView.list_grid,
        ),
      ),
    );
  }
}
