mirror of
https://github.com/openfoodfacts/smooth-app.git
synced 2025-08-26 03:01:45 +08:00
chore: Migration to Dart 3.8 (#6668)
* Migration to Dart 3.8 * New GA * Fix dartdoc
This commit is contained in:
@ -7,9 +7,7 @@ import 'package:smooth_app/l10n/app_localizations.dart';
|
||||
// TODO(monsieurtanuki): we should probably remove that class to avoid confusion with the "compare" button
|
||||
/// Floating Action Button dedicated to Personal Ranking
|
||||
class RankingFloatingActionButton extends StatelessWidget {
|
||||
const RankingFloatingActionButton({
|
||||
required this.onPressed,
|
||||
});
|
||||
const RankingFloatingActionButton({required this.onPressed});
|
||||
|
||||
final VoidCallback onPressed;
|
||||
|
||||
@ -17,33 +15,32 @@ class RankingFloatingActionButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SmoothRevealAnimation(
|
||||
animationCurve: Curves.easeInOutBack,
|
||||
startOffset: const Offset(0.0, 1.0),
|
||||
child: Container(
|
||||
height: MINIMUM_TOUCH_SIZE,
|
||||
margin:
|
||||
EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.09),
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
height: MINIMUM_TOUCH_SIZE,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: onPressed,
|
||||
style: ButtonStyle(
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
const RoundedRectangleBorder(
|
||||
borderRadius: CIRCULAR_BORDER_RADIUS,
|
||||
),
|
||||
),
|
||||
),
|
||||
icon: const Icon(rankingIconData),
|
||||
label: AutoSizeText(
|
||||
AppLocalizations.of(context).myPersonalizedRanking,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
animationCurve: Curves.easeInOutBack,
|
||||
startOffset: const Offset(0.0, 1.0),
|
||||
child: Container(
|
||||
height: MINIMUM_TOUCH_SIZE,
|
||||
margin: EdgeInsets.only(left: MediaQuery.sizeOf(context).width * 0.09),
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
height: MINIMUM_TOUCH_SIZE,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: onPressed,
|
||||
style: ButtonStyle(
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
const RoundedRectangleBorder(
|
||||
borderRadius: CIRCULAR_BORDER_RADIUS,
|
||||
),
|
||||
),
|
||||
),
|
||||
icon: const Icon(rankingIconData),
|
||||
label: AutoSizeText(
|
||||
AppLocalizations.of(context).myPersonalizedRanking,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
);
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user