import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import…
- User
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:product_selector/screens/handsets/compare/model/handsets_model.dart'; import 'package:product_selector/utilities/colors.dart';
class TableBody extends StatefulWidget { const TableBody( {this.firstHandsets, this.secondHandsets, this.thirdHandsets, Key? key}) : super(key: key);
final SpecificationsGroup? firstHandsets; final SpecificationsGroup? secondHandsets; final SpecificationsGroup? thirdHandsets;
@override State createState() => _TableBodyState(); }
class _TableBodyState extends State { @override Widget build(BuildContext context) { return ListView.builder( physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: widget.firstHandsets?.specifications?.length ?? 0, itemBuilder: (context, index) { return Table( border: TableBorder.symmetric( inside: BorderSide( color: UIColors.aluminium, style: BorderStyle.solid, width: 2.w), ), children: [tableRow(index)], ); }); }
TableRow tableRow(index) { double topBorder = index != 0 ? 1.w : 3.w; double bottomBorder = index != widget.firstHandsets!.specifications!.length - 1 ? 1.w : 4.w; return TableRow( decoration: BoxDecoration( border: Border( top: BorderSide( color: UIColors.aluminium, style: BorderStyle.solid, width: topBorder), bottom: BorderSide( color: UIColors.aluminium, style: BorderStyle.solid, width: bottomBorder), right: BorderSide( color: UIColors.aluminium, style: BorderStyle.solid, width: 3.w), left: BorderSide( color: UIColors.aluminium, style: BorderStyle.solid, width: 3.w), )), children: [ Padding( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 2.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( height: 5.h, ), if (index == 0) sectionTitle('{widget.firstHandsets?.specifications?[index].specification?.label}') ], ), ), specificationsDetails(index, '{widget.secondHandsets?.specifications?[index].description}'), specificationsDetails(index, '${widget.thirdHandsets?.specifications?[index].description}'), ], ); }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.