Create a LinearGradient background with Flutter
lessonDuration 1m 10sFree
Learn how to add a LinearGradient to your BoxDecoration widgets. This allows you to create fancy backgrounds within your Flutter applications!
Browse
Find courses, lessons, articles, talks, and podcasts.
7 results for "flutter"
lessonDuration 1m 10sFree
Learn how to add a LinearGradient to your BoxDecoration widgets. This allows you to create fancy backgrounds within your Flutter applications!
lessonDuration 3m 50sFree
In this lesson we’ll learn how to fetch & then display data from an API over the network in a Flutter application using the http package.
lessonDuration 1m 48sFree
In this lesson we look at navigating between two pages using the `Navigator`.
article
Hey Everyone 👋, John Lindquist here with the **tenth issue of AI Dev Essentials!** This week has been absolutely monumental for the AI coding space. Cursor hitting 1.0 and raising $900 million at a nearly $10 billion valuation is a watershed moment for AI-assisted development. The speed at which they've grown—from $1 million to over $500 million in ARR in just over two years—shows just how hungry developers are for better AI coding tools. And with background agents now generally available, we're entering a new era where AI can truly work alongside us asynchronously. I've personally spent a lot of time withe the "Claude Code" experience the past week to compare it to Cursor. I totally understand the appeal, especially because of how reliably Claude Code can churn away at long tasks (and you're not thinking about burning through requests/costs), but Cursor is still a superior experience when it comes to gathering context and reviewing changes. I'm hoping this puts pressure on the Cursor team to release a "MAX" plan similar to Claude's "MAX" plan. I like having a budget, but I don't like thinking every failed tool call is lost money. I try to remember that we're still all in the super early days of AI, and everyone is just figuring it out as they go. With that said, let's dive into this week's updates! ### 🎓 New egghead.io Lessons This Week I'm working on a course "Building Local AI Agents with Ollama and the AI SDK". I'm 5 lessons in and I'm excited to share them, but just not quite ready. They should be up when this newsletter rolls around next week, so keep an eye out for that. 😇 --- ## 🚀 Cursor 1.0 & The $900M Funding Round **Cursor has officially hit 1.0 and raised $900 million at a $9.9 billion valuation** This week brought two massive announcements from Cursor that cement its position as the leader in AI coding assistants. First, the 1.0 release brings game-changing features like BugBot for automated code review, background agents for asynchronous work, and seamless GitHub integration. Then came the funding news: $900 million led by Thrive Capital, with participation from Andreessen Horowitz, Accel, and DST Global. **Key Stats:** - Over $500 million in ARR (growing 60% since April) - Used by more than half of the Fortune 500, including NVIDIA, Uber, and Adobe - ARR has been doubling approximately every two months **Cursor 1.0 Features:** - **BugBot**: Automatically reviews PRs and catches potential bugs with "Fix in Cursor" integration - **Background Agent**: Now GA, lets you spawn AI workers for parallel tasks in remote environments - **Memories**: Per-project context retention so AI doesn't forget key facts - **Jupyter Support**: AI can now work inside .ipynb notebooks - **One-click MCP setup**: Streamlined installation for MCP servers ([TechCrunch Coverage](https://techcrunch.com/2025/06/05/cursors-anysphere-nabs-9-9b-valuation-soars-past-500m-arr/), [DEVCLASS Analysis](https://devclass.com/2025/06/06/cursor-ai-editor-hits-1-0-milestone-including-bugbot-and-high-risk-background-agents/)) > I do love seeing money being poured into companies that are building AI tools for developers. I'm hoping that the leads to customized models that are smarter, faster, with reliable tool calling, and features around "agent swarms" that can tackle complex tasks in parallel. I'm really excited to see what sorts of UIs emerge for orchestrating these agents. --- ## 🧠 Model & Platform Updates ### OpenAI o3 & o3-pro: Major Price Drop and Release OpenAI made significant waves this week with two major announcements. First, Sam Altman confirmed an 80% price reduction for o3, making it viable as a "daily driver" model. Cursor immediately updated their pricing to reflect this change, noting that "o3 is a fantastic model, and we're excited that it can now be used as a daily driver." Then came **o3-pro**, OpenAI's most advanced reasoning model yet. Community consensus is forming around its capabilities and limitations: **o3-pro Strengths:** - Excels at math competitions and scientific reasoning - Handles complex multi-step problems with deeper thinking - Acts as a "superhuman researcher + structured thinker" capable of processing massive amounts of data - Demonstrates impressive performance on challenging tests like the "reindeer" problem **Community Reality Check:** - Not ideal as a daily coding model—better suited for complex reasoning tasks - Mixed results on real-world coding: One developer reported it failed to fix type errors, reducing 34 errors to only 28 despite confident promises - Most users don't need this level of reasoning power for everyday tasks - Best used for research, analysis, and uncovering insights you might miss **Codex Gets Internet Access**: OpenAI also rolled out internet access for Codex, allowing it to install dependencies, run tests with external resources, and upgrade packages during task execution. The feature is off by default and provides granular control over allowed domains and HTTP methods. > This all rolled out last night. I haven't had a chance to dig in to o3-pro, so I just gathered a bunch of early impressions from the community above. I'll have my own personal take next week. ### Gemini 2.5 Pro Tops WebDevArena Google's updated Gemini 2.5 Pro continues to excel at coding, now leading WebDevArena with a 1443 Elo score (35-point jump). The update introduces: - **Thinking budgets** for cost/latency control - Enhanced coding performance for complex web apps - Improved style and structure in responses - GA coming in the next few weeks - **New SOTA on Aider Polyglot**: The upcoming GA version scores 86.2%, beating the previous version by 10 percentage points ([Google Blog](https://blog.google/products/gemini/gemini-2-5-pro-latest-preview/), [9to5Google](https://9to5google.com/2025/06/05/gemini-2-5-pro-preview-06-05/)) > Gemini 2.5 Pro is in this interesting place where it's _awesome_, but still a bit difficult to work with in Cursor. I really, really want to use it as my daily driver, but the thinking process often seems to spin too much. I'm hoping a Cursor system prompt (or a community propmt) will emerge to help smooth it all out. The results have always been great, but sometimes it ends up taking too long and my patience wears out. ### Mistral Launches Magistral: Multilingual Reasoning Models Mistral AI announced Magistral, their first reasoning models designed to excel in domain-specific, transparent, and multilingual reasoning. The models come in two variants: - **Magistral Small (24B)**: Open-source under Apache 2.0 license - **Magistral Medium**: Enterprise version with enhanced capabilities Key differentiators include multilingual reasoning (especially strong in European languages), 10x speed improvements in Le Chat, and transparent thinking processes users can follow and verify. ([CNBC Report](https://www.cnbc.com/2025/06/10/microsoft-backed-ai-lab-mistral-debuts-reasoning-model-to-rival-openai.html), [TechCrunch](https://techcrunch.com/2025/06/10/mistral-releases-a-pair-of-ai-reasoning-models/)) > Any open-source news is good news. While I'm happy to pay providers for "premium" access to models, I'm still hopeful open-source will unlock AI for everyone down the road. I just never make time to test the open-source models with so much else happening at the same time. --- ## 💰 Major Funding & Business Updates ### Linear Raises $82M at $1.25B Valuation for AI Agent Platform Linear secured $82 million in Series C funding led by Accel, positioning itself as "the place where teams, AI, and agents build software together." With 280% profit growth and over 15,000 customers including OpenAI, Scale AI, and Perplexity, Linear is focusing on making their platform the natural home for AI agents to coordinate work across product workflows. ([Reuters](https://www.reuters.com/business/atlassian-competitor-linear-raises-funding-125-billion-valuation-2025-06-10/), [Linear Blog](https://linear.app/blog/building-our-way)) > I included this because Linear's MCP is a popular MCP for agents. So far, everyone uses so many variations of "AI Task Tracking" and it seems like Linear is raising to the top. Seeing them focus on AI-specific language and raising money is only a good sign (maybe Cursor will buy them or spin off their own version someday?) --- ## 🛠️ Developer Tools & Ecosystem ### Vertex AI Studio Gets Major Redesign Google Cloud unveiled a redesigned Vertex AI Studio with a developer-first approach: - Dark mode support across the platform - Unified UI combining Chat and Freeform prompting - Easy grounding with Google Search or Maps - Direct code generation for Python, Android, Swift, Web, Flutter - Access to 200+ foundation models including Gemini, Llama, and Claude ([Google Cloud Blog](https://cloud.google.com/blog/products/ai-machine-learning/vertex-ai-studio-redesigned)) ### ElevenLabs Launches v3 with Emotion Control ElevenLabs v3 introduces revolutionary emotion direction through audio tags: - Control emotions with tags like [excited], [whispers], [sighs], [laughs] - 70+ language support - Enhanced expressiveness and contextual understanding - Multi-speaker dialogue with matching prosody ([ElevenLabs v3](https://elevenlabs.io/v3), [Documentation](https://elevenlabs.io/blog/eleven-v3)) > These voices are _so good_. I'm tempted to toss one of my favorite books in their ("The Silent Gondoliers") and go on a road trip to see how they handle full narration. ### OpenAI Agents SDK Now in TypeScript OpenAI released their Agents SDK in TypeScript with full feature parity to Python: - Human-in-the-loop approvals - Handoffs, guardrails, tracing, MCP support - RealtimeAgent for voice interactions - Enhanced Traces dashboard for Realtime API sessions ([OpenAI Developers](https://openai.github.io/openai-agents-js/)) > TypeScript is arguably _the_ language for building AI agents thanks to all the hosting/endpoints/etc already built for it. For most platforms, it becomes trivial to plop in a TypeScript SDK package, an API key, and spin up Agents. --- ## 🔧 Quick Updates - **Prisma Local Development**: `npx prisma dev` now persists data between sessions and supports multiple instances without Docker ([Prisma Blog](https://www.prisma.io/blog/prisma-6-8-0-release)) - **OpenAI Advanced Voice**: Updated for more natural conversations with improved translation capabilities - **Firebase Studio**: Turn Figma designs into working apps with Gemini integration ([Firebase Blog](https://firebase.blog/posts/2025/05/whats-new-at-google-io/)) - **Supermemory MCP**: Now open source for infinite chat context ([GitHub](https://github.com/supermemoryai/supermemory-mcp)) - **Taskmaster v0.16**: New .taskmaster folder structure with Bedrock, Azure, and Vertex AI support ([GitHub](https://github.com/eyaltoledano/claude-task-master)) - **Ask-Human MCP**: New zero-config tool for human-in-the-loop verification—pauses agents when unsure, logs questions to `ask_human.md`, resumes when you provide answers ([GitHub](https://github.com/Masony817/ask-human-mcp)) - **AI Studio Clarification**: Google's Logan Kilpatrick confirmed AI Studio free tier isn't going away—it's transitioning to API key-based access with continued free tier availability --- ## 🤖 AI Research & Observations ### AIs Play Diplomacy: Revealing Model Personalities A fascinating experiment had different AI models play the strategy game Diplomacy, revealing distinct behavioral patterns: - **Claude** couldn't lie and was exploited ruthlessly by other players - **Gemini 2.5 Pro** nearly conquered Europe with brilliant tactical gameplay - **o3** orchestrated secret coalitions, backstabbed every ally, and won This real-world test highlights how different models exhibit varying levels of strategic thinking, deception capability, and goal-oriented behavior—important considerations when choosing models for different applications. > I'm hoping someday these can turn into live visual competitive storytelling experiences. Kind of like a battlebots tournament, but with AI models. I'll admit I'm also hiding my head in the sand when it comes to using AI to "dominate" anything. (I love you AI Overlords! ❤️) ### Anthropic Cuts Windsurf API Access In a surprising move, Anthropic reportedly restricted Windsurf's API access to Claude models. This development raises questions about the competitive dynamics between AI providers and coding assistant platforms. ([TechCrunch](https://techcrunch.com/2025/06/10/anthropic-windsurf-api-access-restricted/)) > Seems fair IMO. OpenAI bought Windsurf. OpenAI competes with Anthropic. Why would Anthropic want to help OpenAI make money? --- ## 💡 Security & Best Practices **Vercel on AI Agent Security**: New guidance on prompt injection vulnerabilities emphasizes: assume compromise, limit tool call access, and don't trust output. Essential reading for anyone building AI agents. ([Vercel Blog](https://vercel.com/blog/building-secure-ai-agents)) --- ## ✨ Workshop Spotlight: Conquer the Complexity of Cursor ✨ Master practical AI development workflows in Cursor. This hands-on workshop covers Agents, Ask mode, Custom Modes, multi-file analysis, effective prompting, Cursor rules, and strategies for handling AI failures. - **When:** _Friday, June 27, 2025, 9:00 AM - 2:00 PM (PDT)_ - **Where:** Zoom (Live Q&A included) - **Investment:** $249 (early bird prcing of $200 until June 18th) ➡️ [**Read More about the Workshop**](https://egghead.io/workshop/cursor) ➡️ [**Register Now ($249)**](https://buy.stripe.com/7sY7sEbOZbGO0kx7pw9fW09?prefilled_promo_code=GEUHPI9B) _(Team training also available)_ --- That's all for this milestone tenth issue! The convergence of massive funding, breakthrough features, and growing enterprise adoption shows we're at an inflection point for AI-assisted development. The tools are getting more powerful, the agents more capable, and the possibilities more exciting. If you have any feedback or questions, hit reply. I'm happy to chat about the latest in AI dev tools. John Lindquist [egghead.io](https://egghead.io)
course
Dart is an object-oriented language you can use for building web applications, server-side code, and even mobile apps. It’s expressive, powerful, and has a friendly learning curve. In this course, we will look at the syntax and semantics of the Dart programming language. We will also cover various aspects of the Dart ecosystem, including its tools and packages that help make you a productive developer. This knowledge is applicable when developing software for client, server, and especially mobile with the Flutter framework. This course is beginner-friendly, but is well-suited for experience programmers as well.
lessonDuration 36sFree
In this lesson, you will write a basic HTTP server in the Dart programming language. We will be using the HttpServer class from Dart's inbuilt 'dart:io' library to achieve this. Dart is an object-oriented programming language by Google, which aims to help the developer build modern web applications. It covers client, server and now mobile with Flutter. It comes with a range of tools including a virtual machine, core libraries, and package management repository, lending enough ammunition to start your next project. Learn more at https://dartlang.org
article
When creating a web application, we want to have a faster loading experience as a few seconds in loading can be a deal-breaker for most people. This tutorial will look at how we can solve this and improve Vue.js site performance with lazy loading. ## Overview In this tutorial, we will use the lazy loading component to speed up loading time. We will dive deep into asynchronous component loading in Vue. We will also look at how to use webpack magic components in naming our chunks. We will have a brief look at how webpack works and how bundling helps in reducing component size, then we look at how to dynamically import components and use Suspense to lazy split components. ## How webpack works? To be a good Vue developer, you need to understand how webpack works. The pride of webpack is its ability to reduce the size of bundles in your code. For your site to load faster, there has to be a smaller bundle to be downloaded by the client. The larger the bundle gets, the slower browsing the site becomes, which can become problematic for a business. Webpack works as a build tool by bundling all of your files, including fonts, JavaScript, images, and CSS, into a node or file that you have assigned to be your entry point. The bundling forms what we call a "dependency graph". The graph looks like this:  Webpack uses the dependency graph to know which file/module should be added to the main output bundle. We now know a little about how bundling works and how the final size of our bundles can affect load time and site speed. ## Lazy Loading Components This section will examine which components should be lazy-loaded, reasons for lazy loading, and how lazy loading affects user experience. Generally, we want to lazy load components that aren't needed on a particular page, like a pop-up or modal in your site meant for another page. You don't want to include this kind of component in your main javascript bundle. If we take, for example, the [flutterwave](https://flutterwave.com/) site, a payment site used for making and accepting international payments. When we visit the dev tools and press ctrl+shift+p and type coverage, then reload the page,  We can see the red and blue bars. The red part indicates the part of the site that can be lazy-loaded to improve the site's performance. The reason for lazy loading is evident as it boosts the site's performance and positively affects user engagement as a slight delay in load time of a site can lead to a business losing customers, as research has shown. ## Proof of Concept To demonstrate what I am about to explain in the rest of the tutorial, we will be using a simple Netflix clone I have created.  Above, we can see some tags like PopularMovies, TrendingMovies. Under each tag are components that are synchronously loaded, and we want to lazy-load. We would be looking at how to lazy load the movie components, use webpack magic comments and the experimental suspense API to optimize the site. ## Synchronous component loading The traditional way of loading our components is synchronous. We do this by just importing the component. ```html <script> import PopularMovies from "@/components/PopularMovies.vue"; import TrendingMovies from "@/components/TrendingMovies.vue"; import TopRated from "@/components/TopRated.vue"; export default { name: "Home", components: { PopularMovies, TrendingMovies, TopRated } }; </script> ``` Components loaded with a static import statement like above will be added to the existing application bundle. If code-splitting isn't used, then the application bundle becomes larger, affecting the overall performance. What we want is a dynamically loaded component, and that is what we will do next. ## Dynamically importing components To dynamically import components, we have to import a new API called `defineAsyncComponent` from Vue. Then we define the component with `defineAsyncComponent`. In the case of this site, we will only dynamically load the `PopularMovies` component, so we can see the difference between the popular movie component and the rest of the components that are synchronously loaded. ```js import { defineAsyncComponent } from "vue"; const PopularMoviesAsync = defineAsyncComponent(() => import("../components/PopularMovies.vue") ); ``` We have given the component the name of `PopularMoviesAsync` and imported the component from wherever it is in the file project file structure. To know if what we just did works, we need to open the console, go to the Network panel, and reload the page. In our network panel, we can see a file `0.js`, which is our new chunk file of the component we imported.  We can see from above under the preview the name of the component we are lazy loading. ## Webpack Magic Comments The Vue.js framework is built on the foundation of webpack. To be very good at Vue, we need to understand how webpack works behind the hood. In webpack, there are what we call "magic comments". Here we will use the magic comments from webpack to give the chunk created earlier a name, preferably something easier to understand instead of 0.js. Creating the magic comment is just like a regular javascript comment `/* */`. ```jsx import { defineAsyncComponent } from "vue"; const PopularMoviesAsync = defineAsyncComponent(() => import("../components/PopularMovies.vue" /* webpackChunkName: "Popular" */) ); ``` We use `webpackChunkName` to tell webpack to give our chunk the name `Popular`. If we recheck the network panel and refresh, we will see `Popular.js` as our chunk name, which is more descriptive. Now we can code split our application. *Yayy!!.* But we are not over yet, as I will show you how this API works in greater detail. ## Using Suspense for custom loading Sometimes, you may want to create a custom loading message for a component that may take time to load, such as a component that consumes moment.js, with all the locales loaded, or a component that shows different dates, times, and formatting. In this scenario, you may need to create a custom loading message for that, which we will look at in this section. To do that, we will need to tell the asynchronous component to display its loading message and not bubble up to the suspense boundary. ```html <script> import { defineAsyncComponent } from "vue"; import Loading from "@/components/Loading.vue"; const PopularMoviesAsync = defineAsyncComponent({ loader: () => import("../components/PopularMovies.vue"), loadingComponent: Loading, delay: 200, suspensible: false }); import TrendingMovies from "@/components/TrendingMovies.vue"; import TopRated from "@/components/TopRated.vue"; export default { name: "Home", components: { PopularMoviesAsync, TrendingMovies, TopRated, }, }; </script> ``` In the code above, we can see that `defineAsyncComponent` accepts a callback that we can use to configure the custom loading message. The `loader` property we see is that callback. Then the `loadingComponent` will be `Loading`, a placeholder component we have created containing a custom message we want to display. ```jsx const PopularMoviesAsync = defineAsyncComponent({ loader: () => import("../components/PopularMovies.vue"), loadingComponent: Loading, delay: 200, suspensible: false }); ``` We set a delay of `200` as the time we need to exhaust before the loading component shows. We can also do other stuff like adding an error component that displays if there is an error. Also, a timeout of `2000` can be set, which is a default timeout that you use before showing the error component. If this asynchronous action has not been completed within the timeout, we show the error component. We set suspensible to `false`, which means not to oblige a parent suspense boundary. ## Default and Fallback in Our Suspense ```html <Suspense> <template #default> <div v-for="(movie, id) in moviesData" :key="id" class="flex flex-shrink-0 justify-center items-center w-1/2 max-w-sm mx-auto my-8" > <div :style="{backgroundImage: `url(${baseImgUrl}/w500${movie.backdrop_path})`}" class="bg-gray-300 h-64 w-full rounded-lg shadow-md bg-cover bg-center" > </div> </div> </template> <template #fallback> <div> <p>Wait for movie to load</p> </div> </template> </Suspense> ``` We can see in our suspense boundary above if the boundary wins, the fallback template is displayed with the loading message instead of the default template. ## Testing what we did So to properly see the result of what we have done, we have to slow the time, so we go to the console, and in our network tab, we set throttling to fast 3g so which is how the internet speed will be for medium to low-end devices. We keep the console running while in the process so that the throttling can take effect. Then we reload the page, and we can now see the loading message before the component is displayed.  Here is the [github code](https://github.com/uma-victor1/vue3-netflix-clone) for this project, under the lazy-load branch. ## Conclusion In this tutorial, we have learned how to use the lazy loading component to reduce loading time. We also looked at asynchronous components in Vue and how to use webpack magic comments in naming our chunks. I hope you enjoyed the tutorial, and you can send a message on [Twitter](https://twitter.com/umavictor_) if you have any questions. <Course slug="develop-basic-web-apps-with-vue-js" />