Skip to content

Commit

Permalink
add licenses info to settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
smart7even committed Aug 10, 2024
1 parent bd4c752 commit 0b489c5
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 5 deletions.
35 changes: 32 additions & 3 deletions lib/feature/settings/widget/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:uneconly/common/localization/localization.dart';
import 'package:uneconly/common/model/dependencies.dart';
import 'package:uneconly/common/utils/colors_utils.dart';
import 'package:uneconly/feature/settings/widget/settings_tile.dart';

/// Flutter code sample for [CupertinoPicker].
Expand Down Expand Up @@ -186,9 +187,37 @@ class _SettingsPageState extends State<SettingsPage> {
// },
// child: const Text('Open ListSectionInsetExample'),
// ),

Text('${AppLocalizations.of(context)!.theme}: '),
const SizedBox(height: 10),
Column(
mainAxisSize: MainAxisSize.min,
children: [
SettingsTile(
title: AppLocalizations.of(context)!.licenses,
description: AppLocalizations.of(context)!.showLicenses,
onPressed: () {
showLicensePage(
context: context,
);
},
),
],
),
const SizedBox(height: 15),
Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
),
child: Text(
'${AppLocalizations.of(context)!.theme}: ',
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 18,
),
),
),
),
const SizedBox(height: 4),
// horizontal list of themes
Container(
height: 40,
Expand Down
60 changes: 60 additions & 0 deletions lib/feature/settings/widget/settings_tile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import 'package:flutter/material.dart';

/// {@template settings_tile}
/// SettingsTile widget
/// {@endtemplate}
class SettingsTile extends StatelessWidget {
final String title;
final String description;
final VoidCallback onPressed;

/// {@macro settings_tile}
const SettingsTile({
super.key,
required this.title,
required this.description,
required this.onPressed,
});

@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
child: InkWell(
splashFactory: InkRipple.splashFactory,
onTap: onPressed,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Ink(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 18,
),
),
const SizedBox(
height: 4,
),
Text(
description,
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
),
),
],
),
),
),
),
);
}
} // SettingsTile
4 changes: 3 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@
"favoriteGroups": "Favorite groups",
"addFirstFavoriteGroup": "List is empty. Add groups to favorites to access it quickly",
"add": "Add",
"noScheduleDescription": "Swipe left to see the schedule for the next week or right to see the schedule for the previous week"
"noScheduleDescription": "Swipe left to see the schedule for the next week or right to see the schedule for the previous week",
"licenses": "Licenses",
"showLicenses": "View licenses list"
}
4 changes: 3 additions & 1 deletion lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@
"favoriteGroups": "Избранные группы",
"addFirstFavoriteGroup": "Список пуст. Добавляйте группы в избранное, чтобы быстро получать к ним доступ",
"add": "Добавить",
"noScheduleDescription": "Свайпните влево, чтобы посмотреть расписание на следующую неделю, или вправо, чтобы посмотреть на предыдущую"
"noScheduleDescription": "Свайпните влево, чтобы посмотреть расписание на следующую неделю, или вправо, чтобы посмотреть на предыдущую",
"licenses": "Лицензии",
"showLicenses": "Посмотреть список лицензий"
}

0 comments on commit 0b489c5

Please sign in to comment.