Skip to content

Commit 794a89e

Browse files
committed
Resolve rendering errors
1 parent 04cabc5 commit 794a89e

File tree

3 files changed

+28
-48
lines changed

3 files changed

+28
-48
lines changed

lib/components/event_list.dart

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import 'package:iccm_eu_app/data/model/event_data.dart';
99
import 'package:provider/provider.dart';
1010

1111
class EventList extends StatefulWidget {
12-
bool get futureEvents => _futureEvents;
13-
final bool _futureEvents;
12+
final bool futureEvents;
1413

1514
const EventList({
16-
required bool futureEvents,
15+
required this.futureEvents,
1716
super.key,
18-
}) : _futureEvents = futureEvents;
17+
});
1918

2019
@override
2120
EventListState createState() => EventListState();
@@ -34,46 +33,31 @@ class EventListState extends State<EventList> {
3433

3534
@override
3635
Widget build(BuildContext context) {
37-
return PrimaryScrollController(
38-
controller: ScrollController(),
39-
child: SingleChildScrollView(
40-
child: Column(
41-
children: [
42-
// Use Expanded to allow ListView.builder to take available space
43-
Expanded(
44-
child: ValueListenableBuilder<bool>(
45-
valueListenable: PreferencesProvider.futureEventsNotifier,
46-
builder: (context, builderValue, child) {
47-
return Consumer<
48-
EventsProvider>(
49-
builder: (context, itemList, child) {
50-
List<EventData> items;
51-
if (builderValue) {
52-
items = itemList.filterPastEvents();
53-
} else {
54-
items = itemList.items();
55-
}
56-
return ValueListenableBuilder<DateTime?>(
57-
valueListenable: NextEventNotifier.nextEventNotifier,
58-
builder: (context, nextEventTime, _) {
59-
return ListView.builder(
60-
shrinkWrap: true,
61-
physics: ClampingScrollPhysics(),
62-
itemCount: items.length,
63-
itemBuilder: (context, index) {
64-
return EventListTile(item: items[index]);
65-
},
66-
);
67-
},
68-
);
69-
},
70-
);
71-
}
72-
),
73-
),
74-
],
75-
),
76-
),
36+
return ValueListenableBuilder<bool>(
37+
valueListenable: PreferencesProvider.futureEventsNotifier,
38+
builder: (context, builderValue, child) {
39+
return Consumer<EventsProvider>(
40+
builder: (context, itemList, child) {
41+
List<EventData> items;
42+
if (builderValue) {
43+
items = itemList.filterPastEvents();
44+
} else {
45+
items = itemList.items();
46+
}
47+
return ValueListenableBuilder<DateTime?>(
48+
valueListenable: NextEventNotifier.nextEventNotifier,
49+
builder: (context, nextEventTime, _) {
50+
return ListView.builder(
51+
itemCount: items.length,
52+
itemBuilder: (context, index) {
53+
return EventListTile(item: items[index]);
54+
},
55+
);
56+
},
57+
);
58+
},
59+
);
60+
}
7761
);
7862
}
7963
}

lib/theme/dark_theme.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,5 @@ ThemeData darkTheme = ThemeData(
4040
displayMedium: TextStyle(
4141
color: Colors.grey.shade300,
4242
),
43-
).apply( // Use apply() to add properties to all text styles
44-
fontFamilyFallback: ['NotoColorEmoji'],
4543
),
4644
);

lib/theme/light_theme.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,5 @@ ThemeData lightTheme = ThemeData(
4040
displayMedium: TextStyle(
4141
color: Colors.grey.shade900,
4242
),
43-
).apply( // Use apply() to add properties to all text styles
44-
fontFamilyFallback: ['NotoColorEmoji'],
4543
),
4644
);

0 commit comments

Comments
 (0)