[Refactor] Substituir modularstate por state em ComposeTweetPage
#398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sugestão de Pull Request
Este Pull Request tem como objetivo aprimorar o código da página
ComposeTweetPage
ao reorganizar e melhorar a legibilidade do trecho destacado. A mudança incorpora boas práticas como correção na inicialização do controlador e ajusta o estilo utilizado na exibição de texto.Alterações Realizadas
ComposeTweetController
no widget de forma explícita, garantindo melhor controle do estado e configuração inicial._kTextStyleNewTweetAnonymousHint
, incluindo a padronização de fonte e possíveis melhorias futuras para consistência com as diretrizes de design.Git Diff Atualizado
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_modular/flutter_modular.dart'; import 'package:flutter_svg/svg.dart'; import 'package:mobx/mobx.dart'; @@ -16,25 +15,27 @@ class ComposeTweetPage extends StatefulWidget { const ComposeTweetPage({ Key? key, this.title = 'Publicar', this.showAppBar = false, required this.composeTweetController, }) : super(key: key); final String title; final bool showAppBar; final ComposeTweetController composeTweetController; @override _ComposeTweetPageState createState() => _ComposeTweetPageState(); } class _ComposeTweetPageState extends ModularState<ComposeTweetPage, ComposeTweetController> extends State<ComposeTweetPage> with SnackBarHandler { final String inputHint = 'Deixe seu comentário'; final String anonymousHint = 'Sua publicação é anônima. As usuárias do app podem comentar sua publicação, mas só você pode iniciar uma conversa com elas.'; List<ReactionDisposer>? _disposers; final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); PageProgressState _currentState = PageProgressState.initial; ComposeTweetController get controller => widget.composeTweetController; TextStyle get _kTextStyleNewTweetAnonymousHint => const TextStyle( fontFamily: 'Lato',