0Pricing
Kotlin Multiplatform Academy · درس

تمرير المعاملات والروابط العميقة

نقل البيانات بين الوجهات بأمان

تمرير المعاملات والروابط العميقة درس مجاني في Kotlin Multiplatform Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Kotlin Multiplatform Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Screens Need Data

A details screen has to know which item to show. Arguments are how one screen tells the next exactly what to display. 📦

Put the Value in the Route

You declare a placeholder right inside the route string. Curly braces mark where a value will be slotted in.

composable("details/{itemId}") { entry ->
    DetailsScreen(entry)
}

Read the Argument

Inside the destination you pull the value from the back stack entry. It arrives as a string you can use right away.

val itemId = entry.arguments?.getString("itemId")

Pass a Value When Navigating

To send data you simply build the real route with your value inside it, then navigate to that string.

navController.navigate("details/42")

Type-Safe Arguments

You can declare an argument as an Int instead of a string, so the framework parses and validates it for you.

composable(
    "details/{itemId}",
    arguments = listOf(navArgument("itemId") { type = NavType.IntType })
) { /* ... */ }

Optional Query Arguments

Some values are optional, like a search filter. You add them as query parameters after a question mark in the route.

navController.navigate("search?query=kotlin")

What Is a Deep Link

A deep link is a URL that opens a specific screen directly, even from outside the app. It maps a link to a route.

Register a Deep Link

You attach a deepLink pattern to a destination. When that URL arrives, navigation jumps straight to this screen.

composable(
    "details/{itemId}",
    deepLinks = listOf(navDeepLink { uriPattern = "myapp://details/{itemId}" })
) { /* ... */ }

Deep Links Carry Arguments Too

The same placeholders work in a deep link URL. The itemId from the link lands in your back stack entry like any argument.

Platforms Wire Links Differently

Android and iOS each register your URL scheme in their own config, but both then hand the link to the shared graph. 🔗

Keep Arguments Small

Pass an id, not a whole object. Let the destination load its own data from the id, so routes stay tiny and reliable.

Quick Check

How should you typically send a complex object to the next screen?

Recap: Data and Direct Links

You sent arguments through routes, read them on the next screen, and mapped a deep link URL straight to a destination. 🎯

الأسئلة الشائعة

هل درس «تمرير المعاملات والروابط العميقة» مجاني؟

نعم — نص درس «تمرير المعاملات والروابط العميقة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Kotlin Multiplatform Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Kotlin Multiplatform Academy 4 دروس في المجموع.

ماذا ستتعلم في «تمرير المعاملات والروابط العميقة»؟

نقل البيانات بين الوجهات بأمان تتمرن على Kotlin Multiplatform Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Kotlin Multiplatform Academy؟

لا تُشترط خبرة سابقة. Kotlin Multiplatform Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.

كم من الوقت يستغرق درس «تمرير المعاملات والروابط العميقة»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Kotlin Multiplatform Academy هذا؟

نعم. كل درس في Kotlin Multiplatform Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. التنقل بين الشاشات المشتركة
  2. تمرير المعاملات والروابط العميقة
  3. الصور والخطوط والسلاسل المشتركة
  4. توطين نصوص الواجهة المشتركة
← العودة إلى Kotlin Multiplatform Academy