mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 23:03:43 +00:00
fix: foreground task scope (#314)
This commit is contained in:
2 files changed
+6
-6
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -14,7 +15,8 @@ class AppView extends GetView<AppController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final config = controller.downloaderConfig.value;
|
||||
return GetMaterialApp.router(
|
||||
return WithForegroundTask(
|
||||
child: GetMaterialApp.router(
|
||||
useInheritedMediaQuery: true,
|
||||
debugShowCheckedModeBanner: false,
|
||||
theme: GopeedTheme.light,
|
||||
@@ -30,6 +32,7 @@ class AppView extends GetView<AppController> {
|
||||
],
|
||||
supportedLocales: messages.keys.keys.map((e) => toLocale(e)).toList(),
|
||||
getPages: AppPages.routes,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../routes/app_pages.dart';
|
||||
@@ -12,7 +11,7 @@ class HomeView extends GetView<HomeController> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetRouterOutlet.builder(builder: (context, delegate, currentRoute) {
|
||||
switch (currentRoute?.location) {
|
||||
switch (currentRoute?.uri.path) {
|
||||
case Routes.EXTENSION:
|
||||
controller.currentIndex.value = 1;
|
||||
break;
|
||||
@@ -24,8 +23,7 @@ class HomeView extends GetView<HomeController> {
|
||||
break;
|
||||
}
|
||||
|
||||
return WithForegroundTask(
|
||||
child: Scaffold(
|
||||
return Scaffold(
|
||||
// extendBody: true,
|
||||
body: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -158,7 +156,6 @@ class HomeView extends GetView<HomeController> {
|
||||
// },
|
||||
// )
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user