-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): refactor platform specific widget styling (#8333)
- Loading branch information
Showing
8 changed files
with
226 additions
and
118 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
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
18 changes: 11 additions & 7 deletions
18
packages/flutterfire_ui/lib/src/auth/widgets/internal/subtitle.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 |
---|---|---|
@@ -1,20 +1,24 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'platform_widget.dart'; | ||
|
||
class Subtitle extends StatelessWidget { | ||
class Subtitle extends PlatformWidget { | ||
final String text; | ||
const Subtitle({Key? key, required this.text}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final isCupertino = CupertinoUserInterfaceLevel.maybeOf(context) != null; | ||
final titleStyle = isCupertino | ||
? CupertinoTheme.of(context).textTheme.navTitleTextStyle | ||
: Theme.of(context).textTheme.subtitle1; | ||
Widget buildCupertino(BuildContext context) { | ||
return Text( | ||
text, | ||
style: CupertinoTheme.of(context).textTheme.navTitleTextStyle, | ||
); | ||
} | ||
|
||
@override | ||
Widget buildMaterial(BuildContext context) { | ||
return Text( | ||
text, | ||
style: titleStyle, | ||
style: Theme.of(context).textTheme.subtitle1, | ||
); | ||
} | ||
} |
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.