import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/user.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';

import '../../controllers/providers/api/user_provider.dart';
import '../common_widgets/default_app_bar.dart';

class ReportBugPage extends StatelessWidget {
  static const id = "/report_bug_page";

  const ReportBugPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final User user = Provider.of<UserProvider>(context, listen: false).user!;
    return Scaffold(
      appBar: const DefaultAppBar(title: "Survey"),
      body: Column(
        children: [
          SingleChildScrollView(
            child: Column(
              children: [
                Card(
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    children: [
                      user.clientName!.heading5(context),
                      8.height,
                      "Call ID: ${0}".bodyText(context),
                      "Date of Survey: ${DateFormat("dd MMM, yyyy").format(DateTime.now())}".bodyText(context),
                    ],
                  ).paddingAll(16),
                ),
              ],
            ),
          ).expanded,
          AppFilledButton(onPressed: () {}, label: context.translation.save),
        ],
      ).paddingAll(16),
    );
  }
}
