Skip to content

Add "Glow" example#778

Open
rodydavis wants to merge 1 commit intoflutter:mainfrom
rodydavis:main
Open

Add "Glow" example#778
rodydavis wants to merge 1 commit intoflutter:mainfrom
rodydavis:main

Conversation

@rodydavis
Copy link

No description provided.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +16 to +17
static const String defaultModel = 'models/gemini-3-flash-preview';
static const String defaultImageModel = 'models/gemini-3-pro-image-preview';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
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'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
theme: ThemeData(useMaterial3: true, fontFamily: 'San Francisco'),
theme: ThemeData(useMaterial3: true),

with TickerProviderStateMixin {
final DraggableScrollableController _sheetController =
DraggableScrollableController();
// ignore: unused_field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The // ignore: unused_field comment for _viewModel is incorrect. This field is used in the build method on line 86 as the listenable for the ListenableBuilder. This ignore comment should be removed.

@gspencergoog
Copy link
Collaborator

Try running tool/run_all_tests_and_fixes.sh on the change: that will fix all the copyrights for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants