|
|
|
|
@ -1,13 +1,18 @@
|
|
|
|
|
import 'package:car_customer_app/view_models/providers_view_model.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:mc_common_app/classes/consts.dart';
|
|
|
|
|
import 'package:mc_common_app/config/routes.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/navigator.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/provider_details_card.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/empty_widget.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
|
|
|
|
|
class ProviderProfilePage extends StatefulWidget {
|
|
|
|
|
int providerId;
|
|
|
|
|
@ -41,7 +46,8 @@ class _ProviderProfilePageState extends State<ProviderProfilePage> {
|
|
|
|
|
? const Center(child: CircularProgressIndicator())
|
|
|
|
|
: model.providerModel!.data == null
|
|
|
|
|
? const EmptyWidget()
|
|
|
|
|
: Column(
|
|
|
|
|
: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -70,7 +76,34 @@ class _ProviderProfilePageState extends State<ProviderProfilePage> {
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
allPading: 12,
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
model.providerModel!.data!.serviceProviderBranch == null
|
|
|
|
|
? const Center(child: Text("No Branch Found"))
|
|
|
|
|
: model.providerModel!.data!.serviceProviderBranch!.isEmpty
|
|
|
|
|
? Center(child: Text(LocaleKeys.no_branch.tr()))
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return ProviderDetailsCard(
|
|
|
|
|
onCardTapped: () {
|
|
|
|
|
navigateWithName(context, AppRoutes.branchDetailPage, arguments: model.providerModel!.data!.serviceProviderBranch![index]);
|
|
|
|
|
},
|
|
|
|
|
providerImageUrl: MyAssets.bnCar,
|
|
|
|
|
title: model.providerModel!.data!.serviceProviderBranch![index].branchName ?? "",
|
|
|
|
|
providerLocation: model.providerModel!.data!.serviceProviderBranch![index].distanceKm.toString() + " KM",
|
|
|
|
|
providerName: model.providerModel!.data!.serviceProviderBranch![index].serviceProviderName ?? "",
|
|
|
|
|
providerRatings: "4.9",
|
|
|
|
|
items: model.providerModel!.data!.serviceProviderBranch![index].branchServices,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return 12.height;
|
|
|
|
|
},
|
|
|
|
|
itemCount: model.providerModel!.data!.serviceProviderBranch!.length,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|