Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get.defaultTransition cannot be null, customize PageTransitionsTheme does not take effect. #3274

Open
boomcx opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@boomcx
Copy link

boomcx commented Dec 17, 2024

Describe the bug
When Get.root launch, Get.context is null, and Get.theme always returns ThemeData.fallback(), so config.defaultTransition always has a value, it's impossible to be null.

Screenshots
WeChatbe9f8b4dfce70dd8d35fe56cff86046b

WeChatda8fa5112ad25ba0f6a48f344b18f9a0

WeChat2b53478d28dcfc6fd4a4e9923f0ceda3

example:

void main() => runApp(MaterialApp(home: MyApp()));

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp.router(
      debugShowCheckedModeBanner: false,
      getPages: AppPages.routes,
      backButtonDispatcher: MRootBackButtonDispatcher(),
      theme: ThemeData(
        pageTransitionsTheme: const PageTransitionsTheme(
          builders: {
            // TargetPlatform.android: PopScopePageTransitionsBuilder(),
            TargetPlatform.iOS: PopScopePageTransitionsBuilder(),
          },
        ),
      ), 
    );
  }
}

Expected behavior

I think replacing

Get.theme.pageTransitionsTheme.builders[platform]

with

(config.theme ?? Get.theme).pageTransitionsTheme.builders[platform]

in the GetRootState.getThemeTransition method,can solve this problem.

Flutter Version:

Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (5 weeks ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3

Getx Version:

get: ^5.0.0-release-candidate-9.2.1

Describe on which device you found the bug:

iPhone12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants