dart

Flutter : how to show next index after complete a specific logic in Swiper, where GridView also set in Swiper?

我只是一个虾纸丫 提交于 2020-12-26 12:05:57
问题 I'm trying to make a word game. First of all, the index will be white. if user Click the correct answer then index will be to green color and go to next screen, also index will be white in next screen.. again if user click incorrect answer then index will be to red color and don't let go to the next page until user put correct answer... i set a GridView in Swiper (Swiper took by importing, import 'package:flutter_swiper/flutter_swiper.dart';). and i want to show next index of Swiper after

Dart symbol literals

十年热恋 提交于 2020-12-26 12:05:36
问题 I was reading this document on Zones and it has the following code: runZoned(() { print(Zone.current[#key]); }, zoneValues: { #key: 499 }); I tried to find more docs symbol literals, but I couldn't, they are very scarce. I typed this code for a test: var a = #b; And I can see that a is a Symbol . How does a Symbol literal work? What does it reference to? Just by creating one I create a new unique Symbol ? 回答1: Symbols are not unique. They are intended to represent source names at runtime, so

Flutter : how to show next index after complete a specific logic in Swiper, where GridView also set in Swiper?

走远了吗. 提交于 2020-12-26 12:05:09
问题 I'm trying to make a word game. First of all, the index will be white. if user Click the correct answer then index will be to green color and go to next screen, also index will be white in next screen.. again if user click incorrect answer then index will be to red color and don't let go to the next page until user put correct answer... i set a GridView in Swiper (Swiper took by importing, import 'package:flutter_swiper/flutter_swiper.dart';). and i want to show next index of Swiper after

Flutter: Why setState(( ) { }) set data again and again

北城以北 提交于 2020-12-26 09:45:39
问题 I use setState(() {}) for assigning a value to a variable. But it's printing again and again. Why does it react like this? And how can I fix it? Here is my code: class Sample extends StatefulWidget { @override _SampleState createState() => _SampleState(); } class _SampleState extends State<Sample> { String _message; String _appLink; Firestore db = Firestore.instance; @override Widget build(BuildContext context) { db.collection('share').document('0').get().then((value) { var message = value

Flutter failed for task app:mergeDebugNativeLibs and app:mergeDebugJavaResource

試著忘記壹切 提交于 2020-12-26 08:29:18
问题 FAILURE: Build completed with 2 failures. 1: Task failed with an exception. What went wrong: Execution failed for task ':app:mergeDebugNativeLibs'. A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade File 'com.android.builder.files.ZipCentralDirectory@6f58452a' was deleted, but previous version not found in cache Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get

Append items dynamically to ListView

人盡茶涼 提交于 2020-12-26 07:59:45
问题 I am new to Dart and Flutter and try to append a new item to my ListView. I created a button that increments this.value but nothing happens. Am I missing an update call on the UI and is this even the correct approach? Since I return the value of ListView.builder directly to the caller of build I am not sure how to get the list to add more items. Thanks a lot! class MyList extends State<MyList> { ... int value = 2; @override Widget build(BuildContext context) { return ListView.builder(

Type error when adding two derivatives of same base class in a List

放肆的年华 提交于 2020-12-26 07:44:53
问题 I have this code: List<Widget> _elementsHere = _locationsRegister .map((e) => ShowingLocation( num: e.num, name: e.name, icon: e.icon, )) .toList(); I have specified List<Widget> , but if I print _elementsHere.runtimeType.toString() in console, I can see List<ShowingLocation> . In fact if I add this code: _elementsHere.insert(0, Text('hello')); I receive error that Text isn't a subtype of ShowingLocation , despite it's a Widget. I want _elementsHere as List<Widget> instead of List

The named parameter 'child' isn't defined. in Center() constructor

心不动则不痛 提交于 2020-12-26 05:56:06
问题 I ran flutter upgrade today, and now I am getting an error that says- [dart] The named parameter 'child' isn't defined. The project is newly created and the default code is untouched, but it still has the same Error: 回答1: Try Restarting your Analysis Dart Server. At the the bottom of Android Studio click on the 'Dart Analysis' tab Click on the Restart icon. 回答2: Clean the project cache by running flutter clean cache Then invalidate caches / restart Android Studio or VS Code. 回答3: In my case

The named parameter 'child' isn't defined. in Center() constructor

大憨熊 提交于 2020-12-26 05:56:05
问题 I ran flutter upgrade today, and now I am getting an error that says- [dart] The named parameter 'child' isn't defined. The project is newly created and the default code is untouched, but it still has the same Error: 回答1: Try Restarting your Analysis Dart Server. At the the bottom of Android Studio click on the 'Dart Analysis' tab Click on the Restart icon. 回答2: Clean the project cache by running flutter clean cache Then invalidate caches / restart Android Studio or VS Code. 回答3: In my case

Disable Word Underlining in TextFormField

送分小仙女□ 提交于 2020-12-26 01:59:22
问题 I am currently working on an app design in Flutter, and struggling with this seemingly easy problem. When creating the TextFormField below, the input text is always underlined, no matter of what I've tried. The only thing I want is text without this ugly underline. Possibly the reason for this issue is that Android (I'm using an Android Emulator) automatically underlines text in input forms like this one, but this is just a thought that came to my mind and I am not sure if this is the real