import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class EdOnlineAgreementPage extends StatefulWidget { final HospitalsModel selectedHospital; final Function changePageViewIndex; bool isAgree; EdOnlineAgreementPage({Key key, this.selectedHospital, this.changePageViewIndex,this.isAgree}) : super(key: key); @override _EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState(); } class _EdOnlineAgreementPageState extends State { @override Widget build(BuildContext context) { return AppScaffold( body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( children: [ SizedBox(), InkWell( onTap: (){ setState(() { widget.isAgree = !widget.isAgree; }); }, child: Row( children: [ Checkbox( value: widget.isAgree, activeColor: Colors.red[800], onChanged: (bool newValue) { setState(() { widget.isAgree = !widget.isAgree; }); }), Expanded( child: Padding( padding: const EdgeInsets.all(20.0), child: Texts( TranslationBase.of(context).onlineCheckInAgreement, fontSize: 15, ), ), ), ], ), ), SizedBox(), ], ), ), bottomSheet: Padding( padding: const EdgeInsets.all(8.0), child: Container( height: 56, child: Row( children: [ Expanded( child: Container( margin: EdgeInsets.only(left: 5,right: 5), child: SecondaryButton( textColor: Colors.white, color: Theme.of(context).primaryColor, label: TranslationBase.of(context).back.toUpperCase(), onTap: () => widget.changePageViewIndex(0), ), ), ), SizedBox(width: 10,), Expanded( child: Container( margin: EdgeInsets.only(left: 5,right: 5), child: SecondaryButton( textColor: Colors.white, color: Theme.of(context).primaryColor, label: TranslationBase.of(context).next.toUpperCase(), disabled: !widget.isAgree, onTap: () => widget.changePageViewIndex(2), ), ), ), ], ), ), ), ); } }