Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update abstract text style cubit properties and constructor
- Loading branch information
Showing
14 changed files
with
189 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export 'consts.dart'; | ||
export 'cubit/abstract_text_style_cubit.dart'; | ||
export 'view/abstract_text_style_editor.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
enum TypeScale { | ||
headline1, | ||
headline2, | ||
headline3, | ||
headline4, | ||
headline5, | ||
headline6, | ||
subtitle1, | ||
subtitle2, | ||
bodyText1, | ||
bodyText2, | ||
button, | ||
caption, | ||
overline, | ||
} | ||
|
||
const _englishTextTheme = Typography.englishLike2018; | ||
final _blackTextTheme = _englishTextTheme.merge( | ||
Typography.blackMountainView, | ||
); | ||
final _whiteTextTheme = _englishTextTheme.merge( | ||
Typography.whiteMountainView, | ||
); | ||
|
||
final kBlackTextStyles = { | ||
TypeScale.headline1: _blackTextTheme.headline1, | ||
TypeScale.headline2: _blackTextTheme.headline2, | ||
TypeScale.headline3: _blackTextTheme.headline3, | ||
TypeScale.headline4: _blackTextTheme.headline4, | ||
TypeScale.headline5: _blackTextTheme.headline5, | ||
TypeScale.headline6: _blackTextTheme.headline6, | ||
TypeScale.subtitle1: _blackTextTheme.subtitle1, | ||
TypeScale.subtitle2: _blackTextTheme.subtitle2, | ||
TypeScale.bodyText1: _blackTextTheme.bodyText1, | ||
TypeScale.bodyText2: _blackTextTheme.bodyText2, | ||
TypeScale.button: _blackTextTheme.button, | ||
TypeScale.caption: _blackTextTheme.caption, | ||
TypeScale.overline: _blackTextTheme.overline, | ||
}; | ||
|
||
final kWhiteTextStyles = { | ||
TypeScale.headline1: _whiteTextTheme.headline1, | ||
TypeScale.headline2: _whiteTextTheme.headline2, | ||
TypeScale.headline3: _whiteTextTheme.headline3, | ||
TypeScale.headline4: _whiteTextTheme.headline4, | ||
TypeScale.headline5: _whiteTextTheme.headline5, | ||
TypeScale.headline6: _whiteTextTheme.headline6, | ||
TypeScale.subtitle1: _whiteTextTheme.subtitle1, | ||
TypeScale.subtitle2: _whiteTextTheme.subtitle2, | ||
TypeScale.bodyText1: _whiteTextTheme.bodyText1, | ||
TypeScale.bodyText2: _whiteTextTheme.bodyText2, | ||
TypeScale.button: _whiteTextTheme.button, | ||
TypeScale.caption: _whiteTextTheme.caption, | ||
TypeScale.overline: _whiteTextTheme.overline, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export 'cubit/app_bar_theme_cubit.dart'; | ||
export 'view/app_bar_theme_editor.dart'; | ||
export 'constants.dart'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,53 @@ | ||
import 'package:appainter/abstract_text_style/abstract_text_style.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
const _englishTextTheme = Typography.englishLike2018; | ||
const _blackTextTheme = Typography.blackMountainView; | ||
const _whiteTextTheme = Typography.whiteMountainView; | ||
|
||
class Headline1TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline1TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline1!, | ||
blackStyle: _blackTextTheme.headline1!, | ||
whiteStyle: _whiteTextTheme.headline1!, | ||
); | ||
Headline1TextStyleCubit() : super(typeScale: TypeScale.headline1); | ||
} | ||
|
||
class Headline2TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline2TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline2!, | ||
blackStyle: _blackTextTheme.headline2!, | ||
whiteStyle: _whiteTextTheme.headline2!, | ||
); | ||
Headline2TextStyleCubit() : super(typeScale: TypeScale.headline2); | ||
} | ||
|
||
class Headline3TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline3TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline3!, | ||
blackStyle: _blackTextTheme.headline3!, | ||
whiteStyle: _whiteTextTheme.headline3!, | ||
); | ||
Headline3TextStyleCubit() : super(typeScale: TypeScale.headline3); | ||
} | ||
|
||
class Headline4TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline4TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline4!, | ||
blackStyle: _blackTextTheme.headline4!, | ||
whiteStyle: _whiteTextTheme.headline4!, | ||
); | ||
Headline4TextStyleCubit() : super(typeScale: TypeScale.headline4); | ||
} | ||
|
||
class Headline5TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline5TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline5!, | ||
blackStyle: _blackTextTheme.headline5!, | ||
whiteStyle: _whiteTextTheme.headline5!, | ||
); | ||
Headline5TextStyleCubit() : super(typeScale: TypeScale.headline5); | ||
} | ||
|
||
class Headline6TextStyleCubit extends AbstractTextStyleCubit { | ||
Headline6TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.headline6!, | ||
blackStyle: _blackTextTheme.headline6!, | ||
whiteStyle: _whiteTextTheme.headline6!, | ||
); | ||
Headline6TextStyleCubit() : super(typeScale: TypeScale.headline6); | ||
} | ||
|
||
class Subtitle1TextStyleCubit extends AbstractTextStyleCubit { | ||
Subtitle1TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.subtitle1!, | ||
blackStyle: _blackTextTheme.subtitle1!, | ||
whiteStyle: _whiteTextTheme.subtitle1!, | ||
); | ||
Subtitle1TextStyleCubit() : super(typeScale: TypeScale.subtitle1); | ||
} | ||
|
||
class Subtitle2TextStyleCubit extends AbstractTextStyleCubit { | ||
Subtitle2TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.subtitle2!, | ||
blackStyle: _blackTextTheme.subtitle2!, | ||
whiteStyle: _whiteTextTheme.subtitle2!, | ||
); | ||
Subtitle2TextStyleCubit() : super(typeScale: TypeScale.subtitle2); | ||
} | ||
|
||
class BodyText1TextStyleCubit extends AbstractTextStyleCubit { | ||
BodyText1TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.bodyText1!, | ||
blackStyle: _blackTextTheme.bodyText1!, | ||
whiteStyle: _whiteTextTheme.bodyText1!, | ||
); | ||
BodyText1TextStyleCubit() : super(typeScale: TypeScale.bodyText1); | ||
} | ||
|
||
class BodyText2TextStyleCubit extends AbstractTextStyleCubit { | ||
BodyText2TextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.bodyText2!, | ||
blackStyle: _blackTextTheme.bodyText2!, | ||
whiteStyle: _whiteTextTheme.bodyText2!, | ||
); | ||
BodyText2TextStyleCubit() : super(typeScale: TypeScale.bodyText2); | ||
} | ||
|
||
class ButtonTextStyleCubit extends AbstractTextStyleCubit { | ||
ButtonTextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.button!, | ||
blackStyle: _blackTextTheme.button!, | ||
whiteStyle: _whiteTextTheme.button!, | ||
); | ||
ButtonTextStyleCubit() : super(typeScale: TypeScale.button); | ||
} | ||
|
||
class CaptionTextStyleCubit extends AbstractTextStyleCubit { | ||
CaptionTextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.caption!, | ||
blackStyle: _blackTextTheme.caption!, | ||
whiteStyle: _whiteTextTheme.caption!, | ||
); | ||
CaptionTextStyleCubit() : super(typeScale: TypeScale.caption); | ||
} | ||
|
||
class OverlineTextStyleCubit extends AbstractTextStyleCubit { | ||
OverlineTextStyleCubit() | ||
: super( | ||
baseStyle: _englishTextTheme.overline!, | ||
blackStyle: _blackTextTheme.overline!, | ||
whiteStyle: _whiteTextTheme.overline!, | ||
); | ||
OverlineTextStyleCubit() : super(typeScale: TypeScale.overline); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.