app_features 0.5.0 copy "app_features: ^0.5.0" to clipboard
app_features: ^0.5.0 copied to clipboard

This package help you to Organize folders Structure by feature scope.

Feature By Feature #

This package help you to Organize folders Structure by feature scope. package in development

Features #

  1. Feature scope routes and dependents.
  2. Manage Routes by go_router.
  3. Handle dialog and bottom sheet by routes.
  4. Handle Snack Bar by ScaffoldMessenger.
  5. Overlay Support.

Getting started #

  • Install package:
 flutter pub add app_features
  • Config routes:
class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'App Features Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routerConfig: AppFeatures.router,
    );
  }
}

New Feature #

to create new feature you need to:

  • feature class
  • feature page as view

lets create Auth feature example:

  1. create new folder auth in features folder.
  2. create login_page.dart file as login view page.
  3. create new class file name auth_feaure.dart:
    import 'package:app_features/app_features.dart';
       
    class AuthFeature extends Feature {
       
        @override
        String get name => '/login';
       
        @override
        List<GoRoute> get routes => [
             GoRoute(
              path: name,
              name: name,
              builder: (_, __) => const LoginPage(),
            ),
        ]
    }
    
  4. Register new feature to AppFeatures config:
    void main() {
      AppFeatures.config(
        features: [
            SplashFeature(),
            AuthFeature()
          ],
      );
      runApp(const MyApp());
    }
    
  5. Navigate to AuthFeature:
    // push to feature
    AppFeatures.get<AuthFeature>().push();
     // or go to feature
    AppFeatures.get<AuthFeature>().go();
    // or repleace feature
    AppFeatures.get<AuthFeature>().replace();
    
9
likes
0
pub points
50%
popularity

Publisher

verified publisherm-it.dev

This package help you to Organize folders Structure by feature scope.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, go_router

More

Packages that depend on app_features