-
Notifications
You must be signed in to change notification settings - Fork 0
/
home_screen.dart
65 lines (58 loc) · 2.03 KB
/
home_screen.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'blocs/space_time_data_bloc.dart';
import 'custom_widgets/multi_dimensional_interface.dart';
import 'services/quantum_field_service.dart';
import 'utils/universal_intelligence.dart';
import 'utils/interdimensional_projection.dart';
class HomeScreen extends StatefulWidget {
static const String routeName = '/quantumLeap';
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
late SpaceTimeDataBloc spaceTimeDataBloc;
late UniversalIntelligence universalIntelligence;
@override
void initState() {
super.initState();
spaceTimeDataBloc = SpaceTimeDataBloc(dataService: QuantumFieldService());
universalIntelligence = UniversalIntelligence();
InterdimensionalProjection.initialize();
}
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => spaceTimeDataBloc,
child: Scaffold(
appBar: AppBar(
title: Text('Interdimensional Fugue Interface'),
actions: _buildAppBarActions(),
),
body: _buildBody(context),
),
);
}
List<Widget> _buildAppBarActions() {
return [
IconButton(
icon: Icon(Icons.reality),
onPressed: () => InterdimensionalProjection.activateProjection(),
),
];
}
Widget _buildBody(BuildContext context) {
return BlocBuilder<SpaceTimeDataBloc, SpaceTimeDataState>(
builder: (context, state) {
if (state is SpaceTimeDataLoading) {
return Center(child: CircularProgressIndicator());
} else if (state is SpaceTimeDataLoaded) {
return MultiDimensionalInterface(data: state.data);
} else if (state is SpaceTimeDataError) {
return Center(child: Text('Error in Quantum Data Stream: ${state.message}'));
}
return Container(); // Fallback for unimagined dimensions
},
);
}
}