Skip to content

Commit

Permalink
Merge pull request #308 from RishavKumarSinha/fix#Learningpath
Browse files Browse the repository at this point in the history
Learning Path Added
  • Loading branch information
andoriyaprashant authored Aug 10, 2024
2 parents 616aef0 + 1262884 commit f9dcd78
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:opso/ChatBotpage.dart';
import 'package:opso/learning_path.dart';
import 'package:opso/opso_timeline.dart';
import 'package:opso/programs%20screen/fossasia.dart';
import 'package:opso/programs%20screen/girl_script.dart';
Expand Down Expand Up @@ -281,6 +282,18 @@ class _HomePageState extends State<HomePage> {
},
),
const SizedBox(height: 15),
ListTile(
leading: const Icon(FontAwesomeIcons.code),
title: const Text('GitHub Workflow'),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
LearningPathPage()));
},
),
const SizedBox(height: 15),
ListTile(
leading: Transform.rotate(
angle: 90 * math.pi / 180,
Expand Down
120 changes: 120 additions & 0 deletions lib/learning_path.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import 'package:flutter/material.dart';
import 'package:timeline_tile/timeline_tile.dart';
import 'package:url_launcher/url_launcher.dart';

class LearningPathPage extends StatelessWidget {
const LearningPathPage({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('GitHub Workflow'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: ListView(
children: [
_buildTimelineItem(
time: 'Step 1',
title: 'Fork the Repository',
description: 'Fork the repository to your GitHub account.',
),
_buildTimelineItem(
time: 'Step 2',
title: 'Clone the Repository',
description: 'Clone your forked repository to your local machine.',
),
_buildTimelineItem(
time: 'Step 3',
title: 'Create a New Branch',
description: 'Create a new branch for your feature or bug fix: git checkout -b feature-name.',
),
_buildTimelineItem(
time: 'Step 4',
title: 'Make Changes',
description: 'Make your changes and ensure that the code follows the Flutter style guide.',
),
_buildTimelineItem(
time: 'Step 5',
title: 'Test Your Changes',
description: 'Test your changes locally to ensure they work as expected.',
),
_buildTimelineItem(
time: 'Step 6',
title: 'Commit Your Changes',
description: 'Commit your changes with descriptive commit messages: git commit -m "Add feature XYZ".',
),
_buildTimelineItem(
time: 'Step 7',
title: 'Push Your Changes',
description: 'Push your changes to your forked repository: git push origin feature-name.',
),
_buildTimelineItem(
time: 'Step 8',
title: 'Create a Pull Request',
description: 'Create a pull request against the main branch of the original repository.',
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: () async {
const url = 'https://goodfirstissue.dev/';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
},
child: const Icon(Icons.rocket_launch_sharp),
),
);
}

Widget _buildTimelineItem({
required String time,
required String title,
required String description,
}) {
return TimelineTile(
alignment: TimelineAlign.start,
indicatorStyle: const IndicatorStyle(
width: 40.0,
color: Colors.orange,
padding: EdgeInsets.all(8.0),
),
endChild: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
time,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.0,
color: Colors.grey,
),
),
const SizedBox(height: 8.0),
Text(
title,
style: const TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4.0),
Text(
description,
style: const TextStyle(fontSize: 16.0),
),
],
),
),
isFirst: time == 'Step 1',
isLast: time == 'Step 8',
);
}
}

0 comments on commit f9dcd78

Please sign in to comment.