Giter Site home page Giter Site logo

xuexiangjys / flutter_template Goto Github PK

View Code? Open in Web Editor NEW
880.0 880.0 182.0 148 KB

The project of the empty template with Flutter has built the basic framework to realize the functions of internationalization, theme peeling, login and registration, etc.(Flutter空壳模板工程,已搭建基础框架,实现国际化、主题换肤、登录注册、自动路由注册等功能,可在此基础上简单修改实现自己的应用功能)

Home Page: https://github.com/xuexiangjys/flutter_template/wiki

License: Apache License 2.0

Kotlin 0.38% Ruby 1.21% Swift 0.36% Objective-C 0.03% Dart 98.01%
flutter flutter-template template template-project x-templateproject

flutter_template's Introduction

不断学习,做更好的自己!💪

English Introduction

公众号 掘金 知乎 CSDN 简书 思否 哔哩哔哩 今日头条
我的Android开源之旅 点我 点我 点我 点我 点我 点我 点我
  • 爱码士,擅长设计模式,架构设计,移动设备通讯,App快捷开发。

  • 专注Android移动开发技术,提高开发的效率!

  • 码云同步地址:https://gitee.com/xuexiangjys

欢迎打开微信扫码下方的二维码,关注我的微信公众号:我的Android开源之旅

我的Android开源之旅

Github stats Languages stats

Visit stats

flutter_template's People

Contributors

shiyu-sz avatar xuexiangjys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_template's Issues

No named parameter with the name 'nullOk'.

Launching lib/main.dart on macOS in debug mode...
lib/main.dart:1
../.pub-cache/hosted/pub.flutter-io.cn/extended_image-1.6.0/lib/src/extended_image.dart:785:44: Error: No named parameter with the name 'nullOk'.
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
../flutter/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {
^^

Command PhaseScriptExecution failed with a nonzero exit code

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
** BUILD FAILED **

Exception: Build process failed
Exited (sigterm)

auto_route生成的代码会出现语法错误

image

引入 getTransitions的时候 前面会比示例中多一个点。
我是克隆的2.0分支

命令是 flutter packages pub run build_runner watch --delete-conflicting-outputsflutter packages pub run build_runner build 两个效果是一样的都多一个点

项目启动时遇到的一个问题

运行flutter run 时,报错信息如下

fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.

请问您有遇到过类似的情况吗?有的话麻烦和我说一下解决办法,谢谢

Build failed due to use of deprecated Android v1 embedding.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

C:\flutter_template-master\android\app\src\main\AndroidManifest.xml uses android:name="io.flutter.app.FutterApplication"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build failed due to use of deprecated Android v1 embedding.

Support flutter_easyrefresh

The newest flutter_easyrefresh drop i18n suppport, and I am not familar with the i18n support.

So could you please support it? Thanks
image

报错需要migrate this app to the V2 embedding

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━
Warning
────────────────────────────────────────────────────────────
──────────────────
Your Flutter application is created using an older version
of the Android
embedding. It is being deprecated in favor of Android
embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the
--ignore-deprecation flag to
ignore this check and continue with the deprecated v1
embedding. However,
the v1 Android embedding will be removed in future versions
of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━
The detected reason was:

/Users/jiashaoying/github_projects/flutter_template/androi
d/app/src/main/AndroidManifest.xml uses
android:name="io.flutter.app.FutterApplication"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━

Running "flutter pub get" in flutter_template... 5.1s
This app is using a deprecated version of the Android
embedding.
To avoid unexpected runtime failures, or future build
failures, try to migrate this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-A
ndroid-projects
The plugin package_info_plus requires your app to be
migrated to the Android embedding v2. Follow the steps on
https://flutter.dev/go/android-project-migration and re-run
this command.

抽屉菜单昵称像素移除问题

                  Text(
                        value.nickName != null
                            ? value.nickName
                            : I18n.of(context).title,
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(
                          fontWeight: FontWeight.bold,
                          fontSize: 20,
                          color: Colors.white,
                        ),
                      )

昵称过长会像素溢出,请用expand包裹下

Build failed due to use of deprecated Android v1 embedding.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

/Users/meichao/DeveloperTools/FlutterProjects/flutter_template/android/app/src/main/AndroidManifest.xml uses android:name="io.flutter.app.FutterApplication"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build failed due to use of deprecated Android v1 embedding.

运行失败?是Grade问题吗?

Exception in thread "main" java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1567)
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1462)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1469)
at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1274)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1237)
at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:727)
at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
at java.base/java.util.zip.ZipFile.(ZipFile.java:247)
at java.base/java.util.zip.ZipFile.(ZipFile.java:177)
at java.base/java.util.zip.ZipFile.(ZipFile.java:191)
at org.gradle.wrapper.Install.unzip(Install.java:214)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:74)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Exception: Gradle task assembleDebug failed with exit code 1

The plugins `flutter_webview_plugin, image_picker_saver` use a deprecated version of the Android embedding.

The plugins flutter_webview_plugin, image_picker_saver use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

flutter_webview_plugin和image_picker_saver需要移除

The plugins flutter_webview_plugin, image_picker_saver use a deprecated version
of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these
plugins support the Android V2 embedding. Otherwise, consider removing them since a
future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the
V2 embedding: https://flutter.dev/go/android-plugin-migration.

The parameter 'exception' is required

在app_init.dart文件里

// 构建错误信息
static FlutterErrorDetails makeDetails(Object obj, StackTrace stack) {
return FlutterErrorDetails();//这句话有问题
}

编译报错如下:
The parameter 'exception' is required.

应该怎么改呢

一个问题和一个建议

作者辛苦了。

1、请问i18n是用哪个插件完成的?能不能添加一下增加语言、增加翻译后如果生成更新文件?

2、建议再出一个增强版。新项目一般都还需要 相机、定位、扫码、指纹 这四个权限,如果能增加到增强版中去,配置好Android和iOS的插件权限,这个项目一定大货喜欢。

几个问题,i18n是怎么做的,用的AS插件吗

i18n是怎么做的,用的AS插件吗。

项目改名可以,不用搜索,重新改了项目名称,删除ios android web 文件夹,重新flutter create . 也可以。

  • package 里面的需要查找替换改名。

auto_route版本

可以将auto_route更新至2.0.1么 这个版本有大的支持
Navigator也从1升级到了2

windows下安卓模拟器语言检测错误null问题

更改后代码

// 获取当前用户的APP语言配置Locale类,如果为null,则语言跟随系统语言
  Locale getLocale() {
    if (_locale == null) return null;
    if (_locale.indexOf("_") > 0) {
      var t = _locale.split("_");
      return Locale(t[0], t[1]);
    } else {
      return null;
    }
  }

代码中为字符判断,会报错。

在 Flutter 2.0.1 环境中运行,会有异常,看起来是语法的不兼容

/D:/service/flutter/.pub-cache/hosted/pub.flutter-io.cn/extended_image-1.6.0/lib/src/extended_image.dart:785:44: Error: No named parameter with the name 'nullOk'.
_invertColors = MediaQuery.of(context, nullOk: true)?.invertColors ??
^^^^^^
/D:/service/flutter/packages/flutter/lib/src/widgets/media_query.dart:818:25: Context: Found this candidate, but the arguments don't match.
static MediaQueryData of(BuildContext context) {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.