Untitled

mail@pastecode.io avatar
unknown
dart
3 years ago
3.2 kB
1
Indexable
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:iketfaa_delivery/App/Common/Models/Main/UserPostItem.dart';
import 'package:iketfaa_delivery/App/Common/Modules/Comments/controller/comments_controller.dart';
import 'package:iketfaa_delivery/App/Common/Services/translation_service.dart';
import 'package:iketfaa_delivery/App/Common/Utilities/Methods/tools.dart';
import 'package:iketfaa_delivery/App/Common/Widgets/Background.dart';
import 'package:iketfaa_delivery/App/Delivery/Utilities/Widgets/primary_app_bar.dart';

class CommentsView extends GetView<CommentsController> {
  final bool isArabic = TranslationService().isLocaleArabic();
  final Rx<UserPostItem> userPostItem;
  RxInt currentPos = 0.obs;

  CommentsView({Key? key, required this.userPostItem}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Background(
      child: Scaffold(
        appBar: PrimaryAppBar(
          title: 'Comments'.tr,
          function: () {
            Get.back();
          },
        ),
        body: Column(
          children: [
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                CircleAvatar(
                  child: Image.network(
                    userPostItem.value.providerProfileUrl.toString(),
                  ),
                ),
                const SizedBox(
                  width: 10,
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Container(
                      width: Get.width * 0.75,
                      child: Flexible(
                        child: RichText(
                          text: TextSpan(
                            text: '',
                            style: DefaultTextStyle.of(context).style,
                            children: <TextSpan>[
                              TextSpan(
                                text: userPostItem.value.providerName,
                                style: Get.textTheme.headline6!.copyWith(
                                  fontWeight: FontWeight.bold,
                                ),
                              ),
                              const TextSpan(text: '    '),
                              TextSpan(
                                text: userPostItem.value.description,
                                style: Get.textTheme.headline6!,
                              ),
                            ],
                          ),
                        ),
                      ),
                    ),
                    Text(
                      CommonTools().getVerboseDateTimeRep(userPostItem.value.createdDate!),
                    ),
                  ],
                ),
              ],
            ).paddingSymmetric(horizontal: 20),
            // ListView.builder(
            //   itemCount: userPostItem.value.comments!.length,
            //   itemBuilder: (BuildContext context, int index) {
            //     return;
            //   },
            // ),
          ],
        ),
      ),
    );
  }
}