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

[Refactor] Substituir modularstate por state em ComposeTweetPage #398

Merged

Conversation

RoxyRoses
Copy link
Contributor

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

  1. Adicionado o atributo ComposeTweetController no widget de forma explícita, garantindo melhor controle do estado e configuração inicial.
  2. Reformulação da declaração do controlador para maior clareza e acessibilidade no código.
  3. Ajuste no estilo de texto _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',

@RoxyRoses RoxyRoses added deprecation Para destacar o uso de componentes obsoletos refactor Envolve melhorias no código, como substituir o componentes obsoletos labels Jan 21, 2025
@RoxyRoses RoxyRoses self-assigned this Jan 21, 2025
@RoxyRoses RoxyRoses requested a review from a team as a code owner January 21, 2025 16:05
@RoxyRoses RoxyRoses linked an issue Jan 21, 2025 that may be closed by this pull request
4 tasks
@shonorio shonorio force-pushed the 365-substituir-modularstate-por-state-em-composetweetpage branch from 51f89cf to 0279ecb Compare January 26, 2025 10:43
Copy link

codeclimate bot commented Jan 26, 2025

Code Climate has analyzed commit 0279ecb and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2

View more on Code Climate.

@shonorio shonorio merged commit f1bae68 into main Jan 26, 2025
8 checks passed
@shonorio shonorio deleted the 365-substituir-modularstate-por-state-em-composetweetpage branch January 26, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Para destacar o uso de componentes obsoletos refactor Envolve melhorias no código, como substituir o componentes obsoletos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Substituir ModularState por State em ComposeTweetPage
2 participants