forked from openfoodfacts/smooth-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Photo gallery with tabs (openfoodfacts#5872)
- Loading branch information
Showing
17 changed files
with
1,287 additions
and
483 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
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,32 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
class BorderRadiusHelper { | ||
BorderRadiusHelper._(); | ||
|
||
/// [InkWell] only supports [BorderRadius]. | ||
/// This helps to create a [BorderRadius] from a [BorderRadiusDirectional]. | ||
static BorderRadius fromDirectional({ | ||
required BuildContext context, | ||
Radius? topStart, | ||
Radius? topEnd, | ||
Radius? bottomStart, | ||
Radius? bottomEnd, | ||
}) { | ||
final TextDirection textDirection = Directionality.of(context); | ||
|
||
return BorderRadius.only( | ||
topLeft: textDirection == TextDirection.ltr | ||
? topStart ?? Radius.zero | ||
: topEnd ?? Radius.zero, | ||
topRight: textDirection == TextDirection.ltr | ||
? topEnd ?? Radius.zero | ||
: topStart ?? Radius.zero, | ||
bottomLeft: textDirection == TextDirection.ltr | ||
? bottomStart ?? Radius.zero | ||
: bottomEnd ?? Radius.zero, | ||
bottomRight: textDirection == TextDirection.ltr | ||
? bottomEnd ?? Radius.zero | ||
: bottomStart ?? Radius.zero, | ||
); | ||
} | ||
} |
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.