google / flutter.widgets

https://pub.dev/packages/flutter_widgets
BSD 3-Clause "New" or "Revised" License
1.38k stars 486 forks source link

[scrollable_positioned_list] padding issue with Directionality rtl #329

Open jony-ashkar opened 2 years ago

jony-ashkar commented 2 years ago

Problem description

Padding issue when using scrollable_positioned_list with Directionality widget with rtl TextDirection

Steps to reproduce

import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';

void main() { runApp(MaterialApp( home: Scaffold( body: SizedBox( height: 250, child: Directionality( textDirection: TextDirection.rtl, child: ScrollablePositionedList.separated( padding: const EdgeInsets.symmetric(horizontal: 20.0), scrollDirection: Axis.horizontal, itemCount: 5, itemBuilder: (context, index) { return Container( width: 200, height: 150, color: Colors.red, child: Center( child: Text('$index'), ), ); }, separatorBuilder: (context, index) => const SizedBox( width: 20.0, ), ), ), ), ), scrollBehavior: const MaterialScrollBehavior().copyWith( dragDevices: { PointerDeviceKind.mouse, PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind.unknown }, ), )); }

Expected behavior

padding from right and left (horizontal)

Actual behavior

incorrect padding

Environment

Flutter web

jony-ashkar commented 2 years ago

Any updates please?