Added support for force refresh without caching, using this system on chatList.dart
This commit is contained in:
@ -93,7 +93,7 @@ class _ChatListState extends State<ChatList> {
|
||||
return RefreshIndicator(
|
||||
color: Theme.of(context).primaryColor,
|
||||
onRefresh: () {
|
||||
Provider.of<ChatListProps>(context, listen: false).run();
|
||||
Provider.of<ChatListProps>(context, listen: false).run(renew: true);
|
||||
return Future.delayed(const Duration(seconds: 3));
|
||||
},
|
||||
child: ListView(children: chats),
|
||||
|
@ -1,4 +1,6 @@
|
||||
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/data/timetable/timetableProps.dart';
|
||||
import 'package:marianum_mobile/screen/pages/timetable/weekView.dart';
|
||||
@ -24,6 +26,8 @@ class _TimetableState extends State<Timetable> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double movement = 0;
|
||||
|
||||
return Consumer<TimetableProps>(
|
||||
builder: (context, value, child) {
|
||||
if(value.primaryLoading()) {
|
||||
@ -35,7 +39,14 @@ class _TimetableState extends State<Timetable> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
child: WeekView(value),
|
||||
child: Positioned(
|
||||
left: movement,
|
||||
child: WeekView(value),
|
||||
),
|
||||
onHorizontalDragUpdate: (details) {
|
||||
log("${details.globalPosition.dx}");
|
||||
movement = details.globalPosition.dx;
|
||||
},
|
||||
onHorizontalDragEnd: (details) {
|
||||
if(details.primaryVelocity! < 0) {
|
||||
timetable.switchWeek();
|
||||
|
Reference in New Issue
Block a user