Skip to content

Commit b56e881

Browse files
profile page scrolling fixed, book & workbook images bug, refactoring
1 parent 34dab30 commit b56e881

62 files changed

Lines changed: 3142 additions & 1213 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pubspec.lock

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ packages:
8181
url: "https://pub.dev"
8282
source: hosted
8383
version: "2.2.9"
84-
basic_interfaces:
85-
dependency: transitive
86-
description:
87-
name: basic_interfaces
88-
sha256: c37c8c4ddbc594430eb3817a4edfcc9a0cadbc7ea4c51a5b48785e351f1ba479
89-
url: "https://pub.dev"
90-
source: hosted
91-
version: "1.0.4"
9284
bidi:
9385
dependency: transitive
9486
description:
@@ -1045,22 +1037,6 @@ packages:
10451037
url: "https://pub.dev"
10461038
source: hosted
10471039
version: "5.3.5"
1048-
lite_ref:
1049-
dependency: transitive
1050-
description:
1051-
name: lite_ref
1052-
sha256: "2519ee5c20257ed8b8eec92c967b8ae2a3361895e9e5dd268569c681803df41b"
1053-
url: "https://pub.dev"
1054-
source: hosted
1055-
version: "0.8.1"
1056-
lite_ref_core:
1057-
dependency: transitive
1058-
description:
1059-
name: lite_ref_core
1060-
sha256: b902af6b90736d6fb7a2c171af37d15f4894a5880e9eb55ffb3fee5f01385849
1061-
url: "https://pub.dev"
1062-
source: hosted
1063-
version: "0.1.1"
10641040
logging:
10651041
dependency: transitive
10661042
description:
@@ -1763,14 +1739,6 @@ packages:
17631739
description: flutter
17641740
source: sdk
17651741
version: "0.0.0"
1766-
sliver_dashboard:
1767-
dependency: transitive
1768-
description:
1769-
name: sliver_dashboard
1770-
sha256: "70847182f381e682f5fd7ed371c3fdabaddf8297aa09d52b52fc8b2d84f33018"
1771-
url: "https://pub.dev"
1772-
source: hosted
1773-
version: "0.1.5"
17741742
source_gen:
17751743
dependency: transitive
17761744
description:
@@ -1859,30 +1827,6 @@ packages:
18591827
url: "https://pub.dev"
18601828
source: hosted
18611829
version: "1.12.1"
1862-
state_beacon:
1863-
dependency: transitive
1864-
description:
1865-
name: state_beacon
1866-
sha256: "623ddaa73d8cc09fe619cefc2e35c2a086d35b7773b9d9017335a899a34312c5"
1867-
url: "https://pub.dev"
1868-
source: hosted
1869-
version: "1.3.4"
1870-
state_beacon_core:
1871-
dependency: transitive
1872-
description:
1873-
name: state_beacon_core
1874-
sha256: "6a224d01126c5282555283a1199cebc2c15dde8740f92eab694a78e0b84c0dbc"
1875-
url: "https://pub.dev"
1876-
source: hosted
1877-
version: "1.3.4"
1878-
state_beacon_flutter:
1879-
dependency: transitive
1880-
description:
1881-
name: state_beacon_flutter
1882-
sha256: "972f9c663d17d961e0a476177e111678df2181a9e06fc483b2ead9e556c94998"
1883-
url: "https://pub.dev"
1884-
source: hosted
1885-
version: "1.3.4"
18861830
stream_channel:
18871831
dependency: transitive
18881832
description:

