Giter Site home page Giter Site logo

Comments (4)

Milad-Akarie avatar Milad-Akarie commented on May 22, 2024 1

Hey @fringefilmsoz , I don't think your generated router has anything to do with your issue.
auto_route's task is to generate your router class for you before run time it instead of you manually writing it.

I'd suggest you do a flutter clean up first.
if that doesn't work remove auto route from your pub and try a build see if it's causing it to behave they way it does.

also can you show me your home page?

from auto_route_library.

fringefilmsoz avatar fringefilmsoz commented on May 22, 2024

Additional info: In VS Code, the same error occurs, but the UI is not displayed at all.

Stuck in 'Running Gradle task Assemble Debug'.

from auto_route_library.

fringefilmsoz avatar fringefilmsoz commented on May 22, 2024

Ok, so i found the docs on Wrappers, but I was unable to get it working.

Here's what I tried... but still the same results:

Main.dart

import 'package:auto_route/auto_route_wrapper.dart';
import 'package:fhir_test/bloc/bloc.dart';
import 'package:fhir_test/route/router.gr.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget implements AutoRouteWrapper {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MultiBlocProvider(
      providers: [
        BlocProvider<PatientBloc>(
          create: (BuildContext context) => PatientBloc(),
        ),
      ],
      child: MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        initialRoute: Router.homePage,
        onGenerateRoute: Router.onGenerateRoute,
        navigatorKey: Router.navigatorKey,
      ),
    );
  }

  @override

  Widget get wrappedRoute => MultiBlocProvider(providers: [
        BlocProvider<PatientBloc>(
          create: (BuildContext context) => PatientBloc(),
        ),
      ], child: this);
}

from auto_route_library.

fringefilmsoz avatar fringefilmsoz commented on May 22, 2024

Hi,
It appears that Flutter developed some sort of issue. Even a new project wouldn't compile. Complete restart and Flutter Clean got me back on track... after a couple of hours of troubleshooting.

from auto_route_library.

Related Issues (20)

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.