
import '/components/organism_components/bottom_arrow_linked_locals_component/bottom_arrow_linked_locals_component_widget.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/flutter_flow/custom_functions.dart' as functions;
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'local_profile_component_model.dart';
export 'local_profile_component_model.dart';

////

class LocalProfileComponentWidget extends StatefulWidget {
  const LocalProfileComponentWidget({
    required bool localStatus, 
    super.key
    });

  @override
  State<LocalProfileComponentWidget> createState() =>
      _LocalProfileComponentWidgetState();
}

class _LocalProfileComponentWidgetState
    extends State<LocalProfileComponentWidget> {
  late LocalProfileComponentModel _model;

  @override
  void setState(VoidCallback callback) {
    super.setState(callback);
    _model.onUpdate();
  }

  @override
  void initState() {
    super.initState();
    _model = createModel(context, () => LocalProfileComponentModel());
  }

  @override
  void dispose() {
    _model.maybeDispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    context.watch<FFAppState>();

    return Container(
      decoration: const BoxDecoration(),
      child: Align(
        alignment: const AlignmentDirectional(0.0, -1.0),
        child: Material(
          color: Colors.transparent,
          elevation: 0.0,
          child: Container(
            width: double.infinity,
            height: 119.0,
            decoration: BoxDecoration(
              color: const Color(0xFF1AAB5F),
              border: Border.all(
                color: const Color(0xFF1AAB5F),
              ),
            ),
            child: Row(
              mainAxisSize: MainAxisSize.max,
              children: [
                Align(
                  alignment: const AlignmentDirectional(-1.0, 0.0),
                  child: Padding(
                    padding: const EdgeInsets.all(2.0),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        showModalBottomSheet(
                          isScrollControlled: true,
                          backgroundColor: const Color(0x00FFFFFF),
                          context: context,
                          builder: (context) {
                            return Padding(
                              padding: MediaQuery.viewInsetsOf(context),
                              child: const SizedBox(
                                height: double.infinity,
                                child:
                                    BottomArrowLinkedLocalsComponentWidget(),
                              ),
                            );
                          },
                        ).then((value) => safeSetState(() {}));
                      },
                      child: ClipRRect(
                        borderRadius: BorderRadius.circular(200.0),
                        child: 
                        Image.network(
                          'https://freaccess.com.br/freaccess/Images/Clients/${FFAppState().cliUUID}.png',
                          width: 80.0,
                          height: 80.0,
                          fit: BoxFit.cover,
                          alignment: const Alignment(0.0, 0.0),
                          errorBuilder: (context, error, stackTrace) => Image.network(
                            'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
                            width: 80.0,
                            height: 80.0,
                            fit: BoxFit.cover,
                            alignment: const Alignment(0.0, 0.0),
                            errorBuilder: (context, error, stackTrace) => Image.asset('assets/images/error_image.svg'),
                          ),
                        )
                        ),
                      ),
                    ),
                  ),
                Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text(
                      valueOrDefault<String>(
                        functions.convertToUppercase(FFAppState().local),
                        'NOME DO LOCAL',
                      ),
                      style:
                          FlutterFlowTheme.of(context).labelMedium.override(
                                fontFamily: 'Nunito',
                                color: FlutterFlowTheme.of(context).info,
                                fontSize: 14.0,
                                letterSpacing: 0.0,
                                fontWeight: FontWeight.w500,
                                useGoogleFonts:
                                    GoogleFonts.asMap().containsKey('Nunito'),
                              ),
                    ),
                  ],
                ),
              ]
                  .divide(const SizedBox(width: 20.0))
                  .addToStart(const SizedBox(width: 20.0))
                  .addToEnd(const SizedBox(width: 20.0)),
            ),
          ),
        ),
      ),
    );
  }
}