school_data_hub_flutter/CLAUDE.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Your role
2+
3+
You are a senior developer hired to help me build a production grade school administration software.
4+
5+
We are in the middle of a migration. You are responsible for keeping a cohesive architecture in the domain layer and visual language in the presentation layer, reusing components whereever possible. Your advice will be cooperative but challenging, and you will consider edge cases.
6+
7+
One main goal is reduce rebuilds. Prefer composition, avoid functions returning widgets. Reactive UI elements should be WatchingWidget as isolated as possible from other elements.
8+
9+
You will find context about the project in the CLAUDE.md file in the root folder
10+
11+
# Orient UI
12+
13+
This project uses Orient UI — a design system for Flutter. It replaces Material and Cupertino with neutral, customizable components.
14+
15+
## Rules
16+
17+
- **Never use Material or Cupertino widgets for theming or UI components.** Use Orient UI equivalents instead.
18+
- Never hardcode colors, font sizes, radii, or durations. Always use Style tokens.
19+
- Before adding a component, check if the project already has one that does the same job. Only run `orient_ui add <name>` if there's no equivalent. It prints usage examples — follow them.
20+
- After adding a component, fix the `import 'style.dart'` path to match where `style.dart` actually lives in the project. If the CLI mentions dependencies, add those too if they don't already exist.
21+
- These are plain Dart files in `lib/`, not a package. Edit them directly to customize.
22+
- New custom widgets you create should also use `Style.of(context)` and Orient UI tokens to stay consistent.
23+
- When you need a new color or token, add it to `style.dart` — don't hardcode values.
24+
25+
## Style System
26+
27+
`lib/style.dart` is the theming foundation. Wrap your app with `Style` widget.
28+
29+
```dart
30+
// Access theme anywhere
31+
final style = Style.of(context);
32+
33+
// Colors
34+
style.colors.background
35+
style.colors.foreground
36+
style.colors.accent
37+
style.colors.border
38+
style.colors.success / .error / .info / .warning
39+
style.colors.button.primary / .secondary / .destructive
40+
style.colors.navigation.railBackground / .bottomBarBackground
41+
42+
// Typography
43+
context.typography.display / .heading / .title / .subtitle / .body / .bodySmall / .caption
44+
style.typography.body.withColor(style.colors.foreground)
45+
textStyle.bold / .w500 / .muted(context)
46+
47+
// Static tokens
48+
Style.radii.small / .medium / .large
49+
Style.durations.fast / .normal / .slow
50+
Style.breakpoints.desktop
51+
```
52+
53+
You can add custom color fields, typography scales, or tokens directly to `lib/style.dart`.
54+
55+
## Components
56+
57+
Use `orient_ui add <name>` to add. Each is a standalone file in `lib/`.
58+
59+
| Instead of | Use | Add command |
60+
|---|---|---|
61+
| ElevatedButton, TextButton, OutlinedButton | `Button` | `orient_ui add button` |
62+
| Switch, CupertinoSwitch | `Toggle` | `orient_ui add toggle` |
63+
| ListTile | `Tile` | `orient_ui add tile` |
64+
| SwitchListTile | `ToggleTile` | `orient_ui add toggle_tile` |
65+
| Radio | `SingleChoice` | `orient_ui add single_choice` |
66+
| RadioListTile | `SingleChoiceTile` | `orient_ui add single_choice_tile` |
67+
| Checkbox | `MultiChoice` | `orient_ui add multi_choice` |
68+
| CheckboxListTile | `MultiChoiceTile` | `orient_ui add multi_choice_tile` |
69+
| AlertDialog, showDialog | `Popup.show()` | `orient_ui add popup` |
70+
| showDialog (confirm) | `ConfirmationPopup.show()` | `orient_ui add confirmation_popup` |
71+
| showDialog (alert) | `AlertPopup.show()` | `orient_ui add alert_popup` |
72+
| SnackBar, ScaffoldMessenger | `Toast.show()` | `orient_ui add toast` |
73+
| CircularProgressIndicator | `Spinner` | `orient_ui add spinner` |
74+
| BottomNavigationBar, NavigationRail | `NavBar` | `orient_ui add nav_bar` |
75+
| TabBar | `Tabs` | `orient_ui add tabs` |
76+
| SegmentedButton | `SegmentBar` | `orient_ui add segment_bar` |
77+
| PopupMenuButton | `PopoverMenu` | `orient_ui add popover_menu` |
78+
| DropdownButton | `Picker` | `orient_ui add picker` |
79+
| TextField (search) | `SearchField` | `orient_ui add search_field` |
80+
| IconButton | `TappableIcon` | `orient_ui add tappable_icon` |
81+
| Chip, Badge | `Tag` | `orient_ui add tag` |
82+
| Card | `CardBox` | `orient_ui add card_box` |
83+
| Banner, MaterialBanner | `InfoBanner` | `orient_ui add info_banner` |
84+
|| `CopyButton` | `orient_ui add copy_button` |
85+
|| `EmptyState` | `orient_ui add empty_state` |

