mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 11:07:56 +00:00
restructured the application
added .end files switched to BLoC state-management removed unnecessary helpers initialized Scenes Page
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'profile_state.dart';
|
||||
|
||||
class ProfileCubit extends Cubit<ProfileState> {
|
||||
ProfileCubit() : super(ProfileInitial());
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
part of 'profile_cubit.dart';
|
||||
|
||||
@immutable
|
||||
abstract class ProfileState {}
|
||||
|
||||
class ProfileInitial extends ProfileState {}
|
||||
@@ -1,7 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'profile_state.dart';
|
||||
|
||||
class ProfileProvider extends ChangeNotifier {
|
||||
final state = ProfileState();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
class ProfileState {
|
||||
|
||||
ProfileState() {
|
||||
// init some variables
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'profile_provider.dart';
|
||||
|
||||
class ProfilePage extends StatelessWidget {
|
||||
const ProfilePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (BuildContext context) => ProfileProvider(),
|
||||
builder: (context, child) => const Center(
|
||||
child: Text('Profile Page'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_app/features/profile/bloc/profile_cubit.dart';
|
||||
|
||||
class ProfileView extends StatelessWidget {
|
||||
const ProfileView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => ProfileCubit(),
|
||||
child: BlocBuilder<ProfileCubit, ProfileState>(
|
||||
builder: (context, state) {
|
||||
return const Center(
|
||||
child: Text('Profile Page'),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user