Updating PrimaryScrollController for Desktop (#102099)
This commit is contained in:
@@ -96,6 +96,7 @@ class PaletteTabView extends StatelessWidget {
|
||||
final TextStyle blackTextStyle = textTheme.bodyText2!.copyWith(color: Colors.black);
|
||||
return Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
itemExtent: kColorItemHeight,
|
||||
children: <Widget>[
|
||||
...primaryKeys.map<Widget>((int index) {
|
||||
|
||||
@@ -60,6 +60,7 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
||||
children: <Widget>[
|
||||
CupertinoScrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
// Add more padding to the normal safe area.
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0)
|
||||
+ MediaQuery.of(context).padding,
|
||||
|
||||
@@ -446,6 +446,7 @@ class CupertinoDemoTab2 extends StatelessWidget {
|
||||
),
|
||||
child: CupertinoScrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: <Widget>[
|
||||
const CupertinoUserInterfaceLevel(
|
||||
data: CupertinoUserInterfaceLevelData.elevated,
|
||||
|
||||
@@ -168,6 +168,7 @@ class _CupertinoTextFieldDemoState extends State<CupertinoTextFieldDemo> {
|
||||
),
|
||||
child: CupertinoScrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 32.0, horizontal: 16.0),
|
||||
|
||||
@@ -104,6 +104,7 @@ class CategoryView extends StatelessWidget {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
key: PageStorageKey<Category?>(category),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 16.0,
|
||||
|
||||
@@ -161,6 +161,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: const EdgeInsets.only(bottom: 88.0),
|
||||
children: <Widget>[
|
||||
const _Heading('FAB Shape'),
|
||||
|
||||
@@ -375,6 +375,7 @@ class _CardsDemoState extends State<CardsDemo> {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
|
||||
children: destinations.map<Widget>((TravelDestination destination) {
|
||||
Widget? child;
|
||||
|
||||
@@ -347,7 +347,12 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
))
|
||||
: theme.chipTheme,
|
||||
child: Scrollbar(child: ListView(children: tiles)),
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: tiles,
|
||||
)
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () => setState(_reset),
|
||||
|
||||
@@ -175,6 +175,7 @@ class _DataTableDemoState extends State<DataTableDemo> {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
children: <Widget>[
|
||||
PaginatedDataTable(
|
||||
|
||||
@@ -64,7 +64,12 @@ class _ElevationDemoState extends State<ElevationDemo> {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Scrollbar(child: ListView(children: buildCards())),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: buildCards(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ class ExpansionTileListDemo extends StatelessWidget {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: <Widget>[
|
||||
const ListTile(title: Text('Top')),
|
||||
ExpansionTile(
|
||||
|
||||
@@ -162,6 +162,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
onWillPop: _onWillPop,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
|
||||
@@ -62,6 +62,7 @@ class IconsDemoState extends State<IconsDemo> {
|
||||
bottom: false,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
children: <Widget>[
|
||||
_IconsDemoCard(handleIconButtonPress, Icons.face), // direction-agnostic icon
|
||||
|
||||
@@ -131,6 +131,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
||||
} else {
|
||||
body = Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: leaveBehindItems.map<Widget>((LeaveBehindItem item) {
|
||||
return _LeaveBehindListItem(
|
||||
confirmDismiss: _confirmDismiss,
|
||||
|
||||
@@ -256,6 +256,7 @@ class _ListDemoState extends State<ListDemo> {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
padding: EdgeInsets.symmetric(vertical: _dense != null ? 4.0 : 8.0),
|
||||
children: listTiles.toList(),
|
||||
),
|
||||
|
||||
@@ -64,6 +64,7 @@ class OverscrollDemoState extends State<OverscrollDemo> {
|
||||
onRefresh: _handleRefresh,
|
||||
child: Scrollbar(
|
||||
child: ListView.builder(
|
||||
primary: true,
|
||||
padding: kMaterialListPadding,
|
||||
itemCount: _items.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
|
||||
@@ -208,6 +208,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
|
||||
),
|
||||
body: Scrollbar(
|
||||
child: ReorderableListView(
|
||||
primary: true,
|
||||
header: _itemType != _ReorderableListType.threeLine
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
||||
@@ -182,6 +182,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
onWillPop: _warnUserAboutInvalidData,
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
primary: true,
|
||||
dragStartBehavior: DragStartBehavior.down,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Column(
|
||||
|
||||
@@ -66,7 +66,12 @@ class TypographyDemo extends StatelessWidget {
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Scrollbar(child: ListView(children: styleItems)),
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: styleItems,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -418,6 +418,7 @@ class _VideoDemoState extends State<VideoDemo> with SingleTickerProviderStateMix
|
||||
connectedCompleter: connectedCompleter,
|
||||
child: Scrollbar(
|
||||
child: ListView(
|
||||
primary: true,
|
||||
children: <Widget>[
|
||||
VideoCard(
|
||||
title: 'Butterfly',
|
||||
|
||||
Reference in New Issue
Block a user