Skip to content

Commit

Permalink
fix(#66): correções rapidas
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielCostaDeOliveira committed Jan 21, 2025
1 parent 6a6f2d7 commit b3c3b2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/ui/navbar/view/navbar_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:aranduapp/ui/home/view/home_view.dart';
import 'package:aranduapp/ui/profile/view/profile_view.dart';
import 'package:aranduapp/ui/subjects/view/subjects_view.dart';
//import 'package:aranduapp/ui/profile/view/profileView.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
Expand All @@ -24,7 +25,7 @@ Widget page(BuildContext context) {
NavbarViewModel viewModel = Provider.of<NavbarViewModel>(context);

final List<Widget> pages = [
const HomeView(),
const Subject(),
const Center(child: Text('Friends', style: TextStyle(fontSize: 20))),
const Center(child: Text('Dashbord', style: TextStyle(fontSize: 20))),
const Profile(),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/subjects/view/subjects_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SubjectScreen extends StatelessWidget {
builder: (context, child) {
if (viewModel.subjectCommand.isOk) {
return ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0),
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 0),
itemCount:
viewModel.subjectCommand.result!.asValue!.value.length,
shrinkWrap: true,
Expand Down
9 changes: 1 addition & 8 deletions lib/ui/subjects/viewmodel/subjects_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@ import 'package:async/async.dart';
import 'package:flutter/material.dart';

class SubjectsViewmodel extends ChangeNotifier {
final GlobalKey<FormState> formKey;
final TextEditingController titleController;
final TextEditingController descriptionController;

List<SubjectsResponse> subjects = [];

late Command0<List<SubjectsRequest>> subjectCommand;

SubjectsViewmodel()
: formKey = GlobalKey<FormState>(),
titleController = TextEditingController(),
descriptionController = TextEditingController() {
SubjectsViewmodel() {
subjectCommand = Command0(subject);

subjectCommand.execute();
Expand Down

0 comments on commit b3c3b2c

Please sign in to comment.