-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
CourseTileBase
to sharezone_widgets
.
- Loading branch information
1 parent
83a1438
commit 31818ec
Showing
3 changed files
with
33 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
lib/sharezone_widgets/lib/src/creation_editing_dialogs/course_tile_base.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CourseTileBase extends StatelessWidget { | ||
final String? courseName; | ||
final String? errorText; | ||
|
||
/// If null disables tile. | ||
final VoidCallback? onTap; | ||
|
||
const CourseTileBase({ | ||
required this.courseName, | ||
required this.errorText, | ||
required this.onTap, | ||
super.key, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ListTile( | ||
leading: const Icon(Icons.book), | ||
title: const Text("Kurs"), | ||
subtitle: Text( | ||
errorText ?? courseName ?? "Keinen Kurs ausgewählt", | ||
style: errorText != null ? const TextStyle(color: Colors.red) : null, | ||
), | ||
trailing: const Icon(Icons.keyboard_arrow_down), | ||
enabled: onTap != null, | ||
onTap: () => onTap!(), | ||
); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
lib/sharezone_widgets/lib/src/creation_editing_dialogs/creation_editing_dialogs.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export 'course_tile_base.dart'; | ||
export 'description_field_base.dart'; | ||
export 'markdown_support.dart'; |