OnBoarding: Dynamically change the text size

This way it looks a bit better on smaller devices
This commit is contained in:
Vishesh Handa
2019-06-17 20:23:49 +02:00
parent d653663a47
commit 3d26ba0beb
3 changed files with 16 additions and 4 deletions

View File

@ -1,3 +1,4 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:dots_indicator/dots_indicator.dart'; import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:function_types/function_types.dart'; import 'package:function_types/function_types.dart';
@ -173,10 +174,11 @@ class OnBoardingPage1 extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center(child: header), Center(child: header),
SizedBox(height: 64.0), SizedBox(height: 64.0),
Text( AutoSizeText(
"A Journaling App focused on\nOpenness and Data Privacy", "A Journaling App focused on\nOpenness and Data Privacy",
style: textTheme.headline, style: textTheme.headline,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: 2,
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -208,10 +210,11 @@ class OnBoardingPage2 extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center(child: header), Center(child: header),
SizedBox(height: 64.0), SizedBox(height: 64.0),
Text( AutoSizeText(
"Your Journal Entries are stored in a standard Markdown + YAML Header format", "Your Journal Entries are stored in a\nstandard Markdown + YAML\nHeader format",
style: textTheme.headline, style: textTheme.headline,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: 3,
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -243,10 +246,11 @@ class OnBoardingPage3 extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center(child: header), Center(child: header),
SizedBox(height: 64.0), SizedBox(height: 64.0),
Text( AutoSizeText(
"Sync your Local Git Repo\nwith any provider", "Sync your Local Git Repo\nwith any provider",
style: textTheme.headline, style: textTheme.headline,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines: 2,
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

View File

@ -29,6 +29,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
auto_size_text:
dependency: "direct main"
description:
name: auto_size_text
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
badges: badges:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -23,6 +23,7 @@ dependencies:
flutter_markdown: ^0.2.0 flutter_markdown: ^0.2.0
flutter_email_sender: ^2.0.2 flutter_email_sender: ^2.0.2
function_types: ^0.0.2 function_types: ^0.0.2
auto_size_text: ^2.0.1
dev_dependencies: dev_dependencies:
flutter_launcher_icons: "^0.7.2" flutter_launcher_icons: "^0.7.2"