Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ class TabContainer extends ImplicitlyAnimatedWidget {
/// The [TextStyle] applied to the text of the currently selected tab.
///
/// Must specify values for the same properties as [unselectedTextStyle].
/// Defaults to Theme.of(context).textTheme.bodyText2.
/// Defaults to Theme.of(context).textTheme.bodyMedium.
final TextStyle? selectedTextStyle;

/// The [TextStyle] applied to the text of currently unselected tabs.
///
/// Must specify values for the same properties as [selectedTextStyle].
/// Defaults to Theme.of(context).textTheme.bodyText2.
/// Defaults to Theme.of(context).textTheme.bodyMedium.
final TextStyle? unselectedTextStyle;

/// The [TextDirection] for tabs and semantics.
Expand Down
50 changes: 25 additions & 25 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class _ExamplePageState extends State<ExamplePage> {
Color(0xff9aebed),
],
selectedTextStyle:
textTheme.bodyText2?.copyWith(fontSize: 15.0),
textTheme.bodyMedium?.copyWith(fontSize: 15.0),
unselectedTextStyle:
textTheme.bodyText2?.copyWith(fontSize: 13.0),
textTheme.bodyMedium?.copyWith(fontSize: 13.0),
children: _getChildren1(),
tabs: _getTabs1(),
),
Expand All @@ -88,9 +88,9 @@ class _ExamplePageState extends State<ExamplePage> {
color: Colors.black,
tabDuration: const Duration(seconds: 0),
selectedTextStyle:
textTheme.bodyText2?.copyWith(color: Colors.white),
textTheme.bodyMedium?.copyWith(color: Colors.white),
unselectedTextStyle:
textTheme.bodyText2?.copyWith(color: Colors.black),
textTheme.bodyMedium?.copyWith(color: Colors.black),
children: _getChildren2(),
tabs: _getTabs2(),
),
Expand All @@ -100,11 +100,11 @@ class _ExamplePageState extends State<ExamplePage> {
children: [
IconButton(
onPressed: () => _controller.prev(),
icon: Icon(Ionicons.arrow_back),
icon: const Icon(Ionicons.arrow_back),
),
IconButton(
onPressed: () => _controller.next(),
icon: Icon(Ionicons.arrow_forward),
icon: const Icon(Ionicons.arrow_forward),
),
],
),
Expand Down Expand Up @@ -195,7 +195,7 @@ class _ExamplePageState extends State<ExamplePage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Info', style: Theme.of(context).textTheme.headline5),
Text('Info', style: Theme.of(context).textTheme.headlineSmall),
const Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non ex ac metus facilisis pulvinar. In id nulla tellus. Donec vehicula iaculis lacinia. Fusce tincidunt viverra nisi non ultrices. Donec accumsan metus sed purus ullamcorper tincidunt. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
),
Expand All @@ -204,14 +204,14 @@ class _ExamplePageState extends State<ExamplePage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Documents', style: Theme.of(context).textTheme.headline5),
Text('Documents', style: Theme.of(context).textTheme.headlineSmall),
const Spacer(flex: 2),
Expanded(
const Expanded(
flex: 4,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
children: [
Divider(thickness: 1),
Padding(
padding: EdgeInsets.only(left: 10.0),
Expand All @@ -236,9 +236,9 @@ class _ExamplePageState extends State<ExamplePage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Profile', style: Theme.of(context).textTheme.headline5),
Text('Profile', style: Theme.of(context).textTheme.headlineSmall),
const Spacer(flex: 3),
Expanded(
const Expanded(
flex: 3,
child: Row(
children: [
Expand All @@ -247,20 +247,20 @@ class _ExamplePageState extends State<ExamplePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
children: [
Text('username:'),
Text('email:'),
Text('birthday:'),
],
),
),
const Spacer(),
Spacer(),
Flexible(
flex: 5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
children: [
Text('John Doe'),
Text('john.doe@email.com'),
Text('1/1/1985'),
Expand All @@ -276,7 +276,7 @@ class _ExamplePageState extends State<ExamplePage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Settings', style: Theme.of(context).textTheme.headline5),
Text('Settings', style: Theme.of(context).textTheme.headlineSmall),
const Spacer(flex: 1),
Expanded(
flex: 3,
Expand All @@ -288,13 +288,13 @@ class _ExamplePageState extends State<ExamplePage> {
title: const Text('Darkmode'),
value: false,
onChanged: (v) {},
secondary: Icon(Ionicons.moon),
secondary: const Icon(Ionicons.moon),
),
SwitchListTile(
title: const Text('Analytics'),
value: false,
onChanged: (v) {},
secondary: Icon(Ionicons.analytics),
secondary: const Icon(Ionicons.analytics),
),
],
),
Expand All @@ -304,16 +304,16 @@ class _ExamplePageState extends State<ExamplePage> {
];

List<Widget> _getTabs3(BuildContext context) => <Widget>[
Icon(
const Icon(
Ionicons.information_circle,
),
Icon(
const Icon(
Ionicons.document_text,
),
Icon(
const Icon(
Ionicons.person,
),
Icon(
const Icon(
Ionicons.settings,
),
];
Expand All @@ -325,7 +325,7 @@ class _ExamplePageState extends State<ExamplePage> {
children: [
Text(
'Page 1',
style: Theme.of(context).textTheme.headline5?.copyWith(
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
color: Colors.white,
),
),
Expand All @@ -344,7 +344,7 @@ class _ExamplePageState extends State<ExamplePage> {
children: [
Text(
'Page 2',
style: Theme.of(context).textTheme.headline5?.copyWith(
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
color: Colors.white,
),
),
Expand All @@ -364,7 +364,7 @@ Donec ac libero arcu. Pellentesque sollicitudin mi et lectus interdum, sit amet
children: [
Text(
'Page 3',
style: Theme.of(context).textTheme.headline5?.copyWith(
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
color: Colors.white,
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/src/tab_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ class TabContainer extends ImplicitlyAnimatedWidget {
/// The [TextStyle] applied to the text of the currently selected tab.
///
/// Must specify values for the same properties as [unselectedTextStyle].
/// Defaults to Theme.of(context).textTheme.bodyText2.
/// Defaults to Theme.of(context).textTheme.bodyMedium.
final TextStyle? selectedTextStyle;

/// The [TextStyle] applied to the text of currently unselected tabs.
///
/// Must specify values for the same properties as [selectedTextStyle].
/// Defaults to Theme.of(context).textTheme.bodyText2.
/// Defaults to Theme.of(context).textTheme.bodyMedium.
final TextStyle? unselectedTextStyle;

/// The [TextDirection] for tabs and semantics.
Expand Down Expand Up @@ -366,10 +366,10 @@ class _TabContainerState extends AnimatedWidgetBaseState<TabContainer> {
@override
void didChangeDependencies() {
_selectedTextStyle = widget.selectedTextStyle ??
Theme.of(context).textTheme.bodyText2 ??
Theme.of(context).textTheme.bodyMedium ??
const TextStyle();
_unselectedTextStyle = widget.unselectedTextStyle ??
Theme.of(context).textTheme.bodyText2 ??
Theme.of(context).textTheme.bodyMedium ??
const TextStyle();
_textDirection = widget.textDirection ?? Directionality.of(context);
_tabExtent = max(widget.tabExtent, widget.radius * 2);
Expand Down
Loading