-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pen size picker in vertical toolbar
- Loading branch information
Showing
4 changed files
with
100 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RowCol extends StatelessWidget { | ||
const RowCol({ | ||
super.key, | ||
required this.axis, | ||
this.mainAxisSize = MainAxisSize.max, | ||
this.mainAxisAlignment = MainAxisAlignment.start, | ||
required this.children, | ||
}); | ||
|
||
final Axis axis; | ||
final MainAxisSize mainAxisSize; | ||
final MainAxisAlignment mainAxisAlignment; | ||
final List<Widget> children; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return axis == Axis.horizontal | ||
? Row( | ||
mainAxisSize: mainAxisSize, | ||
mainAxisAlignment: mainAxisAlignment, | ||
children: children, | ||
) | ||
: Column( | ||
mainAxisSize: mainAxisSize, | ||
mainAxisAlignment: mainAxisAlignment, | ||
children: children, | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
extension AxisExtensions on Axis { | ||
Axis get opposite => switch (this) { | ||
Axis.horizontal => Axis.vertical, | ||
Axis.vertical => Axis.horizontal, | ||
}; | ||
} | ||
|
||
extension AxisDirectionExtensions on AxisDirection { | ||
Axis get axis => switch (this) { | ||
AxisDirection.up || AxisDirection.down => Axis.vertical, | ||
AxisDirection.left || AxisDirection.right => Axis.horizontal, | ||
}; | ||
} |