Skip to content

Commit

Permalink
Upgrade to Material 3 (#1249)
Browse files Browse the repository at this point in the history
Closes #1159
  • Loading branch information
nilsreichardt authored Jan 16, 2024
1 parent 1b27cd8 commit b6a315e
Show file tree
Hide file tree
Showing 240 changed files with 276 additions and 240 deletions.
7 changes: 4 additions & 3 deletions app/lib/auth/login_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ContinueRoundButton extends StatelessWidget {
child: IconButton(
tooltip: tooltip,
icon: Stack(
alignment: Alignment.center,
children: <Widget>[
AnimatedSwitcher(
duration: const Duration(milliseconds: 250),
Expand All @@ -41,9 +42,9 @@ class ContinueRoundButton extends StatelessWidget {
),
),
),
const Align(
alignment: Alignment.center,
child: Icon(Icons.chevron_right, color: Colors.white),
const Icon(
Icons.chevron_right,
color: Colors.white,
)
],
),
Expand Down
13 changes: 11 additions & 2 deletions app/lib/blackboard/blackboard_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ class _TitleField extends StatelessWidget {
child: StreamBuilder<String>(
stream: bloc.title,
builder: (context, snapshot) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
padding: const EdgeInsets.symmetric(horizontal: 20)
.add(const EdgeInsets.only(top: 8)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand All @@ -345,11 +346,19 @@ class _TitleField extends StatelessWidget {
focusNode: focusNode,
cursorColor: Colors.white,
maxLines: null,
style: const TextStyle(color: Colors.white, fontSize: 20.0),
style: const TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.w400,
),
decoration: const InputDecoration(
hintText: "Titel eingeben",
hintStyle: TextStyle(color: Colors.white),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
contentPadding: EdgeInsets.zero,
fillColor: Colors.transparent,
),
onChanged: (String title) => bloc.changeTitle(title),
textCapitalization: TextCapitalization.sentences,
Expand Down
44 changes: 25 additions & 19 deletions app/lib/groups/group_join/widgets/group_join_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ class _GroupJoinTextFieldState extends State<GroupJoinTextField> {
child: Theme(
data: Theme.of(context).copyWith(
primaryColor: Colors.white,
colorScheme:
ColorScheme.fromSwatch().copyWith(secondary: Colors.white),
colorScheme: Theme.of(context).isDarkTheme
? null
: ColorScheme.fromSwatch()
.copyWith(secondary: Colors.white),
),
child: TextField(
maxLength: 6,
Expand All @@ -75,26 +77,30 @@ class _GroupJoinTextFieldState extends State<GroupJoinTextField> {
},
cursorColor: Colors.white,
decoration: InputDecoration(
border: const OutlineInputBorder(),
labelText: 'Sharecode',
hintText: "z.B. Qb32vF",
suffixIcon: IconButton(
tooltip: 'QR-Code scannen',
onPressed: () async {
hideKeyboard(context: context);
final qrCode = await _scanQRCode();
if (_isValidQrCode(qrCode)) {
bloc.enterValue(qrCode);
final groupJoinResultDialog =
GroupJoinResultDialog(bloc);
if (context.mounted) {
groupJoinResultDialog.show(context);
suffixIcon: Padding(
padding: const EdgeInsets.only(right: 6),
child: IconButton(
tooltip: 'QR-Code scannen',
iconSize: 48,
onPressed: () async {
hideKeyboard(context: context);
final qrCode = await _scanQRCode();
if (_isValidQrCode(qrCode)) {
bloc.enterValue(qrCode);
final groupJoinResultDialog =
GroupJoinResultDialog(bloc);
if (context.mounted) {
groupJoinResultDialog.show(context);
}
}
}
},
icon: PlatformSvg.asset(
"assets/icons/qr-code.svg",
color: Colors.white,
},
icon: PlatformSvg.asset(
"assets/icons/qr-code.svg",
color: Colors.white,
width: 32,
),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion app/lib/groups/src/pages/course/course_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class CourseCardRedesign extends StatelessWidget {
color: Theme.of(context).isDarkTheme
? Colors.lightBlue[100]
: darkBlueColor,
fontSize: 18,
fontSize: 17,
fontWeight: FontWeight.w500,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ class _CourseEditPage extends StatelessWidget {
children: <Widget>[
_SubjectField(
initialSubject: course.subject, nextNode: abbreviationNode),
const SizedBox(height: 28),
_AbbreviationField(
initialAbbreviation: course.abbreviation,
nextNode: courseNameNode),
const SizedBox(height: 12),
_CourseNameField(initialCourseName: course.name),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ class _CourseCreatePageState extends State<_CourseCreatePage> {
_Subject(
subject: widget.course?.subject,
nextFocusNode: abbreviationNode),
const SizedBox(height: 28),
_Abbreviation(
abbreviation: widget.course?.abbreviation,
focusNode: abbreviationNode,
nextFocusNode: nameNode),
const SizedBox(height: 12),
_CourseName(focusNode: nameNode),
],
),
Expand Down
6 changes: 5 additions & 1 deletion app/lib/groups/src/widgets/group_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ class ShareGroupSection extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24),
child: Text(
"Verschicke einfach den Link zum Beitreten über eine beliebige App oder zeige den QR-Code an, damit deine Mitschüler & Lehrer diesen abscannen können 👍🚀",
style: TextStyle(fontSize: 16, color: Colors.grey[600]),
style: TextStyle(
fontSize: 16,
color: Theme.of(context).isDarkTheme
? Colors.grey[400]
: Colors.grey[600]),
textAlign: TextAlign.center,
),
),
Expand Down
21 changes: 17 additions & 4 deletions app/lib/homework/homework_dialog/homework_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class _MobileDivider extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (PlatformCheck.isDesktopOrWeb) return Container();
if (PlatformCheck.isDesktopOrWeb) return const SizedBox(height: 4);
return const Divider(height: 0);
}
}
Expand Down Expand Up @@ -399,7 +399,7 @@ class _TodoUntilPicker extends StatelessWidget {
),
if (showLessonChips)
const Padding(
padding: EdgeInsets.only(left: 3.0),
padding: EdgeInsets.only(top: 4, left: 3.0),
child: _DueDateChips(
initialChips: IListConst([
DueDateSelection.nextSchoolday,
Expand Down Expand Up @@ -840,7 +840,8 @@ class _TitleFieldBase extends StatelessWidget {
),
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
padding: const EdgeInsets.symmetric(horizontal: 20)
.add(const EdgeInsets.only(top: 8)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand All @@ -850,11 +851,19 @@ class _TitleFieldBase extends StatelessWidget {
focusNode: focusNode,
cursorColor: Colors.white,
maxLines: null,
style: const TextStyle(color: Colors.white, fontSize: 22),
style: const TextStyle(
color: Colors.white,
fontSize: 22,
fontWeight: FontWeight.w400,
),
decoration: const InputDecoration(
hintText: "Titel eingeben (z.B. AB Nr. 1 - 3)",
hintStyle: TextStyle(color: Colors.white),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
contentPadding: EdgeInsets.zero,
fillColor: Colors.transparent,
),
onChanged: onChanged,
textCapitalization: TextCapitalization.sentences,
Expand Down Expand Up @@ -1013,6 +1022,10 @@ class _DescriptionFieldBase extends StatelessWidget {
decoration: const InputDecoration(
hintText: "Zusatzinformationen eingeben",
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
errorBorder: InputBorder.none,
fillColor: Colors.transparent,
),
onChanged: onChanged,
textCapitalization: TextCapitalization.sentences,
Expand Down
21 changes: 9 additions & 12 deletions app/lib/homework/shared/homework_tile_template.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,17 @@ class HomeworkTileTemplate extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4.0),
child: CustomCard(
child: ListTile(
minVerticalPadding: 4,
dense: true,
title: Padding(
padding: const EdgeInsets.only(top: 4),
child: Text(
title,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: Theme.of(context)
.textTheme
.bodyLarge!
.apply(fontSizeFactor: 1.1),
),
title: Text(
title,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: Theme.of(context)
.textTheme
.bodyLarge!
.apply(fontSizeFactor: 1.1),
),
isThreeLine: true,
subtitle: Padding(
padding: const EdgeInsets.only(bottom: 6),
child: Text.rich(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class _MarkOverdueHomeworkPromptState extends State<MarkOverdueHomeworkPrompt> {
cache.setAlreadyDismissed(true);
},
),
ElevatedButton(
child: const Text("Abhaken"),
FilledButton(
onPressed: () {
analytics.log(_OverdueAnalyticsEvent.confirmed());
bloc.add(CompletedAllOverdue());
},
child: const Text("Abhaken"),
)
],
),
Expand Down
56 changes: 25 additions & 31 deletions app/lib/navigation/drawer/drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class SharezoneDrawer extends StatelessWidget {
bloc: SharezoneDrawerController(isDesktopModus),
child: Drawer(
semanticLabel: 'Navigation öffnen',
// No border
shape: const Border(),
child: _DrawerItems(isDesktopModus: isDesktopModus),
),
);
Expand Down Expand Up @@ -69,44 +71,36 @@ class _DrawerItems extends StatelessWidget {
Widget build(BuildContext context) {
final isSubscriptionEnabled =
context.watch<SubscriptionEnabledFlag>().isEnabled;
return Material(
color: getDrawerBackgroundColor(context),
child: SafeArea(
right: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_AccountSection(isDesktopModus: isDesktopModus),
return SafeArea(
right: false,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_AccountSection(isDesktopModus: isDesktopModus),
const Divider(),
if (isDesktopModus) ...[
...onlyDesktopTiles,
const Divider(),
if (isDesktopModus) ...[
...onlyDesktopTiles,
const Divider(),
],
...functionTiles,
const Divider(),
if (isSubscriptionEnabled) sharezonePlusTile,
feedbackBoxTile,
settingsPageTile,
],
),
...functionTiles,
const Divider(),
if (isSubscriptionEnabled) sharezonePlusTile,
feedbackBoxTile,
settingsPageTile,
],
),
),
const _SharezoneLogo(),
],
),
),
const _SharezoneLogo(),
],
),
);
}

Color? getDrawerBackgroundColor(BuildContext context) {
if (!isDesktopModus || Theme.of(context).isDarkTheme) return null;
return const Color(0xFFF4F5F7);
}
}

/// Displays the sharezone logo and navigate to the about page, if use taps on it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BnbAndDrawerBottomNavigationBar extends StatelessWidget {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Divider(height: 0, color: Colors.grey[400]),
Divider(height: 0, color: Colors.grey[400], thickness: 0.5),
_BottomNavBarWithNonSelectionAllowed(
safeArea: true,
currentItem: navigationItem,
Expand Down Expand Up @@ -228,25 +228,22 @@ class _BottomNavBarWithNonSelectionAllowed extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Material(
color: backgroundColor,
child: SafeArea(
bottom: safeArea,
top: safeArea,
left: safeArea,
right: safeArea,
child: Row(
children: <Widget>[
const SizedBox(width: 4),
for (final item in items)
_BottomNavItem(
item: item,
isSelected: item == currentItem,
onMoreButtonTapped: onMoreButtonTapped,
onNavigationItemSelected: onNavigationItemSelected,
),
],
),
return SafeArea(
bottom: safeArea,
top: safeArea,
left: safeArea,
right: safeArea,
child: Row(
children: <Widget>[
const SizedBox(width: 4),
for (final item in items)
_BottomNavItem(
item: item,
isSelected: item == currentItem,
onMoreButtonTapped: onMoreButtonTapped,
onNavigationItemSelected: onNavigationItemSelected,
),
],
),
);
}
Expand Down
Loading

0 comments on commit b6a315e

Please sign in to comment.