Отключить текст флаттера Baseline - PullRequest
0 голосов
/ 10 июня 2019

Как отключить текстовую линию?

enter image description here

, потому что мой текст не центрирован

enter image description here

Я пытаюсь центрировать текст на контире.Я использую этот шрифт: https://www.dafont.com/young.font?l[]=10&l[]=1

import 'package:flutte_template/styles/theme_dimens.dart';
import 'package:flutter/material.dart';

class RoundedChip extends StatelessWidget {
  final Widget child;
  final Color color;

  const RoundedChip({@required this.child, @required this.color});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: ThemeDimens.padding4),
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Padding(
             padding: const EdgeInsets.symmetric(vertical: ThemeDimens.padding4),
             child: Text('Drama', style: ThemeTextStyles.mediaDetailGenreText),
            ),
          ],
        ),
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(
          Radius.circular(999),
        ),
        color: color,
      ),
    );
  }
}

  static const TextStyle mediaDetailGenreText = TextStyle(color: ThemeColors.textColor, fontSize: 15, fontWeight: FontWeight.w500);

Ответы [ 2 ]

0 голосов
/ 12 июня 2019

Я думаю, проблема в высоте шрифта ... Вы можете настроить это значение напрямую, в процентах от размера шрифта. Итак, попробуйте значения на глаз: скажем:

Text( "Drama", height: 0.8 );
0 голосов
/ 10 июня 2019

Просто добавьте элемент inputDecoration без поля ввода в текстовое поле, как показано ниже:

TextField(
  decoration: InputDecoration(border: InputBorder.none),
)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...