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

Created a home page when entering to the app #181

Merged
merged 2 commits into from
Oct 17, 2024
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
1,760 changes: 1,760 additions & 0 deletions assets/images/brain.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
401 changes: 401 additions & 0 deletions assets/images/light_bulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"break": "Take a break",
"new_session": "Press to start a new session",
"work_ended": "You have completed the Work session, take a break",
"break_ended": "Break ended, enter the app to continue to the next session"
"break_ended": "Break ended, enter the app to continue to the next session",
"home_page": "Home Page"
}
2 changes: 1 addition & 1 deletion ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MyApp extends StatelessWidget {
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
home: IntroPage(),
home: HomePage(),
);
}
}
45 changes: 26 additions & 19 deletions lib/presentation/atoms/card_atom.dart
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:infinite_horizons/presentation/core/theme_data.dart';

class CardAtom extends StatelessWidget {
const CardAtom({required this.child, this.image, this.imageColor});
const CardAtom({required this.child, this.onClick, this.image});

final Widget child;
final Image? image;
final Color? imageColor;
final SvgPicture? image;
final VoidCallback? onClick;

@override
Widget build(BuildContext context) {
return Card.filled(
margin: EdgeInsets.zero,
clipBehavior: Clip.hardEdge,
child: Column(
children: [
if (image != null)
Container(
height: 250,
width: double.infinity,
color: imageColor,
child: image,
return GestureDetector(
onTap: onClick,
child: Card.filled(
margin: EdgeInsets.zero,
clipBehavior: Clip.hardEdge,
child: Column(
children: [
if (image != null)
ClipRRect(
borderRadius:
const BorderRadius.vertical(bottom: Radius.circular(15)),
child: SizedBox(
height: 170,
width: double.infinity,
child: image,
),
),
Padding(
padding: const EdgeInsets.all(AppThemeData.generalSpacing),
child: child,
),
Padding(
padding: const EdgeInsets.all(AppThemeData.generalSpacing),
child: child,
),
],
],
),
),
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/presentation/molecules/molecules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ export 'package:infinite_horizons/presentation/molecules/timer_molecule.dart';
export 'package:infinite_horizons/presentation/molecules/toggle_switch_tile_molecule.dart';
export 'package:infinite_horizons/presentation/molecules/top_bar_molecule.dart';
export 'package:infinite_horizons/presentation/molecules/web_view_molecule.dart';
export 'package:infinite_horizons/presentation/molecules/work_type_selection_molecule.dart';
export 'package:infinite_horizons/presentation/molecules/youtube_player_molecule.dart';
3 changes: 2 additions & 1 deletion lib/presentation/molecules/page_enclosure_molecule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PageEnclosureMolecule extends StatelessWidget {

Widget topBarHelper() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TopBarMolecule(
topBarType: topBarType,
Expand All @@ -46,7 +47,7 @@ class PageEnclosureMolecule extends StatelessWidget {
subTitle!,
variant: TextVariant.smallTitle,
),
if (topMargin) const SeparatorAtom(variant: SeparatorVariant.farApart),
if (topMargin) const SeparatorAtom(),
Expanded(
child: child,
),
Expand Down
3 changes: 0 additions & 3 deletions lib/presentation/molecules/top_bar_molecule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class TopBarMolecule extends StatelessWidget {
const SizedBox(height: 15),
Row(
children: [
const Expanded(
child: SizedBox(),
),
TextAtom(
title ?? '',
variant: TextVariant.title,
Expand Down
174 changes: 0 additions & 174 deletions lib/presentation/molecules/work_type_selection_molecule.dart

This file was deleted.

70 changes: 0 additions & 70 deletions lib/presentation/organisms/intro/welcome_organism.dart

This file was deleted.

3 changes: 1 addition & 2 deletions lib/presentation/organisms/organisms.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export 'package:infinite_horizons/presentation/organisms/intro/tips_organism.dart';
export 'package:infinite_horizons/presentation/organisms/intro/welcome_organism.dart';
export 'package:infinite_horizons/presentation/organisms/permissions_organism.dart';
export 'package:infinite_horizons/presentation/organisms/ready_for_session_organism.dart';
export 'package:infinite_horizons/presentation/organisms/text_area_organism.dart';
export 'package:infinite_horizons/presentation/organisms/timer_organism.dart';
export 'package:infinite_horizons/presentation/organisms/tips_organism.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:universal_io/io.dart';
class TipsOrganism extends StatefulWidget {
const TipsOrganism(this.workType);

final String workType;
final TipType workType;

@override
State<TipsOrganism> createState() => _TipsOrganismState();
Expand Down Expand Up @@ -90,7 +90,7 @@ class _TipsOrganismState extends State<TipsOrganism> {

return PageEnclosureMolecule(
scaffold: false,
title: 'efficient_tips'.tr(args: [widget.workType.tr()]),
title: 'efficient_tips'.tr(args: [widget.workType.name.tr()]),
subTitle: 'Select each element when complete',
topBarTranslate: false,
child: isDnd == null || !didPulledWakeTime
Expand Down
Loading
Loading