Build a Flutter App with Gemini AI
Vložit
- čas přidán 14. 03. 2024
- Want to add cutting-edge AI to your Flutter app? This video is your one-stop shop!
Learn how to effortlessly integrate Gemini, Google's powerful AI tool, into your Flutter project.
Don't wait, unleash the power of AI in your next project!
#Flutter #BuildWithGemini #GeminiAI #AI #AppDevelopment #TextGeneration #Tutorial #GoogleAI - Věda a technologie
Some people thought it was an AI generating a whole code for an app.
I got scammed bro
The title is honestly misleading. What should've been the title is "Build a UI on top of Gemini API using Flutter"
totally agree. Disappointing.
Good
Hi, 2:53 of your video had a yellow line underneath that bool _loading = false was not used, and at 2:57 the yellow line disappeared, which puzzled us. Tell me.
Hi @adilbekkurmanbekuulu7999, Yellow line was there because of the value of the field '_loading' was not used.
I have updated the send button code in between, which is not shown in the video.
if (!_loading)
IconButton(
onPressed: () async {
_sendChatMessage(_textController.text);
},
icon: Icon(
Icons.send,
color: Theme.of(context).colorScheme.primary,
),
)
else
const CircularProgressIndicator(),
Thanks for watching!
I amm getting this error, and follow your code, am not able to make send msg button , errro is >>> "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API."
@FlutterTeam-su1em Thanks for watching the video.
Have you generated the API key from Google AI Studio?
You need to add it to your project in env.json file. Watch the video at 0:48 to add api key in your project.
When i run the code in my mobile there is black screen it not appear any thing how can i fix that
There must be some mistake in your UI code. Is input field is visible?
@@TheOpenSourceChannel can u give us repo
Can I have the code for reference?
Hey @RenderRift Now GeminiAI demo is available on Dartpad.
Check it out - dartpad.dev/?sample=google-ai-sdk
You can watch the demo here - czcams.com/users/shorts3qz_s5Ud42s?feature=share
Expecting binder but got null! How to fix that error?
Please try adding the line below in the main() function
WidgetsFlutterBinding.ensureInitialized();
Your main() function should look like this.
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
@@TheOpenSourceChannel Can you send me a source code by Email?
@@TheOpenSourceChannel The send button does not appear
Hey @michaelandreas1857 Now GeminiAI demo is available on Dartpad.
Check it out - dartpad.dev/?sample=google-ai-sdk
You can watch the demo here - czcams.com/users/shorts3qz_s5Ud42s?feature=share
You shouldn't publish your api key like this. you could embed your key as an environment variable using "set API_KEY=" on windows
I agree @fatihc9230 we shouldn't publish api key like this. It is just to make the demo easier to understand.
Actually we should use flutter_dotenv package to store environment variables.
@@TheOpenSourceChannel Thanks for tip, I checked it out, you are spot on!