import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/tems-condition-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:provider/provider.dart';

class PharmacyTermsConditions extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    ProjectViewModel projectProvider = Provider.of(context);

    return BaseView<TermsConditionViewModel>(
        onModelReady: (model) => model.getUserTermsAndConditionsForEPharmcy(),
        builder: (_, model, wi) => AppScaffold(
              appBarTitle: TranslationBase.of(context).termOfService,
              isShowAppBar: true,
              isShowDecPage: false,
              isPharmacy: true,
              backgroundColor: Colors.white,
              baseViewModel: model,
              body: Container(
                margin: EdgeInsets.all(8),
                width: double.infinity,
                child: Stack(
                  children: [
                    SingleChildScrollView(
                      child: Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: [
                          if (model.listUserAgreement != null &&
                              model.listUserAgreement.userAgreementLAKUM !=
                                  null)
                            Html(
                              data: projectProvider.isArabic
                                  ? model.listUserAgreement.userAgreementTxtn
                                  : model.listUserAgreement.userAgreementTxt,
                            ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ));
  }
}
