Skip to content
Snippets Groups Projects
Select Git revision
  • cdea3fdb5c2551d35bce1cc869de1ccb438466cd
  • master default protected
  • 100-upgrade-framework-and-dependencies
  • 65-improve-app-metadata
  • Release_1.8.0_80 protected
  • Release_1.7.2_79 protected
  • Release_1.7.1_78 protected
  • Release_1.7.0_77 protected
  • Release_1.6.0_76 protected
  • Release_1.5.0_75 protected
  • Release_1.4.0_74 protected
  • Release_1.3.2_73 protected
  • Release_1.3.1_72 protected
  • Release_1.3.0_71 protected
  • Release_1.2.1_70 protected
  • Release_1.2.0_69 protected
  • Release_1.1.3_68 protected
  • Release_1.1.2_67 protected
  • Release_1.1.1_66 protected
  • Release_1.1.0_65 protected
  • Release_1.0.63_64 protected
  • Release_1.0.62_63 protected
  • Release_1.0.61_62 protected
  • Release_1.0.60_61 protected
24 results

skeleton.dart

Blame
  • skeleton.dart 2.34 KiB
    import 'package:flutter/material.dart';
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    import 'package:random/config/application_config.dart';
    import 'package:random/cubit/activity/activity_cubit.dart';
    import 'package:random/models/activity/activity.dart';
    
    class SkeletonScreen extends StatelessWidget {
      const SkeletonScreen({super.key});
    
      @override
      Widget build(BuildContext context) {
        return BlocBuilder<NavCubitScreen, int>(
          builder: (BuildContext context, int screenIndex) {
            return BlocBuilder<ActivityCubit, ActivityState>(
              builder: (BuildContext context, ActivityState activityState) {
                return BlocBuilder<NavCubitPage, int>(
                  builder: (BuildContext context, int pageIndex) {
                    final Activity currentActivity = activityState.currentActivity;
    
                    // autostart activity
                    if (ApplicationConfig.config.autoStartActivity &&
                        (!currentActivity.isRunning)) {
                      ApplicationConfig.config.startNewActivity(context);
                    }
    
                    return Scaffold(
                      appBar: GlobalAppBar(
                        appConfig: ApplicationConfig.config,
                        pageIndex: pageIndex,
                        isActivityRunning:
                            currentActivity.isRunning && !currentActivity.isFinished,
                      ),
                      extendBodyBehindAppBar: false,
                      body: Material(
                        color: Theme.of(context).colorScheme.surface,
                        child: Padding(
                          padding: const EdgeInsets.only(
                            top: 8,
                            left: 2,
                            right: 2,
                          ),
                          child: ApplicationConfig.config.navigation.getScreenWidget(
                            appConfig: ApplicationConfig.config,
                            screenIndex: screenIndex,
                          ),
                        ),
                      ),
                      backgroundColor: Theme.of(context).colorScheme.surface,
                      bottomNavigationBar: ApplicationConfig.config.navigation.displayBottomNavBar
                          ? BottomNavBar(appConfig: ApplicationConfig.config)
                          : null,
                    );
                  },
                );
              },
            );
          },
        );
      }
    }