Skip to content

Conversation

NBA2K1
Copy link
Contributor

@NBA2K1 NBA2K1 commented May 31, 2025

This PR includes the following fixes and improvements:

  • 🛠️ Fix exception when leaving the Code Editor (service.dart)

    • Put _executeLib() call in try/catch to prevent crashes caused by undefined variables in user-provided extension code.
  • 🔧 Fix Flutter Inspector exception in Select Widget Mode (router.dart)

    • Delays provider modification to avoid mutating state during widget lifecycle events.
  • 🎮 QOL: Auto-exit fullscreen after final episode (anime_player_view.dart)

    • Improves user experience when watching anime by exiting fullscreen after the last episode ends.
  • 🧭 UI tweak: Center Discord icon & match GitHub button size (More > About) (about_screen.dart)

    • Aligns button layout visually for a more polished look.
    • Before:
      image
    • After:
      image
  • 🎹 Set keyboard type to alphanumeric in Code Editor's Query & Url textfield (edit_code.dart)

    • To fix this issue:
      image

NBA2K1 added 6 commits May 31, 2025 15:29
Change keyboard type to alphanumeric
Fix exception when using "Select Widget Mode" of the Flutter Inspector:

```
Exception has occurred.
FlutterError (Tried to modify a provider while the widget tree was building.
If you are encountering this error, chances are you tried to modify a provider
in a widget life-cycle, such as but not limited to:
- build
- initState
- dispose
- didUpdateWidget
- didChangeDependencies

Modifying a provider inside those life-cycles is not allowed, as it could
lead to an inconsistent UI state. For example, two widgets could listen to the
same provider, but incorrectly receive different states.

To fix this problem, you have one of two solutions:
- (preferred) Move the logic for modifying your provider outside of a widget
  life-cycle. For example, maybe you could update your provider inside a button's
  onPressed instead.

- Delay your modification, such as by encapsulating the modification
  in a `Future(() {...})`.
  This will perform your update after the widget tree is done building.)
```
And adjust the GitHub button size to match the now larger Discord button.
If the last episode of an Anime has ended, exit fullscreen mode.
When leaving the Code Editor of certain Extensions, this Exception would throw:
```
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Runtime Error: Undefined variable: source (Original error: Undefined property 'source' on Madara.)
#0      InterpreterVisitor.visitSimpleIdentifier (package:d4rt/src/interpreter_visitor.dart:393:7)
interpreter_visitor.dart:393
#1      SimpleIdentifierImpl.accept (package:analyzer/src/dart/ast/ast.dart:16123:50)
ast.dart:16123
#2      InterpreterVisitor.visitPostfixExpression (package:d4rt/src/interpreter_visitor.dart:3930:41)
interpreter_visitor.dart:3930
#3      PostfixExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:14311:50)
ast.dart:14311
#4      InterpreterVisitor._evaluateArguments (package:d4rt/src/interpreter_visitor.dart:5569:23)
interpreter_visitor.dart:5569
#5      InterpreterVisitor.visitMethodInvocation (package:d4rt/src/interpreter_visitor.dart:2178:13)
interpreter_visitor.dart:2178
kodjodevf#6      MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:12246:50)
ast.dart:12246
kodjodevf#7      InterpretedClass.createAndInitializeInstance (package:d4rt/src/runtime_types.dart:232:53)
runtime_types.dart:232
kodjodevf#8      InterpretedClass.call (package:d4rt/src/runtime_types.dart:299:22)
runtime_types.dart:299
kodjodevf#9      InterpreterVisitor.visitMethodInvocation (package:d4rt/src/interpreter_visitor.dart:2161:28)
interpreter_visitor.dart:2161
kodjodevf#10     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:12246:50)
ast.dart:12246
kodjodevf#11     InterpreterVisitor.visitVariableDeclarationList (package:d4rt/src/interpreter_visitor.dart:3026:42)
interpreter_visitor.dart:3026
kodjodevf#12     VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:18695:15)
ast.dart:18695
kodjodevf#13     InterpreterVisitor.visitVariableDeclarationStatement (package:d4rt/src/interpreter_visitor.dart:135:27)
interpreter_visitor.dart:135
kodjodevf#14     VariableDeclarationStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:18753:15)
ast.dart:18753
kodjodevf#15     InterpreterVisitor.executeBlock (package:d4rt/src/interpreter_visitor.dart:66:33)
interpreter_visitor.dart:66
kodjodevf#16     InterpretedFunction.call (package:d4rt/src/callable.dart:589:36)
callable.dart:589
kodjodevf#17     D4rt.execute (package:d4rt/src/d4rt_base.dart:220:43)
d4rt_base.dart:220
kodjodevf#18     DartExtensionService._executeLib (package:mangayomi/eval/dart/service.dart:24:17)
service.dart:24
kodjodevf#19     DartExtensionService.getSourcePreferences (package:mangayomi/eval/dart/service.dart:179:25)
service.dart:179
kodjodevf#20     getSourcePreference (package:mangayomi/services/get_source_preference.dart:6:38)
get_source_preference.dart:6
kodjodevf#21     _ExtensionDetailState.build.<anonymous closure>.<anonymous closure> (package:mangayomi/modules/browse/extension/extension_detail.dart:173:44)
extension_detail.dart:173
kodjodevf#22     State.setState (package:flutter/src/widgets/framework.dart:1199:30)
framework.dart:1199
kodjodevf#23     _ExtensionDetailState.build.<anonymous closure> (package:mangayomi/modules/browse/extension/extension_detail.dart:171:23)
extension_detail.dart:171
<asynchronous suspension>
```
@NBA2K1 NBA2K1 changed the title Change keyboard type to alphanumeric Fix inspector/crash issues & improve UX in extension, player, and UI Jun 1, 2025
@kodjodevf kodjodevf merged commit 714ee50 into kodjodevf:main Jun 1, 2025
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

Successfully merging this pull request may close these issues.

2 participants