restructured the application

added .end files
switched to BLoC state-management
removed unnecessary helpers
initialized Scenes Page
This commit is contained in:
Mohammad Salameh
2024-02-15 14:00:09 +03:00
parent 16f47f744c
commit 1d18210158
79 changed files with 554 additions and 723 deletions
+8
View File
@@ -0,0 +1,8 @@
import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';
part 'smart_state.dart';
class SmartCubit extends Cubit<SmartState> {
SmartCubit() : super(SmartInitial());
}
+6
View File
@@ -0,0 +1,6 @@
part of 'smart_cubit.dart';
@immutable
abstract class SmartState {}
class SmartInitial extends SmartState {}
-7
View File
@@ -1,7 +0,0 @@
import 'package:flutter/material.dart';
import 'smart_state.dart';
class SmartProvider extends ChangeNotifier {
final state = SmartState();
}
-6
View File
@@ -1,6 +0,0 @@
class SmartState {
SmartState() {
// init some variables
}
}
-18
View File
@@ -1,18 +0,0 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'smart_provider.dart';
class SmartPage extends StatelessWidget {
const SmartPage({super.key});
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider(
create: (BuildContext context) => SmartProvider(),
builder: (context, child) => const Center(
child: Text('Smart Page'),
),
);
}
}
+20
View File
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/smart/bloc/smart_cubit.dart';
class SmartPage extends StatelessWidget {
const SmartPage({super.key});
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SmartCubit(),
child: BlocBuilder<SmartCubit, SmartState>(
builder: (context, state) {
return const Center(
child: Text('Smart Page'),
);
},
));
}
}