dart Flutter Web应用程序在移动的浏览器上保持斜体

gxwragnw  于 2023-03-21  发布在  Flutter
关注(0)|答案(1)|浏览(164)

我的flutter网页应用程序保持斜体我的文本时,我打开它与我的移动的网络浏览器,我甚至尝试使用富文本小部件,但仍然没有什么,但它看起来正常总是在我的网络浏览器在我的电脑上
我甚至试着将textstyle的富文本属性设置为normal,只是为了确保它没有使用斜体字体,现在我只是不知道,有什么想法请,谢谢

Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        MouseRegion(
                            cursor: SystemMouseCursors.click,
                            child: GestureDetector(
                                onTap: () {
                                  ref
                                      .read(homepageProvider)
                                      .setShowSearchDrop();
                                  ref.read(homepageProvider).getData();
                                },
                                child: Container(
                                    decoration: BoxDecoration(
                                        color: colorScheme!.primary,
                                        borderRadius:
                                            BorderRadius.circular(100)),
                                    width: 12 / 100 * screenWidth,
                                    height: 5 / 100 * screenWidth,
                                    padding:
                                        EdgeInsets.all(0 / 100 * screenHeight),
                                    child: SvgPicture.asset(
                                      "assets/images/menu_mobile.svg",
                                      semanticsLabel: 'Acme Logo',
                                      color: colorScheme.greyMain,
                                    )))),
                        Spacer(),
                        RichText(
                          // Controls visual overflow
                          //overflow: TextOverflow.fade,

                          // Controls how the text should be aligned horizontally
                          textAlign: TextAlign.center,

                          // Control the text direction
                          // textDirection: TextDirection.ltr,

                          // Whether the text should break at soft line breaks
                          softWrap: false,

                          // Maximum number of lines for the text to span
                          maxLines: 1,

                          // The number of font pixels for each logical pixel
                          textScaleFactor: 0.9,
                          text: TextSpan(
                            text: 'e',
                            style: TextStyle(
                                color: colorScheme.secondary,
                                fontFamily: 'Nordeco',
                                fontSize: 8 / 100 * screenWidth,
                                fontWeight: FontWeight.w900),
                            children: <TextSpan>[
                              TextSpan(
                                  text: 'travella',
                                  style: TextStyle(
                                      color: colorScheme.greyMain!
                                          .withOpacity(0.9),
                                      fontFamily: 'Nordeco',
                                      fontSize: 8 / 100 * screenWidth,
                                      fontWeight: FontWeight.w900)),
                              TextSpan(
                                  text: '.com',
                                  style: TextStyle(
                                      color: colorScheme.secondary,
                                      fontFamily: 'Nordeco',
                                      fontSize: 8 / 100 * screenWidth,
                                      fontWeight: FontWeight.w900))
                            ],
                          ),
                        ),
                        Spacer(),
                        MouseRegion(
                            cursor: SystemMouseCursors.click,
                            child: GestureDetector(
                                onTap: () {},
                                child: Container(
                                    decoration: BoxDecoration(
                                        color: colorScheme.secondary,
                                        borderRadius:
                                            BorderRadius.circular(100)),
                                    width: 8.5 / 100 * screenWidth,
                                    height: 8.5 / 100 * screenWidth,
                                    padding: EdgeInsets.all(
                                        1.2 / 100 * screenHeight),
                                    child: SvgPicture.asset(
                                      "assets/images/search.svg",
                                      semanticsLabel: 'Acme Logo',
                                      color: colorScheme.background,
                                    )))),
                        SizedBox(
                          width: 2 / 100 * screenWidth,
                        )
                      ])),
              Container(
                  padding: EdgeInsets.only(
                      top: 1 / 100 * screenHeight,
                      bottom: 1 / 100 * screenHeight),
                  color: colorScheme.primary,
                  width: screenWidth,
                  height: 9 / 100 * screenHeight,
                  child: ListView(
                      physics: const BouncingScrollPhysics(
                          parent: AlwaysScrollableScrollPhysics()),
                      scrollDirection: Axis.horizontal,
                      padding: EdgeInsets.all(1 / 100 * screenWidth),
                      children: <Widget>[
                        SizedBox(
                          width: 3 / 100 * screenWidth,
                        ),
                        MouseRegion(
                            cursor: SystemMouseCursors.click,
                            child: GestureDetector(
                                onTap: () {},
                                child: Container(
                                    height: 3 / 100 * screenHeight,
                                    width: 22 / 100 * screenWidth,
                                    padding:
                                        EdgeInsets.all(0.1 / 100 * screenWidth),
                                    decoration: BoxDecoration(
                                        border: Border.all(
                                            color: colorScheme.greyMain!
                                                .withOpacity(0.6)),
                                        color: colorScheme.background,
                                        borderRadius:
                                            BorderRadius.circular(30)),
                                    child: Row(
                                        mainAxisAlignment:
                                            MainAxisAlignment.center,
                                        crossAxisAlignment:
                                            CrossAxisAlignment.center,
                                        children: <Widget>[
                                          RichText(
                                              // Controls visual overflow
                                              //overflow: TextOverflow.fade,

                                              // Controls how the text should be aligned horizontally
                                              textAlign: TextAlign.center,

                                              // Control the text direction
                                              // textDirection: TextDirection.ltr,

                                              // Whether the text should break at soft line breaks
                                              softWrap: false,

                                              // Maximum number of lines for the text to span
                                              maxLines: 1,

                                              // The number of font pixels for each logical pixel
                                              textScaleFactor: 0.9,
                                              text: TextSpan(
                                                  text: ("Hotels"),
                                                  style: TextStyle(
                                                      fontStyle:
                                                          FontStyle.normal,
                                                      color:
                                                          colorScheme.greyMain,
                                                      fontFamily: 'Brasley',
                                                      fontSize:
                                                          4 / 100 * screenWidth,
                                                      fontWeight:
                                                          FontWeight.w600),
                                                  children: <TextSpan>[]))
                                        ])
kq0g1dla

kq0g1dla1#

flutter build web --web-renderer canvaskit

为我工作

相关问题