contact us

mail@pastecode.io avatar
unknown
dart
2 years ago
2.3 kB
3
Indexable
Never
import 'package:base_architecture/core/constants/assets.dart';
import 'package:base_architecture/core/enums/edge_insets_enum.dart';
import 'package:base_architecture/core/shared_widgets/square_button.dart';
import 'package:base_architecture/presentation/notifiers/contact_us_notifier/contact_us_notifier.dart';
import 'package:base_architecture/presentation/notifiers/theme_notifier.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'dart:math' as math;

class ContactUsHeader extends StatelessWidget {
  const ContactUsHeader({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    ThemeNotifier themeNotifier = Provider.of<ThemeNotifier>(
      context,
      listen: true,
    );
    final contactNotifier =
        Provider.of<ContactUsNotifier>(context, listen: true);
    return Row(
      crossAxisAlignment: CrossAxisAlignment.end,
      children: [
        SquareButton(
          icon: context.locale == const Locale('ar')
              ? SvgPicture.asset(
                  Assets.icArrowBack,
                )
              : Transform(
                  alignment: Alignment.center,
                  transform: Matrix4.rotationY(math.pi),
                  child: SvgPicture.asset(
                    Assets.icArrowBack,
                  ),
                ),
          onPressed: () {
            contactNotifier.nameController!.clear();
            contactNotifier.emailController!.clear();
            contactNotifier.phoneController!.clear();
            contactNotifier.notesController!.clear();
            contactNotifier.posts.clear();
            Navigator.of(context).pop();
          },
          padding: EdgeInsets.symmetric(
            vertical: EdgeInsetsEnum.l.rawValue,
            horizontal: EdgeInsetsEnum.l.rawValue,
          ),
          margin: const EdgeInsetsDirectional.only(end: 16),
        ),
        Text(
          'Call Us'.tr(),
          style: themeNotifier.getTheme().textTheme.headline2!.copyWith(
                color: themeNotifier.getTheme().hoverColor,
                fontWeight: FontWeight.bold,
                fontSize: 25,
              ),
        ),
      ],
    );
  }
}