В
Size: a a a
В
YM
YM
YM
PK
YM
RV
RV
N
RK
RV
RV
class _SeparatedItemBuilderDelegate extends SliverChildBuilderDelegate {
_SeparatedItemBuilderDelegate({
@required IndexedWidgetBuilder itemBuilder,
@required IndexedWidgetBuilder separatorBuilder,
@required int itemCount,
bool addAutomaticKeepAlives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
}) : super( // Copied from [ListView.separated] childrenDelegate value set
(BuildContext context, int index) {
final int itemIndex = index ~/ 2;
Widget widget;
if (index.isEven) {
widget = itemBuilder(context, itemIndex);
} else {
widget = separatorBuilder(context, itemIndex);
assert(() {
if (widget == null) {
throw FlutterError('separatorBuilder cannot return null.');
}
return true;
}());
}
return widget;
},
childCount: _computeSemanticChildCount(itemCount),
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
semanticIndexCallback: (Widget _, int index) {
return index.isEven ? index ~/ 2 : null;
},
);
// Helper method to compute the semantic child count for the separated constructor.
static int _computeSemanticChildCount(int itemCount) {
return max(0, itemCount * 2 - 1);
}
}
RK
class _SeparatedItemBuilderDelegate extends SliverChildBuilderDelegate {
_SeparatedItemBuilderDelegate({
@required IndexedWidgetBuilder itemBuilder,
@required IndexedWidgetBuilder separatorBuilder,
@required int itemCount,
bool addAutomaticKeepAlives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
}) : super( // Copied from [ListView.separated] childrenDelegate value set
(BuildContext context, int index) {
final int itemIndex = index ~/ 2;
Widget widget;
if (index.isEven) {
widget = itemBuilder(context, itemIndex);
} else {
widget = separatorBuilder(context, itemIndex);
assert(() {
if (widget == null) {
throw FlutterError('separatorBuilder cannot return null.');
}
return true;
}());
}
return widget;
},
childCount: _computeSemanticChildCount(itemCount),
addAutomaticKeepAlives: addAutomaticKeepAlives,
addRepaintBoundaries: addRepaintBoundaries,
addSemanticIndexes: addSemanticIndexes,
semanticIndexCallback: (Widget _, int index) {
return index.isEven ? index ~/ 2 : null;
},
);
// Helper method to compute the semantic child count for the separated constructor.
static int _computeSemanticChildCount(int itemCount) {
return max(0, itemCount * 2 - 1);
}
}
АР
OP
Z
r
MyPlugin : FlutterPlugin, MethodCallHandler, PluginRegistry.ActivityResultListener, ActivityAware
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
this.activity = binding.activity;
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean {
if (requestCode == INSTALL_PACKAGE_RESULT) {
if (resultCode == Activity.RESULT_OK) {
channel.invokeMethod(
"installAppResult",
true
)
} else if (resultCode == Activity.RESULT_CANCELED) {
channel.invokeMethod(
"installAppResult",
false
)
}
}
return true
}
ctivity?.startActivityForResult(installAppIntent, INSTALL_PACKAGE_RESULT);установка запускается, но в onActivityResult не прилетает результат усстановки приложения
r
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
this.activity = binding.activity;
binding.addActivityResultListener(this)//добавил эту строчку
}
d