-
Notifications
You must be signed in to change notification settings - Fork 14
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
updated task card UI #19
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:ten_thousand_hours/providers/task_list_provider.dart'; | ||
import 'package:ten_thousand_hours/providers/timer_provider.dart'; | ||
import 'package:ten_thousand_hours/view/screens/edit_taskname.dart'; | ||
import 'package:ten_thousand_hours/view/screens/splash_screen.dart'; | ||
import 'package:ten_thousand_hours/view/screens/onboarding_screen.dart'; | ||
import 'view/screens/add_task.dart'; | ||
import 'view/screens/timer_screen.dart'; | ||
import 'view/screens/splash_screen.dart'; | ||
import 'view/screens/home_screen.dart'; | ||
|
||
void main() { | ||
|
||
runApp(MultiProvider( | ||
providers: [ | ||
ChangeNotifierProvider( | ||
create: (context) => TaskListProvider(), | ||
), | ||
ChangeNotifierProvider( | ||
create: (context) => TimerProvider(), | ||
) | ||
], | ||
child: MaterialApp( | ||
title: "10,000 Hours", | ||
initialRoute: SplashScreen.id, | ||
routes: { | ||
SplashScreen.id: (context) => const SplashScreen(), | ||
OnboardingScreen.id: (context) => OnboardingScreen(), | ||
|
||
SplashScreen.id: (context) => SplashScreen(), | ||
EditTaskName.id: (context) => EditTaskName(), | ||
HomeScreen.id: (context) => HomeScreen(), | ||
AddTask.id: (context) => AddTask(), | ||
TaskTimer.id: (context) => const TaskTimer(), | ||
}, | ||
), | ||
)); | ||
} | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:ten_thousand_hours/providers/task_list_provider.dart'; | ||
import 'package:ten_thousand_hours/providers/timer_provider.dart'; | ||
import 'package:ten_thousand_hours/view/screens/edit_taskname.dart'; | ||
import 'package:ten_thousand_hours/view/screens/splash_screen.dart'; | ||
import 'view/screens/add_task.dart'; | ||
import 'view/screens/timer_screen.dart'; | ||
import 'view/screens/home_screen.dart'; | ||
|
||
void main() { | ||
|
||
runApp(MultiProvider( | ||
providers: [ | ||
ChangeNotifierProvider( | ||
create: (context) => TaskListProvider(), | ||
), | ||
ChangeNotifierProvider( | ||
create: (context) => TimerProvider(), | ||
) | ||
], | ||
child: MaterialApp( | ||
title: "10,000 Hours", | ||
initialRoute: splashScreen.id, | ||
routes: { | ||
|
||
splashScreen.id: (context) => splashScreen(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its SplashScreen and not splashScreen , please check the errors , also add the OnbaordingScreen . |
||
EditTaskName.id: (context) => EditTaskName(), | ||
HomeScreen.id: (context) => HomeScreen(), | ||
AddTask.id: (context) => AddTask(), | ||
TaskTimer.id: (context) => const TaskTimer(), | ||
}, | ||
), | ||
)); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,39 +26,40 @@ class HomeScreenView extends StatelessWidget { | |
double width = MediaQuery.of(context).size.width; | ||
double height= MediaQuery.of(context).size.height; | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text("10-000 Hours"), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.fromLTRB(10, 25, 10, 10), | ||
child: Column( | ||
children: [ | ||
Expanded( | ||
child: Consumer<TaskListProvider>( | ||
builder: (context, provider, child) { | ||
if (provider.getTaskList().isEmpty) { | ||
return Container(margin: EdgeInsets.only(top:height/3 ), | ||
child: Text( | ||
"Please press the + button to create a Task", | ||
style: TextStyle(fontSize: width / 21)), | ||
); | ||
} | ||
|
||
appBar: AppBar( | ||
title: const Text("10-000 Hours"), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.fromLTRB(10, 25, 10, 10), | ||
child: Column( | ||
children: [ | ||
|
||
Expanded( | ||
child: Consumer<TaskListProvider>( | ||
builder: (context, provider, child) { | ||
|
||
return ListView.builder( | ||
itemCount: provider.getTaskList().length, | ||
itemBuilder: (BuildContext context, int index) { | ||
return GestureDetector( | ||
onTap: () => Navigator.pushNamed( | ||
context, TaskTimer.id, | ||
arguments: {'index': index}), | ||
child: Container(padding: EdgeInsets.symmetric(vertical: 12),margin: EdgeInsets.only(bottom: 5), | ||
color: Colors.blue.shade100, | ||
child: Center( | ||
child: Text(provider | ||
.getTaskList()[index] | ||
.getTaskName(),style: TextStyle(fontSize: 22)),), | ||
),); | ||
}, | ||
); | ||
|
||
child: TaskCard( | ||
taskName: | ||
provider.getTaskList()[index].getTaskName(), | ||
), | ||
); | ||
}); | ||
}), | ||
), | ||
CustomButton( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Presently there is a Custom button and FloatingActionButton to do the same thing . Please choose one of the two. |
||
buttonText: "add new skill", | ||
buttonCta: () { | ||
Navigator.pushNamed(context, AddTask.id); | ||
|
||
}, | ||
), | ||
), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial route is the Onboarding screen