You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.7 KiB
Dart
48 lines
1.7 KiB
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/models/provider_branches_models/branch_detail_model.dart';
|
|
import 'package:mc_common_app/utils/navigator.dart';
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
class ServiceProviderWidget extends StatelessWidget {
|
|
final List<BranchDetailModel> nearbyBranches;
|
|
|
|
const ServiceProviderWidget({Key? key, required this.nearbyBranches}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
width: double.infinity,
|
|
height: 140,
|
|
child: ListView.builder(
|
|
itemCount: nearbyBranches.length,
|
|
scrollDirection: Axis.horizontal,
|
|
shrinkWrap: true,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
BranchDetailModel branchDetailModel = nearbyBranches[index];
|
|
return SizedBox(
|
|
width: 90,
|
|
child: Column(
|
|
children: [
|
|
Image.asset(
|
|
MyAssets.bnCar,
|
|
width: 80,
|
|
height: 80,
|
|
fit: BoxFit.cover,
|
|
).toCircle(borderRadius: 100),
|
|
8.height,
|
|
"${branchDetailModel.branchName}".toText(fontSize: 14, isBold: true, textAlign: TextAlign.center),
|
|
],
|
|
),
|
|
).onPress(() {
|
|
navigateWithName(context, AppRoutes.branchDetailPage, arguments: branchDetailModel);
|
|
});
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|