Skip to content

Commit

Permalink
removed reduntant code and files
Browse files Browse the repository at this point in the history
  • Loading branch information
SAISURYAtalla committed Feb 10, 2024
1 parent cb49de1 commit e7319b7
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 354 deletions.
18 changes: 0 additions & 18 deletions frontend/lib/models/student2.dart

This file was deleted.

71 changes: 0 additions & 71 deletions frontend/lib/provider/about_Edit_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
// import '../provider/student_provider.dart';

final aboutProvider = Provider<String?>((ref) {
return ref.watch(aboutControllerProvider);
Expand Down Expand Up @@ -52,73 +51,3 @@ class AboutEditWidget extends ConsumerWidget {
);
}
}
// import 'package:flutter/material.dart';
// import 'package:flutter_riverpod/flutter_riverpod.dart';
// import '../provider/student_provider.dart';

// class AboutEditorWidget extends ConsumerWidget {
// const AboutEditorWidget({Key? key}) : super(key: key);

// @override
// Widget build(BuildContext context, WidgetRef ref) {
// final student = ref.read(studentProvider);

// final TextEditingController aboutController =
// TextEditingController(text: student.about);

// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// 'About',
// style: const TextStyle(
// fontWeight: FontWeight.bold,
// ),
// ),
// TextFormField(
// controller: aboutController,
// onChanged: (newAbout) {
// ref.read(studentProvider.notifier).editAbout(newAbout);
// },
// decoration: const InputDecoration(
// hintText: 'Write something about yourself...',
// ),
// maxLines: 5,
// ),
// ],
// );
// }
// }
// // class AboutEditorWidget extends ConsumerWidget {
// // const AboutEditorWidget({Key? key}) : super(key: key);

// // @override
// // Widget build(BuildContext context, WidgetRef ref) {
// // final student = ref.read(studentProvider);

// // final TextEditingController aboutController =
// // TextEditingController(text: student.about);

// // return Column(
// // crossAxisAlignment: CrossAxisAlignment.start,
// // children: [
// // Text(
// // 'About',
// // style: const TextStyle(
// // fontWeight: FontWeight.bold,
// // ),
// // ),
// // TextField(
// // controller: aboutController,
// // onChanged: (newAbout) {
// // ref.read(studentProvider.notifier).editAbout(newAbout);
// // },
// // decoration: const InputDecoration(
// // hintText: 'Write something about yourself...',
// // ),
// // maxLines: 5,
// // ),
// // ],
// // );
// // }
// // }
1 change: 0 additions & 1 deletion frontend/lib/provider/achievements_edit_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../models/achievement.dart';

final achievementsProvider = Provider<List<Achievement>>((ref) {
// Your achievements data
return ref.watch(achievementsControllerProvider);
});

Expand Down
92 changes: 0 additions & 92 deletions frontend/lib/provider/skills_edit_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:syncfusion_flutter_sliders/sliders.dart';
import '../models/skills.dart';

final skillsProvider = Provider<List<Skill>>((ref) {
// Your skills data
return ref.watch(skillsControllerProvider);
});

Expand Down Expand Up @@ -109,94 +108,3 @@ class SkillsEditWidget extends ConsumerWidget {
);
}
}
// import 'package:flutter/material.dart';
// import 'package:syncfusion_flutter_sliders/sliders.dart';

// // class SkillsEditWidget extends StatelessWidget {
// // final TextEditingController skillsController;

// // const SkillsEditWidget({required this.skillsController});

// // @override
// // Widget build(BuildContext context) {
// // List<Skill> skills = (jsonDecode(skillsController.text) as List<dynamic>)
// // .map((json) => Skill.fromJson(json))
// // .toList();

// // return Column(
// // crossAxisAlignment: CrossAxisAlignment.start,
// // children: [
// // const Text(
// // 'Skills',
// // style: TextStyle(
// // fontWeight: FontWeight.bold,
// // ),
// // ),
// // ListView.builder(
// // shrinkWrap: true,
// // itemCount: skills.length,
// // itemBuilder: (context, index) {
// // return Row(
// // children: [
// // Expanded(
// // child: TextFormField(
// // initialValue: skills[index].name,
// // onChanged: (value) {
// // skills[index].name = value;
// // updateSkills();
// // },
// // decoration: const InputDecoration(labelText: 'Skill'),
// // ),
// // ),
// // Expanded(
// // child: SfSlider(
// // min: 0.0,
// // max: 100.0,
// // value: skills[index].level.toDouble(),
// // onChanged: (dynamic value) {
// // skills[index].level = value.toInt();
// // updateSkills();
// // },
// // ),
// // ),
// // ],
// // );
// // },
// // ),
// // ],
// // );
// // }

