王亚玲 2 years ago
parent fa4082ee7a
commit a1678451ac

@ -1,7 +1,7 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
package_info_plus=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/ package_info_plus=/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/
package_info_plus_linux=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/ package_info_plus_linux=/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/
package_info_plus_macos=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.3.0/ package_info_plus_macos=/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.3.0/
package_info_plus_web=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.5/ package_info_plus_web=/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.5/
package_info_plus_windows=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-1.0.5/ package_info_plus_windows=/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-1.0.5/
r_upgrade=/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/ r_upgrade=/Users/datang/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"package_info_plus","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/","native_build":true,"dependencies":[]},{"name":"r_upgrade","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/","native_build":true,"dependencies":[]}],"android":[{"name":"package_info_plus","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/","native_build":true,"dependencies":[]},{"name":"r_upgrade","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info_plus_macos","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.3.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus_linux","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/","native_build":false,"dependencies":[]}],"windows":[{"name":"package_info_plus_windows","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-1.0.5/","native_build":false,"dependencies":[]}],"web":[{"name":"package_info_plus_web","path":"/Users/zhangmeng/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.5/","dependencies":[]}]},"dependencyGraph":[{"name":"package_info_plus","dependencies":["package_info_plus_linux","package_info_plus_macos","package_info_plus_windows","package_info_plus_web"]},{"name":"package_info_plus_linux","dependencies":[]},{"name":"package_info_plus_macos","dependencies":[]},{"name":"package_info_plus_web","dependencies":[]},{"name":"package_info_plus_windows","dependencies":[]},{"name":"r_upgrade","dependencies":[]}],"date_created":"2022-06-07 14:38:49.619690","version":"3.0.0"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"package_info_plus","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/","native_build":true,"dependencies":[]},{"name":"r_upgrade","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/","native_build":true,"dependencies":[]}],"android":[{"name":"package_info_plus","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus-1.4.2/","native_build":true,"dependencies":[]},{"name":"r_upgrade","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/r_upgrade-0.3.8+2/","native_build":true,"dependencies":[]}],"macos":[{"name":"package_info_plus_macos","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_macos-1.3.0/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus_linux","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/","native_build":false,"dependencies":[]}],"windows":[{"name":"package_info_plus_windows","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_windows-1.0.5/","native_build":false,"dependencies":[]}],"web":[{"name":"package_info_plus_web","path":"/Users/datang/.pub-cache/hosted/pub.dartlang.org/package_info_plus_web-1.0.5/","dependencies":[]}]},"dependencyGraph":[{"name":"package_info_plus","dependencies":["package_info_plus_linux","package_info_plus_macos","package_info_plus_windows","package_info_plus_web"]},{"name":"package_info_plus_linux","dependencies":[]},{"name":"package_info_plus_macos","dependencies":[]},{"name":"package_info_plus_web","dependencies":[]},{"name":"package_info_plus_windows","dependencies":[]},{"name":"r_upgrade","dependencies":[]}],"date_created":"2022-06-24 11:54:55.391030","version":"3.0.2"}

@ -36,9 +36,14 @@ enum AndroidStoreName {
final String name; final String name;
final String packageName; final String packageName;
static AndroidStoreName getValue(String packageName) => static AndroidStoreName getValue(String packageName) {
AndroidStoreName.values var re =AndroidStoreName.values
.firstWhere((element) => element.packageName == packageName); .firstWhere((element) => element.packageName == packageName,orElse: ()=>-1);
if(re=1)
return ;
}
AndroidStore get getAndroidStore => AndroidStore.internal(packageName); AndroidStore get getAndroidStore => AndroidStore.internal(packageName);
@ -159,6 +164,7 @@ class AppUpgrade {
Expanded( Expanded(
child: MaterialButton( child: MaterialButton(
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: const Text( child: const Text(
@ -183,39 +189,49 @@ class AppUpgrade {
onPressed: () async { onPressed: () async {
Navigator.pop(context); Navigator.pop(context);
if (Platform.isAndroid) { if (Platform.isAndroid) {
var stores = await RUpgrade.androidStores; var stores = await RUpgrade.androidStores;///
if (stores == null || stores.isEmpty) { if (stores == null || stores.isEmpty) {
onLaunchFail?.call(); onLaunchFail?.call();
return; return;
} }
print(stores);
AndroidStoreName? selectStore; AndroidStoreName? selectStore;
await showModalBottomSheet( await showModalBottomSheet(
isDismissible: false, isDismissible: false,
context: context, context: context,
builder: (context) { builder: (context) {
return FittedBox(
child: ListView.separated( return SizedBox(
itemBuilder: (context, index) { height:450,
var value = child: ListView.separated(
AndroidStoreName.getValue( itemBuilder: (context, index) {
stores[index].packageName); var value =
return GestureDetector( AndroidStoreName.getValue(
onTap: () { stores[index].packageName);
Navigator.pop(context); print("这是${value}");
selectStore = value; print("这是${ stores[index].packageName}");
}, return Container();
child: Center( // return GestureDetector(
child: Text(value.name), // onTap: () {
), // Navigator.pop(context);
); // selectStore = value;
}, // },
separatorBuilder: (context, index) { // child: Center(
return const SizedBox( // child: Text(value.name),
height: 10, // ),
); // );
}, },
itemCount: stores.length), separatorBuilder: (context, index) {
); return const SizedBox(
height: 10,
);
},
itemCount: stores.length),
)
;
}); });
if (selectStore == null) return; if (selectStore == null) return;

Loading…
Cancel
Save