mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Adds ai_recipe_generation sample (#2242)
Adding the demo app from my I/O talk. Because AI. ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. --------- Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
This commit is contained in:
13
ai_recipe_generation/lib/util/extensions.dart
Normal file
13
ai_recipe_generation/lib/util/extensions.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
extension SliverBreakpointUtils on SliverConstraints {
|
||||
bool get isTablet => crossAxisExtent > 730 && crossAxisExtent < 1000;
|
||||
bool get isDesktop => crossAxisExtent > 1000;
|
||||
bool get isMobile => crossAxisExtent < 730;
|
||||
}
|
||||
|
||||
extension BoxBreakpointUtils on BoxConstraints {
|
||||
bool get isTablet => maxWidth > 730 && maxWidth < 1000;
|
||||
bool get isDesktop => maxWidth > 1000;
|
||||
bool get isMobile => maxWidth < 730;
|
||||
}
|
||||
Reference in New Issue
Block a user