Skip to content

开发模式下一切正常,打包后,主题中的字体大小,和使用了的padding大小都失效了 #595

Open
@yi-boide

Description

@yi-boide

开发模式下一切正常,打包后,主题中的字体大小,和使用了的padding大小都失效了

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:xxxx/common/theme/color_scheme.dart';

final defaultTextStyle = TextStyle(
  fontSize: 14.sp,
  color: SimiColorScheme.textPrimary,
);

final specialNumberTextStyle = TextStyle(
  fontSize: 18.sp,
  fontFamily: 'DINPro',
  fontWeight: FontWeight.w500,
);

final specialTextStyle = TextStyle(
  fontSize: 18.sp,
  fontFamily: 'YouSheBiaoTiHei',
  fontWeight: FontWeight.bold,
);

final textTheme = TextTheme(
  headlineMedium: TextStyle(
    fontSize: 28.sp,
    fontWeight: FontWeight.bold,
  ),
  titleMedium: TextStyle(
    fontSize: 16.sp,
    fontWeight: FontWeight.bold,
  ),
  bodyLarge: TextStyle(
    fontSize: 18.sp,
    fontWeight: FontWeight.bold,
  ),
  bodyMedium: defaultTextStyle,
  bodySmall: TextStyle(
    fontSize: 12.sp,
    color: SimiColorScheme.textSecondary,
  ),
);
Widget app = ScreenUtilInit(
      designSize: const Size(375, 812),
      minTextAdapt: true,
      splitScreenMode: true,
      builder: (context, child) {
        return DefaultTextStyle(
          style: defaultTextStyle,
          child: GetMaterialApp(
            title: "XXXX",
            initialRoute: AppPages.INITIAL,
            getPages: AppPages.routes,
            theme: themeData,
            debugShowCheckedModeBanner: false,
            builder: FToastBuilder(),
          ),
        );
      },
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions