QuickBirdEng / survey_kit

Flutter library to create beautiful surveys (aligned with ResearchKit on iOS)
MIT License
127 stars 97 forks source link

Change font size of survey elements #49

Closed PeteSahad closed 2 years ago

PeteSahad commented 2 years ago

Hi,

I'd like to change the font style of the survey elements. I tried overriding the textTheme in SurveyKit().

I found out that headline6 is used for e.g. question type title and selected value (scale). I was able to change color and font size here. However, I wasn't able to change the font size for "type" "intro" (note: I'm using json import). It seems that bodytext2 is used b/c I could change the color - but not the size. Am I missing something?

Thanks in advance.

paulsarknas1 commented 2 years ago

@PeteSahad how did you get the text for headline6 to change? I tried a similar way as you mentioned and my text is blank.

PeteSahad commented 2 years ago

@paulsarknas1 I just added textTheme to SurveyKit():

return SurveyKit(
[...] 
 task: Task.fromJson(task), 
 themeData: Theme.of(context).copyWith(
 [...]
   textTheme: const TextTheme(
                  [...]
                  headline6: TextStyle(fontSize: 20.0, fontWeight: FontWeight.normal, color: Colors.green),
                  [...]
    ),`
   )
[...]
);

I also had the issue with blank text. It worked when I added all other entries aswell (headline1-5, etc.)

paulsarknas1 commented 2 years ago

@PeteSahad Thank you so much!

Numoy commented 2 years ago

I pushed a new version (0.0.21) to fix some alignment with the theme.

Sorry for the inconvenience.