Giter Site home page Giter Site logo

carguo / gsy_flutter_demo Goto Github PK

View Code? Open in Web Editor NEW
3.0K 53.0 490.0 5.79 MB

Flutter 不同于 GSYGithubAppFlutter 完整项目,本项目将逐步完善各种 Flutter 独立例子,方便新手学习上手和小问题方案解决。 目前开始逐步补全完善,主要提供一些有用或者有趣的例子,如果你也有好例子,欢迎提交 PR 。

Home Page: https://juejin.im/user/582aca2ba22b9d006b59ae68/posts

License: MIT License

Kotlin 0.03% Swift 0.05% Objective-C 0.01% Dart 99.75% HTML 0.16%
flutter flutter-demo flutter-ui flutter-plugin flutter-widget flutter-examples

gsy_flutter_demo's Issues

连续点击验证码输入框,键盘重复弹起

问题代码,可以添加一个键盘弹出的判断来解决。

if (MediaQuery.of(context).viewInsets.bottom == 0){
   final focusScope = FocusScope.of(context);
   focusScope.requestFocus(FocusNode());
   Future.delayed(Duration.zero, () => focusScope.requestFocus(node));
}

RichText

Constant constructor can't call non-constant super constructor of 'RichText'.
Try calling a const constructor in the superclass, or removing the keyword 'const' from the constructor.

时钟动画

void drawHourCircle 绘制小时时, 判断当前时间并修改其颜色应为
for (var i = 0; i < 12; i++) { canvas.save(); double iDeg = 2 * math.pi / 12 * i; //时间为24小时制 canvas.rotate(iDeg); bool colorTime = (iDeg / (2 * math.pi) * 360).floor().abs() == (degree / (2 * math.pi) * 360).floor().abs(); Color color = colorTime ? Colors.blueAccent : Colors.white; drawText(canvas, "${(i + 1).toString()}点", color, hourRadius, Offset.zero, textAlign: TextAlign.right, fontSize: fontSize); canvas.restore(); }

运行报错

Compiler message:
lib/widget/verification_code_input_demo_page.dart:167:22: Error: Getter not found: 'FilteringTextInputFormatter'.
formatters.add(FilteringTextInputFormatter.digitsOnly);

编译报错

Compiler message:
lib/widget/rich/real_rich_text.dart:188:3: Error: Type 'ImageStreamListener' not found.
ImageStreamListener imageStreamListener

web版在线测试打不开

main.dart.js:11226 Uncaught LateInitializationError: Field '_defaultBinaryMessenger' has already been initialized.
at Object.wrapException (main.dart.js:11226:17)
at Object._lateWriteOnceCheck (main.dart.js:12563:17)
at WidgetsFlutterBinding.set$_defaultBinaryMessenger (main.dart.js:133871:9)
at WidgetsFlutterBinding.initInstances$0 (main.dart.js:138222:13)
at WidgetsFlutterBinding.initInstances$0 (main.dart.js:138244:13)
at WidgetsFlutterBinding.initInstances$0 (main.dart.js:138301:13)
at WidgetsFlutterBinding.initInstances$0 (main.dart.js:138317:13)
at WidgetsFlutterBinding.initInstances$0 (main.dart.js:138366:13)
at WidgetsFlutterBinding.BindingBase$0 (main.dart.js:101450:12)
at Object.WidgetsFlutterBinding$ (main.dart.js:37181:10)

列表滑动停靠效果2进入页面再出来会报错

列表滑动停靠效果2(sliver_stick_demo_page)进入页面再出来好像会报
The following assertion was thrown while finalizing the widget tree:
Looking up a deactivated widget's ancestor is unsafe.

At this point the state of the widget's element tree is no longer stable.

To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
大佬能不能帮我解释一下为什么,还有页面几个Future.delayed的用法,为什么不用就会报错

绘制气泡代码逻辑

代码位置:bubble文件夹 bubble_painter.dart
///绘制左边三角形
原代码 if (mArrowCenter) { mArrowPosition = (rect.bottom - rect.top) / 2 - mArrowWidth / 2; } 应改为 if (mArrowCenter) { mArrowPosition = (rect.bottom - rect.top) / 2 - mArrowHeight / 2; }
大佬看一下对吗

Undefined class ImageStreamListener

image

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

ListViewLinkListView tag:bug

Listviewlink ListView if it keeps scrolling vertically, and very slowly, is a bug, they will not be linked to each other

针对双向聊天列表效果,我这边遇到个问题

使用双向聊天列表,加载item高度不一致的数据,比如内部有图片,以及超长的文字,再执行scroller.jumpTo(scroller.position.maxScrollExtent);时会导致到底部的时候会有一个小的跳动。可能是因为scroller.position.maxScrollExtent是一个计算值,跳转到底部的时候,计算的scroller.position.maxScrollExtent大小大于实际的大小导致。请问这种问题有没有解决方案。

我想问一下flutter web支持微前端框架吗

如题,我本身觉得js的前端框架体系太多太乱,所以一直提不起兴趣,现在团队想搞Qiankun的微前端框架,我想问一下可以把flutter web嵌入这个框架内吗?我在Qiankun项目的issue里看到有人问这个问题,回答的是如果用canvas渲染的是不行的,但是没说用html渲染的情况,所以想咨询一下

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.