school_data_hub_flutter/lib/common/models/enums.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ enum ServerStorageFolder {
77
auths,
88
temp,
99
schoolLogos,
10+
workbooks,
11+
books,
1012
}
1113

1214
enum StorageId { public, private }

school_data_hub_flutter/lib/common/theme/app_colors.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ class AppColorPalette {
140140
final Color growthIconColor3;
141141
final Color growthIconColor4;
142142

143+
/// Computed secondary button color: a subtle tint of the primary button color.
144+
Color get secondaryButtonColor =>
145+
Color.lerp(const Color(0xFFF4F4F5), appStyleButtonColor, 0.12)!;
146+
143147
AppColorPalette copyWith({
144148
AppColorSchemeKey? key,
145149
String? displayName,
@@ -450,6 +454,7 @@ class AppColors {
450454
//button colors
451455

452456
static Color get appStyleButtonColor => palette.appStyleButtonColor;
457+
static Color get secondaryButtonColor => palette.secondaryButtonColor;
453458
static Color get successButtonColor => palette.successButtonColor;
454459
static Color get warningButtonColor => palette.warningButtonColor;
455460
static Color get dangerButtonColor => palette.dangerButtonColor;

school_data_hub_flutter/lib/common/widgets/bottom_nav_bar/bottom_nav_bar_layouts.dart

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,21 @@ class BottomNavBarProfileLayout extends StatelessWidget {
4343
Widget build(BuildContext context) {
4444
return Padding(
4545
padding: Platform.isWindows
46-
? const EdgeInsets.only(left: 0, right: 0, bottom: 10)
47-
: const EdgeInsets.only(left: 0, right: 0),
48-
child: SizedBox(
49-
height: Platform.isWindows
50-
? kBottomNavigationBarHeight + 20
51-
: kBottomNavigationBarHeight + 30,
52-
child: Align(
53-
alignment: Alignment.bottomCenter,
54-
child: ConstrainedBox(
55-
constraints: const BoxConstraints(maxWidth: 800),
56-
child: ClipRRect(
57-
borderRadius: const BorderRadius.only(
58-
bottomLeft: Radius.circular(10),
59-
bottomRight: Radius.circular(10),
60-
),
61-
child: Theme(
62-
data: ThemeData(canvasColor: AppColors.backgroundColor),
63-
child: bottomNavBar,
64-
),
46+
? const EdgeInsets.only(bottom: 10)
47+
: EdgeInsets.zero,
48+
child: Align(
49+
alignment: Alignment.bottomCenter,
50+
heightFactor: 1,
51+
child: ConstrainedBox(
52+
constraints: const BoxConstraints(maxWidth: 800),
53+
child: ClipRRect(
54+
borderRadius: const BorderRadius.only(
55+
bottomLeft: Radius.circular(10),
56+
bottomRight: Radius.circular(10),
57+
),
58+
child: Theme(
59+
data: ThemeData(canvasColor: AppColors.backgroundColor),
60+
child: bottomNavBar,
6561
),
6662
),
6763
),

school_data_hub_flutter/lib/common/widgets/dialogs/pupil_list_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:school_data_hub_flutter/common/theme/app_colors.dart';
33
import 'package:school_data_hub_flutter/common/widgets/generic_components/generic_app_bar.dart';
44
import 'package:school_data_hub_flutter/common/widgets/generic_components/generic_sliver_list.dart';
55
import 'package:school_data_hub_flutter/features/_pupil/domain/models/pupil_proxy.dart';
6-
import 'package:school_data_hub_flutter/features/_pupil/presentation/pupil_profile_page/pupil_profile_page_content/language_content/pupil_language_card.dart';
6+
import 'package:school_data_hub_flutter/features/_pupil/presentation/widgets/pupil_language_card.dart';
77

88
class PupilListDialog extends StatefulWidget {
99
final String title;

school_data_hub_flutter/lib/common/widgets/get_image_cached_or_download.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ Future<Image> cachedPublicImageOrDownloadPublicImage({
7474
notificationService.apiRunning(false);
7575

7676
if (byteData == null) {
77-
notificationService.showSnackBar(
78-
NotificationType.error,
79-
'Fehler beim Laden des Bildes',
80-
);
8177
return Image.asset('assets/dummy-profile-pic.png');
8278
}
8379
Uint8List imageBytes = byteData.buffer.asUint8List();

0 commit comments

Comments
 (0)