import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';

class ProfileWelcomeWidget extends StatelessWidget {

  final Widget clinicWidget;
final double height;

  ProfileWelcomeWidget(this.clinicWidget, {this.height = 140});

  @override
  Widget build(BuildContext context) {
    AuthViewModel authProvider = Provider.of(context);

    return Container(
      height: height,
      color: HexColor('#515B5D'),
      width: double.infinity,
      child: FractionallySizedBox(
        widthFactor: 0.9,
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.start,
              children: <Widget>[
                Row(
                  children: <Widget>[
                    AppText(
                      TranslationBase.of(context).welcome,
                      fontSize: SizeConfig.textMultiplier * 1.7,
                      color: Colors.white,
                    )
                  ],
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    AppText(
                      'Dr. ${authProvider.doctorProfile.doctorName}',
                      fontWeight: FontWeight.bold,
                      fontSize: SizeConfig.textMultiplier * 2.5,
                      color: Colors.white,
                    )
                  ],
                ),
                SizedBox(
                  height: 4,
                ),
                clinicWidget,
              ],
            ),
            Expanded(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.end,
                children: <Widget>[
                  Container(
                    decoration: BoxDecoration(
                      color: Theme.of(context).backgroundColor,
                      borderRadius: BorderRadius.all(
                        Radius.circular(10.0),
                      ),
                    ),
                    height: 50,
                    width: 60,
                    child: Image.network(
                      authProvider.doctorProfile.doctorImageURL,
//                                    fit: BoxFit.fill,
                    ),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
