Skip to content

Commit

Permalink
feat(#64): refresh indicator na pagina de jornada
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao151104 committed Jan 17, 2025
1 parent 3bd37f4 commit 6a9e13b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/ui/journey/view/journey_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,31 @@ class JourneyScreen extends StatelessWidget {
);
}

Future<void> _onRefresh() async {
final journeyViewModel = JourneyViewModel();
await journeyViewModel.journey();
await Future.delayed(const Duration(seconds: 2));
}

Widget _buildJourney(BuildContext context) {
JourneyViewModel viewModel = Provider.of<JourneyViewModel>(context);

return Card(
child: Column(
children: [
RefreshIndicator(
onRefresh: viewModel.journeyCommand.execute,
onRefresh: viewModel.journeyCommand.execute,
child: ListenableBuilder(
listenable: viewModel.journeyCommand,
builder: (context, child) {
if (viewModel.journeyCommand.isOk) {
return ListView.builder(
itemCount: viewModel.journeyCommand.result!.asValue!.value.length,
itemCount: viewModel
.journeyCommand.result!.asValue!.value.length,
shrinkWrap: true,
itemBuilder: (context, index) {
var journey = viewModel.journeyCommand.result!.asValue!.value[index];
var journey = viewModel
.journeyCommand.result!.asValue!.value[index];
return ListTile(
leading: Icon(
Icons.border_right,
Expand Down

0 comments on commit 6a9e13b

Please sign in to comment.