Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/123-replace-all-text-widgets-in-the-app-with-jhdisplaytext #126

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fvm/flutter_sdk
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ deploy:
# This command will clean, delete .dart_tool and generate
# classes.
generate:
fvm flutter packages pub run build_runner build --delete-conflicting-outputs
fvm flutter packages pub run build_runner build --delete-conflicting-outputs

#This command runs fastlane
release:
Expand Down
8 changes: 4 additions & 4 deletions lib/app/pages/child_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class _ChildDetailsPageState extends State<ChildDetailsPage> {
SliverAppBar(
title: JHDisplayText(
text: model.name,
fontSize: 22,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.normal,
color: CustomColors.indigoLight,
),
Expand Down Expand Up @@ -142,10 +142,10 @@ class _ChildDetailsPageState extends State<ChildDetailsPage> {
"Enter this code on child's device:\n${model.id}",
);
},
child: Text(
model.id,
child: JHDisplayText(
text: model.id,
fontSize: 32,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Colors.deepOrangeAccent,
),
Expand Down
43 changes: 26 additions & 17 deletions lib/app/pages/child_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import 'package:parental_control/services/app_usage_service.dart';
import 'package:parental_control/services/database.dart';
import 'package:provider/provider.dart';

import '../../common_widgets/jh_display_text.dart';

class ChildPage extends StatefulWidget {
final Database? database;
final ChildModel? child;
Expand Down Expand Up @@ -81,8 +83,8 @@ class _ChildPageState extends State<ChildPage> {
radius: 45,
),
SizedBox(height: 6),
Text(
'${widget.child!.name} ',
JHDisplayText(
text: '${widget.child!.name} ',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w800,
Expand All @@ -91,8 +93,8 @@ class _ChildPageState extends State<ChildPage> {
SizedBox(height: 12),
Row(
children: [
Text(
'${widget.child!.email} ',
JHDisplayText(
text: '${widget.child!.email} ',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w800,
Expand All @@ -101,8 +103,8 @@ class _ChildPageState extends State<ChildPage> {
],
),
SizedBox(height: 6),
Text(
'${widget.child!.id} ',
JHDisplayText(
text: '${widget.child!.id} ',
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w800,
Expand Down Expand Up @@ -154,8 +156,8 @@ class _ChildPageState extends State<ChildPage> {
)
],
backgroundColor: Colors.white,
title: Text(
'Child',
title: JHDisplayText(
text: 'Child',
style: TextStyle(color: Colors.indigo),
),
iconTheme: IconThemeData(color: Colors.indigo),
Expand Down Expand Up @@ -192,8 +194,8 @@ class _ChildPageState extends State<ChildPage> {

Widget _buildInitialInput(BuildContext context) {
return Center(
child: Text(
'Child Page',
child: JHDisplayText(
text: 'Child Page',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
Expand Down Expand Up @@ -225,9 +227,16 @@ class _ChildPageState extends State<ChildPage> {
child: Padding(
padding: EdgeInsets.all(8.0),
child: ListTile(
title: Text(data[index].title ?? 'No title available'),
trailing: Text(
data[index].message ?? 'No message available',
title: JHDisplayText(
text: data[index].title ?? 'No title available',
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.white,
fontSize: 16,
),
),
trailing: JHDisplayText(
text: data[index].message ?? 'No message available',
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.white,
Expand Down Expand Up @@ -258,12 +267,12 @@ class _ChildPageState extends State<ChildPage> {
itemCount: appUsage.info.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(
appUsage.info[index].appName,
title: JHDisplayText(
text: appUsage.info[index].appName,
style: TextStyle(fontSize: 15),
),
trailing: Text(
appUsage.info[index].usage.toString().t(),
trailing: JHDisplayText(
text: appUsage.info[index].usage.toString().t(),
style: TextStyle(fontSize: 14, color: Colors.indigo),
),
);
Expand Down
15 changes: 10 additions & 5 deletions lib/app/pages/edit_child_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import 'package:parental_control/services/database.dart';
import 'package:path/path.dart' as path;
import 'package:uuid/uuid.dart';

import '../../common_widgets/jh_display_text.dart';

enum AppState { loading, complete }

class EditChildPage extends StatefulWidget {
Expand Down Expand Up @@ -158,16 +160,19 @@ class _EditChildPageState extends State<EditChildPage> {
backgroundColor: Colors.grey[200],
appBar: AppBar(
elevation: 2.0,
title: Text(widget.model == null ? 'New Child' : 'Edit Child'),
title: JHDisplayText(
text: widget.model == null ? 'New Child' : 'Edit Child',
style: TextStyle(fontSize: 15),
),
centerTitle: true,
actions: [
GestureDetector(
onTap: () async => await _submit(_imageFile),
child: Align(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Save',
child: JHDisplayText(
text: 'Save',
style: TextStyle(fontSize: 18, color: Colors.white),
),
),
Expand Down Expand Up @@ -232,8 +237,8 @@ class _EditChildPageState extends State<EditChildPage> {
),
),
onPressed: () => _getLocalImage(),
child: Text(
'add picture',
child: JHDisplayText(
text: 'add picture',
style: TextStyle(color: Colors.white),
),
),
Expand Down
16 changes: 12 additions & 4 deletions lib/app/pages/notification_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import 'package:parental_control/services/notification_service.dart';
import 'package:parental_control/theme/theme.dart';
import 'package:provider/provider.dart';

import '../../common_widgets/jh_display_text.dart';

enum AppState { Loaded, Empty }

class NotificationPage extends StatefulWidget {
Expand Down Expand Up @@ -117,11 +119,17 @@ class _NotificationPageState extends State<NotificationPage> {
child: Padding(
padding: EdgeInsets.all(8.0),
child: ListTile(
title: Text(
data[index].title ?? 'No title available',
title: JHDisplayText(
text: data[index].title ?? 'No title available',
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.white,
fontSize: 16,
),
),
trailing: Text(
data[index].message ?? 'No message available',
trailing: JHDisplayText(
text:
data[index].message ?? 'No message available',
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.white,
Expand Down
9 changes: 5 additions & 4 deletions lib/app/pages/setting_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:line_awesome_flutter/line_awesome_flutter.dart';
import 'package:parental_control/common_widgets/jh_display_text.dart';
import 'package:parental_control/common_widgets/show_alert_dialog.dart';
import 'package:parental_control/common_widgets/show_logger.dart';
import 'package:parental_control/services/auth.dart';
Expand Down Expand Up @@ -116,8 +117,8 @@ class SettingsPage extends StatelessWidget {
icon: Icon(Icons.contact_support_sharp),
onPressed: () {},
),
title: Text(
'Copyright© JordyHers',
title: JHDisplayText(
text: 'Copyright© JordyHers',
style:
TextStyle(color: CustomColors.indigoDark, fontSize: 12),
),
Expand Down Expand Up @@ -166,8 +167,8 @@ class ProfileListItem extends StatelessWidget {
size: 25,
),
SizedBox(width: 15),
Text(
text ?? '',
JHDisplayText(
text: text ?? '',
style: TextStyles.body,
),
Spacer(),
Expand Down
26 changes: 14 additions & 12 deletions lib/common_widgets/jh_bar_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:parental_control/theme/theme.dart';

import 'jh_display_text.dart';

class JHAppUsageChart extends StatefulWidget {
final List<Color> availableColors = const [
Colors.purpleAccent,
Expand Down Expand Up @@ -46,8 +48,8 @@ class JHAppUsageChartState extends State<JHAppUsageChart> {
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Text(
'Week Report',
JHDisplayText(
text: 'Week Report',
style: TextStyle(
color: Colors.white,
fontSize: 15,
Expand All @@ -57,8 +59,8 @@ class JHAppUsageChartState extends State<JHAppUsageChart> {
const SizedBox(
height: 4,
),
Text(
'App Usage Graph',
JHDisplayText(
text:'App Usage Graph',
style: TextStyle(
color: CustomColors.indigoDark,
fontSize: 12,
Expand Down Expand Up @@ -288,28 +290,28 @@ class JHAppUsageChartState extends State<JHAppUsageChart> {
Widget text;
switch (value.toInt()) {
case 0:
text = const Text('M', style: style);
text = JHDisplayText(text: 'M', style: style);
break;
case 1:
text = const Text('T', style: style);
text = JHDisplayText(text: 'T', style: style);
break;
case 2:
text = const Text('W', style: style);
text = JHDisplayText(text: 'W', style: style);
break;
case 3:
text = const Text('T', style: style);
text = JHDisplayText(text: 'T', style: style);
break;
case 4:
text = const Text('F', style: style);
text = JHDisplayText(text: 'F', style: style);
break;
case 5:
text = const Text('S', style: style);
text = JHDisplayText(text: 'S', style: style);
break;
case 6:
text = const Text('S', style: style);
text = JHDisplayText(text: 'S', style: style);
break;
default:
text = const Text('', style: style);
text = JHDisplayText(text:'', style: style);
break;
}
return Padding(padding: const EdgeInsets.only(top: 16), child: text);
Expand Down
5 changes: 3 additions & 2 deletions lib/common_widgets/jh_custom_button.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:parental_control/common_widgets/jh_display_text.dart';
import 'package:parental_control/common_widgets/jh_size_config.dart';
import 'package:parental_control/theme/theme.dart';

Expand Down Expand Up @@ -31,8 +32,8 @@ class JHCustomButton extends StatelessWidget {
),
),
onPressed: onPress,
child: Text(
title,
child: JHDisplayText(
text: title,
style: TextStyle(
fontSize: getProportionateScreenWidth(13),
color: textColor,
Expand Down
10 changes: 6 additions & 4 deletions lib/common_widgets/jh_empty_content.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';

import 'jh_display_text.dart';

class JHEmptyContent extends StatelessWidget {
const JHEmptyContent({
Key? key,
Expand All @@ -25,15 +27,15 @@ class JHEmptyContent extends StatelessWidget {
if (child != null)
child!
else
Text(
title!,
JHDisplayText(
text: title!,
style: TextStyle(
fontSize: fontSizeTitle,
color: Colors.black54,
),
),
Text(
message,
JHDisplayText(
text: message,
style: TextStyle(
fontSize: fontSizeMessage,
color: Colors.black54,
Expand Down
6 changes: 4 additions & 2 deletions lib/common_widgets/jh_feature_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:parental_control/theme/theme.dart';

import 'jh_display_text.dart';

class JHFeatureWidget extends StatelessWidget {
final String? title;
final Widget? child;
Expand Down Expand Up @@ -33,8 +35,8 @@ class JHFeatureWidget extends StatelessWidget {
SizedBox(width: 10),
if (child != null) child ?? SizedBox.shrink(),
title != null
? Text(
title!,
? JHDisplayText(
text: title!,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w800,
Expand Down
5 changes: 3 additions & 2 deletions lib/common_widgets/jh_form_submit_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import 'package:flutter/material.dart';
import 'package:parental_control/theme/theme.dart';

import 'jh_custom_raised_button.dart';
import 'jh_display_text.dart';

class FormSubmitButton extends JHCustomRaisedButton {
FormSubmitButton({
required String text,
required VoidCallback onPressed,
Color? color,
}) : super(
child:
Text(text, style: TextStyle(color: Colors.white, fontSize: 20)),
child: JHDisplayText(
text: text, style: TextStyle(color: Colors.white, fontSize: 20),),
height: 44.0,
color: color ?? CustomColors.indigoDark,
borderRadius: 4.0,
Expand Down
Loading