Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the "Glow" example application, a comprehensive Flutter project demonstrating the use of Gemini and GenUI for creating personalized wallpapers. The changes are extensive, covering the full application source code and configuration for Android, iOS, Linux, macOS, Windows, and web platforms. My review has identified a few critical issues that could prevent the application from compiling or running correctly, such as the use of a non-standard method on Color objects, incorrect property access for color components in a shader, and potentially invalid Gemini model names. I've also included some medium-severity suggestions regarding cross-platform font compatibility and code cleanup.
| static const String defaultModel = 'models/gemini-3-flash-preview'; | ||
| static const String defaultImageModel = 'models/gemini-3-pro-image-preview'; |
There was a problem hiding this comment.
The Gemini model names gemini-3-flash-preview and gemini-3-pro-image-preview appear to be incorrect. These model versions do not seem to exist, which will likely cause API requests to fail. Please update them to valid, available model names, such as gemini-1.5-flash-latest or gemini-1.5-pro-latest.
| static const String defaultModel = 'models/gemini-3-flash-preview'; | |
| static const String defaultImageModel = 'models/gemini-3-pro-image-preview'; | |
| static const String defaultModel = 'models/gemini-1.5-flash-latest'; | |
| static const String defaultImageModel = 'models/gemini-1.5-pro-latest'; |
| Color get tertiary => orangeAccent; | ||
|
|
||
| Color get outline => white10; | ||
| Color get outlineMedium => onBackground.withValues(alpha: 0.2); |
There was a problem hiding this comment.
The method withValues is used on a Color object here and in many other places in this file. This is not a standard method in Dart's Color class and will cause a compilation error unless a custom extension method is defined. If the intention is to change the opacity, the standard withOpacity() method should be used instead.
| Color get outlineMedium => onBackground.withValues(alpha: 0.2); | |
| Color get outlineMedium => onBackground.withOpacity(0.2); |
| Widget build(BuildContext context) { | ||
| return MaterialApp.router( | ||
| debugShowCheckedModeBanner: false, | ||
| theme: ThemeData(useMaterial3: true, fontFamily: 'San Francisco'), |
There was a problem hiding this comment.
The font family is hardcoded to "San Francisco". This font is specific to Apple platforms and will not be available on Android, Windows, or Linux, leading to an inconsistent user interface. To ensure a consistent look and feel across all platforms, you should either bundle the font with the application or use a font from a package like google_fonts.
| theme: ThemeData(useMaterial3: true, fontFamily: 'San Francisco'), | |
| theme: ThemeData(useMaterial3: true), |
| with TickerProviderStateMixin { | ||
| final DraggableScrollableController _sheetController = | ||
| DraggableScrollableController(); | ||
| // ignore: unused_field |
|
Try running |
No description provided.