// // void updateSkills() {
// // skillsController.text = jsonEncode(skills);
// // }
// // }

// class SkillsEditWidget extends StatelessWidget {
// final TextEditingController skillsController;

// const SkillsEditWidget({required this.skillsController});

// @override
// Widget build(BuildContext context) {
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// const Text(
// 'Skills',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// ),
// ),
// SfSlider(
// min: 0.0,
// max: 100.0,
// value: double.parse(skillsController.text),
// onChanged: (dynamic value) {
// skillsController.text = value.toStringAsFixed(0);
// },
// ),
// ],
// );
// }
// }
24 changes: 0 additions & 24 deletions frontend/lib/provider/student_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,4 @@ class StudentProvider extends StateNotifier<StudentState> {
state = newState;
_logger.i("Removed student: ${student.name}");
}

// Student getStudentById(String studentId) {
// try {
// return state.students.firstWhere((student) => student.id == studentId);
// } catch (e) {
// return Student(
// id: '1',
// name: 'John Doe',
// email: '[email protected]',
// rollNumber: 'R001',
// about: 'I am a computer science student.',
// profilePicURI:
// 'https://cdn4.sharechat.com/img_907710_35cec5f5_1681916904360_sc.jpg?tenant=sc&referrer=pwa-sharechat-service&f=360_sc.jpg',
// branch: 'Computer Science',
// graduationYear: 2023,
// skills: [DummySkills.skills[1], DummySkills.skills[2]],
// achievements: [
// Dummyachievements.achievements[1],
// Dummyachievements.achievements[2]
// ],
// roles: ['Core Member', 'Coordinator'],
// );
// }
// }
}
73 changes: 1 addition & 72 deletions frontend/lib/screens/edit_profile.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
// import '../provider/user_providers.dart';
// import '../models/skills.dart';
// import '../models/achievement.dart';
import '../provider/skills_edit_widget.dart';
import '../provider/achievements_edit_widget.dart';
import '../provider/about_Edit_widget.dart';
import '../provider/about_edit_widget.dart';
import 'dart:convert';

class EditProfileScreen extends ConsumerWidget {
Expand All @@ -29,11 +26,9 @@ class EditProfileScreen extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AboutEditWidget(),
// UI for editing skills
SkillsEditWidget(
skillsController: TextEditingController(text: skillsJson),
),
// UI for editing achievements
AchievementsEditWidget(
achievementsController:
TextEditingController(text: achievementsJson),
Expand All @@ -45,69 +40,3 @@ class EditProfileScreen extends ConsumerWidget {
);
}
}
// import 'package:flutter/material.dart';
// import 'package:flutter_riverpod/flutter_riverpod.dart';
// import '../provider/user_providers.dart';
// import '../models/skills.dart';
// import '../models/achievement.dart';
// import '../provider/skills_edit_widget.dart';
// import '../provider/achievements_edit_widget.dart';
// import 'dart:convert';

// class EditProfileScreen extends ConsumerWidget {
// @override
// Widget build(BuildContext context, WidgetRef ref) {
// TextEditingController aboutController =
// TextEditingController(text: ref.watch(aboutProvider) ?? "");

// List<Skill> skills = ref.watch(skillsProvider);
// List<Achievement> achievements = ref.watch(achievementsProvider);

// String skillsJson = jsonEncode(skills);
// String achievementsJson = jsonEncode(achievements);

// return Scaffold(
// appBar: AppBar(
// title: const Text('Edit Profile'),
// ),
// body: SingleChildScrollView(
// child: Padding(
// padding: const EdgeInsets.all(16.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// const Text(
// 'Edit About',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 20,
// ),
// ),
// TextField(
// controller: aboutController,
// onChanged: (newAbout) {
// // ref.read(aboutProvider).state = newAbout;
// },
// decoration: const InputDecoration(
// hintText: 'Write something about yourself...',
// ),
// maxLines: 5,
// ),

// // UI for editing skills
// SkillsEditWidget(
// skillsController: TextEditingController(text: skillsJson),
// ),

// // UI for editing achievements
// AchievementsEditWidget(
// achievementsController:
// TextEditingController(text: achievementsJson),
// ),
// ],
// ),
// ),
// ),
// );
// }
// }
Loading

0 comments on commit e7319b7

Please sign in to comment.