in Education by
I'm new to flutter and can't resolve the issue. Your application could not be compiled, because its dependencies could not be established. The following Dart file: /Users/anirudhsharma392/Desktop/flutter/testing/lib/counter/counter.dart ...refers, in an import, to the following library: /Users/anirudhsharma392/Desktop/flutter/testing/lib/counter/counter.g.dart Unfortunately, that library does not appear to exist on your file system. import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; part 'counter.g.dart'; class Counter = CounterBase with _$Counter; abstract class CounterBase implements Store { @observable int value = 0; @action void increment() { value++; } } class CounterExample extends StatefulWidget { const CounterExample({Key key}) : super(key: key); @override _CounterExampleState createState() => _CounterExampleState(); } class _CounterExampleState extends State { final _counter = Counter(); @override Widget build(BuildContext context) => Scaffold( appBar: AppBar( title: const Text('Counter'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text( 'You have pushed the button this many times:', ), Observer( builder: (_) => Text( '${_counter.value}', style: const TextStyle(fontSize: 20), )), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _counter.increment, tooltip: 'Increment', child: const Icon(Icons.add), ), ); } JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Mobx use code-generation to work. You need to run another command to generate the files needed for Mobx to work There are two ways to generate these files: flutter pub pub run build_runner build flutter pub pub run build_runner watch The former is a one-time generation. While the latter continuously watch your sources to update the generated files when an update is needed Be sure to add build_runner to your dependencies: dev_dependencies: build_runner: ^1.1.2

Related questions

0 votes
    I'm new to flutter and can't resolve the issue. Your application could not be compiled, because its ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
0 votes
    I need to build a pop up dialog box in my app. I am using Dialog class and wrapped it with ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I am trying to implement the reCaptcha function to my flutter app, but in the captcha registration I need ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    Video does not capture in the right orientation when running the Camera Plugin example app on my iPhone X in Landscape. It works well ... .0+1 environment: sdk: ">=2.0.0-dev.68.0...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I am adding an background image to the Splash screen, but is not rendering the image. Sometime it load ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm working on a program that displays a list from an SQFlite table. The future for the snapshot ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I have this operation EventModel data = EventModel(_nameEvent, _passEvent, _localEvent, _dateEventString); HashMap ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I'm getting Authorization failure when trying to display a map in a flutter project using the google maps ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm new to Flutter Redux, I got a problem and I have no idea how to deal with it at all! ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    So I am trying to creating simple Login Page with help of the Spring Boot and Security. So what I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    I have some wizard-like pages in my application, its keeping state while navigating between small steps, the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I do have a main application in Flutter using Hive as database, and I would like to incorporate another ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    Can't ping smtp.gmail.com. I've been using google smtp for email notification and it was working ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    In our application (a game), in some cases it can't run fast enough. Obviously we'd like to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I use the on-demand (hosted) version of FogBugz. I would like to start using Mercurial for source ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
...