小编Abh*_*rma的帖子

找不到通过 Flutter Module 构建的本地 aar

我正在尝试将 flutter 模块添加为我的 Android 项目的 aar 依赖项。这是指南 https://flutter.dev/docs/development/add-to-app/android/project-setup#add-the-flutter-module-as-a-dependency 我能够生成本地 AAR 和我可以看到需要完成以下步骤:

 1. Open <host>/app/build.gradle
  2. Ensure you have the repositories configured, otherwise add them:

      repositories {
        maven {
            url '/Users/asharma/Documents/Flutter/animation_module/build/host/outputs/repo'
        }
        maven {
            url 'http://download.flutter.io'
        }
      }

  3. Make the host app depend on the Flutter module:

    dependencies {
      debugImplementation 'com.example.animation_module:flutter_debug:1.0
      profileImplementation 'com.example.animation_module:flutter_profile:1.0
      releaseImplementation 'com.example.animation_module:flutter_release:1.0
    }


  4. Add the `profile` build type:

    android {
      buildTypes {
        profile {
          initWith debug
        }
      }
    }
Run Code Online (Sandbox Code Playgroud)

在我的Android项目中,我有app模块和library模块。我想将其包含aar在我的 …

android gradle flutter flutter-dependencies

6
推荐指数
1
解决办法
1854
查看次数

如何在 Flutter 中更改 ListTile 中的前导形状?

我想在 ListTile 小部件中显示一个图像,它应该看起来像这样。在此处输入图片说明

这是我的代码:

                          Padding(
                            padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 20.0),
                            child: Card(
                              color: Colors.white,
                              child: ListTile(
                                leading: Container(
                                  child: Image.network((orientation == Orientation.portrait
                                        ? image.portrait
                                        : image.landscape),
                                        fit: BoxFit.cover)
                                     ),
                                title: Text(terms[index].title),
                                subtitle: Text(terms[index].videoNumber.toString() + " Videos"),
                                trailing: Icon(
                                  Icons.arrow_forward_ios,
                                  color: Colors.lightBlueAccent,
                              ),
                              ),
                            ),
                          );
Run Code Online (Sandbox Code Playgroud)

这导致以下输出

在此处输入图片说明

我该怎么做才能使图像看起来像上面一样展开。

flutter flutter-layout

2
推荐指数
1
解决办法
6315
查看次数

Android 导航组件 popUpTo 返回弹出的片段

请不要将其标记为重复,我已经阅读了这些问题,但仍然无法正常工作 导航组件 popUpTo bug Android 导航组件 popUpTo 行为 Android 导航组件 + 登录流程 + 嵌套 BottomNavigationView

我在用

def nav_version = "2.2.1"
    implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
    implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
Run Code Online (Sandbox Code Playgroud)

场景:这是我的应用程序图表 在此输入图像描述

这是我的导航代码:

<fragment
        android:id="@+id/splashFragment"
        android:name="com.view.SplashFragment"
        android:label="SplashFragment" >
        <action
            android:id="@+id/action_splashFragment_to_loginFragment"
            app:destination="@id/loginFragment"
            app:popEnterAnim="@anim/slide_in_left"
            app:popExitAnim="@anim/slide_out_right"
            app:enterAnim="@anim/slide_in_right"
            app:exitAnim="@anim/slide_out_left"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true"/>
        <action
            android:id="@+id/action_splashFragment_to_mainFragment"
            app:destination="@id/mainFragment"
            app:popEnterAnim="@anim/slide_in_left"
            app:popExitAnim="@anim/slide_out_right"
            app:enterAnim="@anim/slide_in_right"
            app:exitAnim="@anim/slide_out_left"
            app:popUpTo="@id/mainFragment"
            app:popUpToInclusive="true"/>
    </fragment>
Run Code Online (Sandbox Code Playgroud)

当我在开机状态下按后退按钮MainFragmentLoginFragment仍然能够导航回splashFragment 时。我已经有app:popUpToapp:popUpToInclusive标签了。我希望我的应用程序不要导航回splashFragment

android android-navigation android-navigation-graph

0
推荐指数
1
解决办法
3473
查看次数