Skip to content

Commit

Permalink
Merge branch 'example/services-list-custom-scroll-view-handling' into…
Browse files Browse the repository at this point in the history
… example/services-list

# Conflicts:
#	example/lib/peripheral_details/components/peripheral_details_view.dart
  • Loading branch information
martawoldanska committed Jan 21, 2020
2 parents a8021d9 + 04b4b32 commit 4a78702
Showing 1 changed file with 27 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ class PeripheralDetailsView extends StatelessWidget {
Widget build(BuildContext context) {
return CustomScrollView(
slivers: <Widget>[
SliverSafeArea(
top: false,
sliver: SliverPadding(
padding: const EdgeInsets.all(8.0),
sliver: SliverToBoxAdapter(
child: BlocBuilder<PeripheralDetailsBloc, PeripheralDetailsState>(
builder: (context, state) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
PropertyRow(
title: 'Identifier',
titleIcon: Icon(Icons.perm_device_information),
titleColor: Theme.of(context).primaryColor,
value: state.peripheral.id,
),
_createServiceView(context, state)
],
);
},
),
SliverPadding(
padding: const EdgeInsets.all(8.0),
sliver: SliverToBoxAdapter(
child: BlocBuilder<PeripheralDetailsBloc, PeripheralDetailsState>(
builder: (context, state) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
PropertyRow(
title: 'Identifier',
titleIcon: Icon(Icons.perm_device_information),
titleColor: Theme.of(context).primaryColor,
value: state.peripheral.id,
),
],
);
},
),
),
),
BlocBuilder<PeripheralDetailsBloc, PeripheralDetailsState>(
builder: (context, state) {
return _createServiceView(context, state);
},
)
],
);
}
Expand All @@ -43,13 +44,11 @@ class PeripheralDetailsView extends StatelessWidget {
BuildContext context,
PeripheralDetailsState state,
) {
return Flexible(
fit: FlexFit.loose,
child: ListView.builder(
shrinkWrap: true,
itemCount: state.bleServiceStates.length,
itemBuilder: (context, index) => _createServiceTileView(
context, state.bleServiceStates[index], index),
return SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) =>
_createServiceTileView(context, state.bleServiceStates[index], index),
childCount: state.bleServiceStates.length,
),
);
}
Expand Down

0 comments on commit 4a78702

Please sign in to comment.