Skip to content

Commit

Permalink
fix: add textDirection option
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmannZ committed Aug 20, 2020
1 parent 446c7d0 commit af38ad7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.1] - 20-08-2020.

- Added `textDirection` option.

## [1.0.0+1] - 20-08-2020.

- Added more dartdoc comments to the public API.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlavorBanner(
textDirection: TextDirection.ltr,
child: MaterialApp(
home: Scaffold(
body: Column(
Expand Down Expand Up @@ -71,6 +72,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlavorBanner(
textDirection: TextDirection.ltr,
child: MaterialApp(
home: Scaffold(
body: Column(
Expand Down
2 changes: 2 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlavorBanner(
textDirection: TextDirection.ltr,
child: MaterialApp(
home: Scaffold(
body: Column(
Expand Down Expand Up @@ -67,6 +68,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlavorBanner(
textDirection: TextDirection.ltr,
child: MaterialApp(
home: Scaffold(
body: Column(
Expand Down
8 changes: 6 additions & 2 deletions lib/src/banner/flavor_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import 'package:flavor_config/src/config/flavor_config.dart';
import 'package:flavor_config/src/dialog/device_info_dialog.dart';

class FlavorBanner extends StatelessWidget {
/// The [TextDirection] of the text inside the banner.
final TextDirection textDirection;

/// The child where the banner should be rendered on top of.
final Widget child;

FlavorBanner({
@required this.textDirection,
@required this.child,
});

Expand All @@ -28,8 +32,8 @@ class FlavorBanner extends StatelessWidget {
child: CustomPaint(
painter: BannerPainter(
message: FlavorConfig.instance.flavorName,
textDirection: Directionality.of(context),
layoutDirection: Directionality.of(context),
textDirection: textDirection,
layoutDirection: textDirection,
location: BannerLocation.topStart,
color: FlavorConfig.instance.color,
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flavor_config
description: An easy to use package for creating flavors for any environment.
version: 1.0.0+1
version: 1.0.1
homepage: https://github.com/zino-hofmann/flavor-config-flutter

environment:
Expand Down

0 comments on commit af38ad7

Please sign in to comment.