Skip to content
Snippets Groups Projects
Select Git revision
  • 8073b4d7a7fbd83283e8498a3f02b871c7a8b71b
  • master default protected
  • 45-improve-app-metadata
  • Release_0.9.1_58 protected
  • Release_0.9.0_57 protected
  • Release_0.8.2_56 protected
  • Release_0.8.1_55 protected
  • Release_0.8.0_54 protected
  • Release_0.7.0_53 protected
  • Release_0.6.0_52 protected
  • Release_0.5.0_51 protected
  • Release_0.4.2_50 protected
  • Release_0.4.1_49 protected
  • Release_0.4.0_48 protected
  • Release_0.3.1_47 protected
  • Release_0.3.0_46 protected
  • Release_0.2.2_45 protected
  • Release_0.2.1_44 protected
  • Release_0.2.0_43 protected
  • Release_0.1.2_42 protected
  • Release_0.1.1_41 protected
  • Release_0.1.0_40 protected
  • Release_0.0.39_39 protected
23 results

skeleton.dart

Blame
  • skeleton.dart 2.34 KiB
    import 'package:flutter/material.dart';
    import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
    
    import 'package:colors/config/application_config.dart';
    import 'package:colors/cubit/activity/activity_cubit.dart';
    import 'package:colors/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,
                    );
                  },
                );
              },
            );
          },
        );
      }
    }