Skip to content

Commit

Permalink
Merge pull request #176 from Pavel401/about_page
Browse files Browse the repository at this point in the history
Created About page for TaskWarrior project
  • Loading branch information
Pavel401 authored Sep 6, 2023
2 parents 893f3a4 + 990379e commit e2eda57
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 20 deletions.
1 change: 1 addition & 0 deletions assets/svg/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/svg/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/svg/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>https://ccextractor.org/</string>
<string>https://github.com/CCExtractor/taskwarrior-flutter</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIStatusBarHidden</key>
Expand Down
16 changes: 15 additions & 1 deletion lib/drawer/nav_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/model/storage/storage_widget.dart';
import 'package:taskwarrior/routes/pageroute.dart';
import 'package:taskwarrior/views/about/about.dart';
import 'package:taskwarrior/views/reports/reports_home.dart';

class NavDrawer extends StatefulWidget {
Expand Down Expand Up @@ -104,7 +105,20 @@ class _NavDrawerState extends State<NavDrawer> {
await SelectedTheme.saveMode(AppSettings.isDarkMode);
widget.notifyParent();
},
)
),
ListTile(
tileColor: AppSettings.isDarkMode ? Colors.black : Colors.white,
textColor: AppSettings.isDarkMode ? Colors.white : Colors.black,
leading: Icon(
Icons.info,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => const AboutPage()));
},
title: const Text("About"),
),
],
));
}
Expand Down
31 changes: 17 additions & 14 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:get/get.dart';
import 'package:loggy/loggy.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:sizer/sizer.dart';
import 'package:taskwarrior/controller/WidgetController.dart';
import 'package:uuid/uuid.dart';

Expand Down Expand Up @@ -101,19 +102,21 @@ class _MyAppState extends State<MyApp> {
WidgetController widgetController = Get.put(WidgetController(context));
widgetController.fetchAllData();

return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Taskwarrior',
theme: ThemeData(
useMaterial3: true,
primarySwatch: Palette.kToDark,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
initialRoute: PageRoutes.home,
routes: {
PageRoutes.home: (context) => HomePage(),
PageRoutes.profile: (context) => const ProfilePage(),
},
);
return Sizer(builder: ((context, orientation, deviceType) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Taskwarrior',
theme: ThemeData(
useMaterial3: true,
primarySwatch: Palette.kToDark,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
initialRoute: PageRoutes.home,
routes: {
PageRoutes.home: (context) => HomePage(),
PageRoutes.profile: (context) => const ProfilePage(),
},
);
}));
}
}
263 changes: 263 additions & 0 deletions lib/views/about/about.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:sizer/sizer.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/widgets/pallete.dart';
import 'package:url_launcher/url_launcher.dart';

class AboutPage extends StatefulWidget {
const AboutPage({Key? key}) : super(key: key);
@override
// ignore: library_private_types_in_public_api
_AboutPageState createState() => _AboutPageState();
}

class _AboutPageState extends State<AboutPage> {
String introduction =
"This project aims to build an app for Taskwarrior. It is your task management app across all platforms. It helps you manage your tasks and filter them as per your needs.";

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
backgroundColor: Palette.kToDark.shade200,
title: const Text(
'About',
style: TextStyle(color: Colors.white),
),
leading: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Icon(
Icons.chevron_left,
color: Appcolors.white,
),
),
),
backgroundColor:
AppSettings.isDarkMode ? Palette.kToDark.shade200 : Colors.white,
body: Padding(
padding: EdgeInsets.only(top: 1.h, left: 2.w, right: 2.w),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
child: SvgPicture.asset(
"assets/svg/logo.svg",
height: 20.h,
width: 100.w,
)),
SizedBox(
height: 2.h,
),
Text(
"Taskwarrior",
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 18,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
SizedBox(
height: 2.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FutureBuilder<String>(
future: getAppInfo(),
builder:
(BuildContext context, AsyncSnapshot<String> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
return const CircularProgressIndicator();
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
final appInfoLines = snapshot.data!.split(' ');

return Column(
children: [
RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'Version: ',
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
TextSpan(
text: appInfoLines[1],
style: GoogleFonts.firaMono(
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
],
),
),
RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'Package: ',
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
TextSpan(
text: appInfoLines[0],
style: GoogleFonts.firaMono(
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
],
),
),
],
);
}
},
),
],
),
SizedBox(
height: 5.h,
),
Text(
introduction,
textAlign: TextAlign.center,
style: GoogleFonts.firaMono(
fontWeight: FontWeight.w500,
fontSize: 12,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
SizedBox(
height: 6.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(
width: 40.w,
height: 5.h,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: AppSettings.isDarkMode
? const Color.fromARGB(255, 220, 216, 216)
: const Color.fromARGB(255, 48, 46, 46),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: () async {
// Launch GitHub URL.

String url =
"https://github.com/CCExtractor/taskwarrior-flutter";
if (!await launchUrl(Uri.parse(url))) {
throw Exception('Could not launch $url');
}
},
icon: SvgPicture.asset(
"assets/svg/github.svg",
width: 15.sp,
height: 15.sp,
),
label: Text(
"GitHub",
style: GoogleFonts.firaMono(
fontWeight: FontWeight.w500,
fontSize: 12,
color: AppSettings.isDarkMode
? Colors.black
: Colors.white,
),
),
),
),
SizedBox(
width: 40.w,
height: 5.h,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: AppSettings.isDarkMode
? const Color.fromARGB(255, 220, 216, 216)
: const Color.fromARGB(255, 48, 46, 46),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
onPressed: () async {
String url = "https://ccextractor.org/";
if (!await launchUrl(Uri.parse(url))) {
throw Exception('Could not launch $url');
}
},
icon: SvgPicture.asset(
"assets/svg/link.svg",
width: 15.sp,
height: 15.sp,
),
label: Text(
"CCExtractor",
style: GoogleFonts.firaMono(
fontWeight: FontWeight.w500,
fontSize: 12,
color: AppSettings.isDarkMode
? Colors.black
: Colors.white,
),
),
),
),
],
),
SizedBox(
height: 2.h,
),
Text(
"Eager to enhance this project? Visit our GitHub repository.",
textAlign: TextAlign.center,
style: GoogleFonts.firaMono(
fontWeight: FontWeight.w600,
fontSize: 12,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
SizedBox(
height: 2.h,
),
],
),
),
),
);
}
}

Future<String> getAppInfo() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();

return '${packageInfo.packageName} ${packageInfo.version}';
}
2 changes: 1 addition & 1 deletion lib/views/profile/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _ProfilePageState extends State<ProfilePage> {

return Scaffold(
appBar: AppBar(
backgroundColor: Palette.kToDark,
backgroundColor: Palette.kToDark.shade200,
title: const Text(
'Profiles',
style: TextStyle(color: Colors.white),
Expand Down
3 changes: 2 additions & 1 deletion lib/views/reports/reports_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class _ReportsHomeState extends State<ReportsHome>
),
),
),
backgroundColor: AppSettings.isDarkMode ? Colors.black : Colors.white,
backgroundColor:
AppSettings.isDarkMode ? Palette.kToDark.shade200 : Colors.white,
body: allData.isEmpty
? Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
Loading

0 comments on commit e2eda57

Please sign in to comment.