{"id":3434,"date":"2024-08-23T11:58:41","date_gmt":"2024-08-23T11:58:41","guid":{"rendered":"https:\/\/www.rcvtechnologies.com\/blog\/?p=3434"},"modified":"2024-09-05T11:07:59","modified_gmt":"2024-09-05T11:07:59","slug":"gemini-ai-integration-in-flutter","status":"publish","type":"post","link":"https:\/\/www.rcvtechnologies.com\/blog\/gemini-ai-integration-in-flutter\/","title":{"rendered":"Gemini AI Integration in Flutter"},"content":{"rendered":"<h2 class=\"blog-itmind-inner-head\"><b>Gemini Google AI Dart SDK beta release<\/b><\/h2>\n<p>The Google AI Dart SDK has been released to beta. This enables you to build generative AI features into your Dart or Flutter app, powered by Gemini, Google\u2019s latest family of AI models to build AI-powered features and applications. There is now a\u00a0<a href=\"https:\/\/pub.dev\/packages\/google_generative_ai\"><span class=\"s1\">google_generative_ai<\/span><\/a>\u00a0package on pub.dev.<\/p>\n<p><b>This SDK supports use cases like:<\/b><\/p>\n<ul>\n<li>Generate text from text-only input<\/li>\n<li>Generate text from text-and-images input (multimodal)<\/li>\n<li>Build multi-turn conversations (chat)<\/li>\n<li>Embedding<\/li>\n<\/ul>\n<h2 class=\"blog-itmind-inner-head\"><b>Code:<\/b><\/h2>\n<div class=\"dm-code-snippet dark default  dm-normal-version\" style=\"background-color:#000;\" snippet-height=\"\">\n\t\t\t<div class=\"control-language\">\n                <div class=\"dm-buttons\">\n                    <div class=\"dm-buttons-left\">\n                        <div class=\"dm-button-snippet red-button\"><\/div>\n                        <div class=\"dm-button-snippet orange-button\"><\/div>\n                        <div class=\"dm-button-snippet green-button\"><\/div>\n                    <\/div>\n                    <div class=\"dm-buttons-right\">\n                        <a id=\"dm-copy-raw-code\">\n                        <span class=\"dm-copy-text\">Copy Code<\/span>\n                        <span class=\"dm-copy-confirmed\" style=\"display:none\">Copied<\/span>\n                        <span class=\"dm-error-message\" style=\"display:none\">Use a different Browser<\/span><\/a>\n                    <\/div>\n                <\/div>\n                <pre class=\"no-line-numbers\"><code id=\"dm-code-raw\" class=\"no-wrap language-php\"><\/p>\n<pre class=\"dm-pre-admin-side\">import 'package:google_generative_ai\/google_generative_ai.dart';\r\n\r\nconst apiKey = ...;\r\n\r\nvoid main() async {\r\n\r\n\u00a0 final model = GenerativeModel(\r\n\r\n\u00a0 \u00a0 \u00a0 model: 'gemini-1.5-flash-latest',\r\n\r\n\u00a0 \u00a0 \u00a0 apiKey: apiKey,\r\n\r\n\u00a0 );\r\n\r\n\u00a0 final prompt = 'Write a story about a magic backpack.';\r\n\r\n\u00a0 final content = [Content.text(prompt)];\r\n\r\n\u00a0 final response = await model.generateContent(content);\r\n\r\n\u00a0 print(response.text);\r\n\r\n};<\/pre>\n<p><\/code><\/pre>\n\t\t\t<\/div>\n        <\/div>\n<h3 class=\"blog-itmind-inner-head\"><b>How to get the Api key?<\/b><\/h3>\n<p>You have to generate Api key to use this AI tool in your project. You can get this api key from the google AI Studio or <a href=\"https:\/\/aistudio.google.com\/app\/apikey\">https:\/\/aistudio.google.com\/app\/apikey<\/a><\/p>\n<h3 class=\"blog-itmind-inner-head\"><b>Output:<\/b><\/h3>\n<p><img decoding=\"async\" class=\"wp-image-3441 aligncenter\" src=\"https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM.png\" alt=\"Gemini AI Integration in Flutter\" width=\"100%\" srcset=\"https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM.png 1920w, https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM-300x119.png 300w, https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM-1024x405.png 1024w, https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM-768x304.png 768w, https:\/\/www.rcvtechnologies.com\/blog\/wp-content\/uploads\/2024\/08\/Screenshot-2024-08-26-at-3.18.14\u202fPM-1536x608.png 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gemini Google AI Dart SDK beta release The Google AI Dart SDK has been released to beta. This enables you to build generative AI features into your Dart or Flutter app, powered by Gemini, Google\u2019s latest family of AI models to build AI-powered features and applications. There is now a\u00a0google_generative_ai\u00a0package on pub.dev. This SDK supports [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":3439,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[196,197],"class_list":["post-3434","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-flutter","tag-gemini"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/3434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=3434"}],"version-history":[{"count":9,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/3434\/revisions"}],"predecessor-version":[{"id":3531,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/3434\/revisions\/3531"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/media\/3439"}],"wp:attachment":[{"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=3434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=3434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rcvtechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=3434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}