Skip to content

Commit

Permalink
+weekplan design
Browse files Browse the repository at this point in the history
+ Added weekplan new design
+ Added back to previous page
- Removed edit functionality

+ Minor design changes to weekplan selector
  • Loading branch information
AquaHippo committed Nov 17, 2023
1 parent 0503d06 commit dabf58b
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 36 deletions.
166 changes: 157 additions & 9 deletions lib/screens/weekplan_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import 'package:weekplanner/widgets/giraf_copy_activities_dialog.dart';
import 'package:weekplanner/widgets/giraf_notify_dialog.dart';
import 'package:weekplanner/widgets/weekplan_screen_widgets/weekplan_activities_column.dart';
import 'package:weekplanner/widgets/weekplan_screen_widgets/weekplan_day_column.dart';

import 'package:weekplanner/style/font_size.dart';
import '../style/custom_color.dart' as theme;

/// <summary>
Expand All @@ -47,9 +47,156 @@ class WeekplanScreen extends StatelessWidget {
final DisplayNameModel _user;
final WeekModel _week;


@override
Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size;
final bool portrait =
MediaQuery.of(context).orientation == Orientation.portrait;

/// screen background
return Scaffold(
resizeToAvoidBottomInset: false,
body: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
/// The blue left part of screen
Expanded(
flex: 1,
child: Container(

child: Stack(children: <Widget>[

Image.asset(
'assets/icons/giraf_blue_long.png',
repeat: ImageRepeat.repeat,
height: screenSize.height,
fit: BoxFit.cover,
),
Container(
padding: EdgeInsets.all(50.0),
child: Column(children: <Widget>[
Align(
alignment: Alignment.center,
child: IconButton(
key: Key('NavigationMenu'),
padding: EdgeInsets.all(0.0),
color: Colors.white,
icon: Icon(Icons.menu, size: 55),
onPressed: () {
//_naviBar(context); insert navigation reference
},
),
),
],
),
),
],
),
),
),
/// The white middle of the screen
Expanded(
flex: 7,
child: Container(
width: screenSize.width,
height: screenSize.height,
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(0, 20, 0,0),
child: Stack(children: <Widget>[
Row(children: <Widget>[
Container(
child: Column(children: <Widget>[
Align(
alignment: Alignment.topLeft,
child: IconButton(
key: Key('BackArrow'),
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(0, 0, 50, 0),
color: Colors.black,
icon: Icon(Icons.arrow_back, size: 55),
onPressed: () {
Navigator.pop(context); ///go back to previous page
},
),
),
],
),
),
Align(
alignment: Alignment.topLeft,
child: Text(
'Ugeplan',
textAlign: TextAlign.left,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: GirafFont.headline, fontFamily: 'Quicksand-Bold'),
),
),

Container(
child: Column(children: <Widget>[
Align(
alignment: Alignment.topRight,
child: IconButton(
key: const Key('EditWeekplan'),
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(690, 0, 0, 0),
color: Colors.black,
icon: const Icon(Icons.create_outlined, size: 50),
onPressed: () {
///_pushEditWeekPlan(context); //Does not work yet
},
),
),
],
),
),
],
),
Container(
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(0, 70, 0, 0),
child: StreamBuilder<UserWeekModel>(
stream: _weekplanBloc.userWeek,
initialData: null,
builder: (BuildContext context,
AsyncSnapshot<UserWeekModel> snapshot) {
if (snapshot.hasData) {
return _buildWeeks(snapshot.data.week, context);
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
}
),
),
],
),

),
),
/// The blue right part of screen
Expanded(
flex: 1,
child: Container(
height: screenSize.height,
child: Image.asset(
'assets/icons/giraf_blue_long.png',
repeat: ImageRepeat.repeat,
fit: BoxFit.cover,
),
)
),
]
),
);
}

/// @override
Widget build2(BuildContext context) {

return StreamBuilder<WeekplanMode>(
stream: _authBloc.mode,
Expand Down Expand Up @@ -339,14 +486,15 @@ class WeekplanScreen extends StatelessWidget {

StreamBuilder<WeekplanMode> _buildWeeks(
WeekModel weekModel, BuildContext context) {

const List<Color> defaultWeekColors = <Color>[
theme.GirafColors.mondayColor,
theme.GirafColors.tuesdayColor,
theme.GirafColors.wednesdayColor,
theme.GirafColors.thursdayColor,
theme.GirafColors.fridayColor,
theme.GirafColors.saturdayColor,
theme.GirafColors.sundayColor
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue,
theme.GirafColors.trusteeLightBlue
];
final List<Widget> weekDays = <Widget>[];
final Orientation orientation = MediaQuery.of(context).orientation;
Expand Down
57 changes: 30 additions & 27 deletions lib/screens/weekplan_selector_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,32 @@ class _WeekplanSelectorScreenState extends State<WeekplanSelectorScreen> {

child: Stack(children: <Widget>[

Image.asset(
'assets/icons/giraf_blue_long.png',
repeat: ImageRepeat.repeat,
height: screenSize.height,
fit: BoxFit.cover,
),
Container(
padding: EdgeInsets.all(50.0),
child: Column(children: <Widget>[
Align(
alignment: Alignment.center,
child: Container(
color: Colors.white,
padding: EdgeInsets.all(0.0),
Image.asset(
'assets/icons/giraf_blue_long.png',
repeat: ImageRepeat.repeat,
height: screenSize.height,
fit: BoxFit.cover,
),
Container(
padding: EdgeInsets.all(50.0),
child: Column(children: <Widget>[
Align(
alignment: Alignment.center,
child: IconButton(
key: Key('NavigationMenu'),
padding: EdgeInsets.all(0.0),
color: Colors.black,
icon: Icon(Icons.menu, size: 50),
color: Colors.white,
icon: Icon(Icons.menu, size: 55),
onPressed: () {
//_naviBar(context); insert navigation menu reference
//_naviBar(context); insert navigation reference
},
),
),
],
),
),
],
),
),
],
),
],
),
),
),
/// The white middle of the screen
Expand All @@ -114,18 +110,25 @@ class _WeekplanSelectorScreenState extends State<WeekplanSelectorScreen> {
? const EdgeInsets.fromLTRB(50, 0, 50, 0)
: const EdgeInsets.fromLTRB(0, 20, 0,0),
child: Stack(children: <Widget>[
Text(
'Ugeplaner',
textAlign: TextAlign.left,
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: GirafFont.headline, fontFamily: 'Quicksand-Bold'),
Container(
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(20, 0, 0, 0),
child: const Text(
'Ugeplaner',
textAlign: TextAlign.left,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: GirafFont.headline, fontFamily: 'Quicksand-Bold'),
),
),
Container(
child: Column(children: <Widget>[
Align(
alignment: Alignment.topRight,
child: IconButton(
key: const Key('EditWeekplanSelctor'),
padding: const EdgeInsets.all(0.0),
padding: portrait
? const EdgeInsets.fromLTRB(0, 0, 0, 0)
: const EdgeInsets.fromLTRB(0, 0, 40, 0),
color: Colors.black,
icon: const Icon(Icons.create_outlined, size: 50),
onPressed: () {
Expand Down

0 comments on commit dabf58b

Please sign in to comment.