import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';

import '../../uitl/translations_delegate_base.dart';

class BookingOptions extends StatefulWidget {
  final bool isAppbar;

  BookingOptions({this.isAppbar = false});

  @override
  _BookingOptionsState createState() => _BookingOptionsState();
}

class _BookingOptionsState extends State<BookingOptions> {
  LocationUtils locationUtils;

  @override
  void initState() {
    locationUtils =
        new LocationUtils(isShowConfirmDialog: true, context: context);
    WidgetsBinding.instance
        .addPostFrameCallback((_) => locationUtils.getCurrentLocation());

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return AppScaffold(
      isShowAppBar: widget.isAppbar,
      isShowDecPage: false,
      appBarTitle: TranslationBase.of(context).bookAppo,
      body: Container(
        margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text(TranslationBase.of(context).searchBy,
                style: TextStyle(
                    fontSize: 24.0,
                    letterSpacing: 1.0,
                    fontWeight: FontWeight.bold,
                    color: new Color(0xFF60686b))),
            Container(
              margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
              child: Row(
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Expanded(
                    child: CardCommon(
                      image: 'assets/images/new-design/search_by_clinic.png',
                      text: TranslationBase.of(context).clinic,
                      subText: TranslationBase.of(context).name,
                      type: 0,
                    ),
                  ),
                  Expanded(
                    child: CardCommon(
                        image: 'assets/images/new-design/search_by_doctor.png',
                        text: TranslationBase.of(context).doctor,
                        subText: TranslationBase.of(context).name,
                        type: 1),
                  )
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
