Skip to content

Commit

Permalink
Graphical fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
karpev98 committed May 25, 2023
1 parent ae94733 commit d1b19a1
Show file tree
Hide file tree
Showing 17 changed files with 247 additions and 81 deletions.
34 changes: 29 additions & 5 deletions lib/activities/block_based/containers/fill_empty.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,22 @@ class _FillEmpty extends State<FillEmpty> {
color: CupertinoColors.systemBackground,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
],
),
Expand All @@ -146,8 +159,19 @@ class _FillEmpty extends State<FillEmpty> {
Icons.format_color_fill_rounded,
color: CupertinoColors.systemBackground,
),
Row(
children: _colorButtonsBuild(),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
],
),
Expand Down
44 changes: 35 additions & 9 deletions lib/activities/block_based/containers/paint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,19 @@ class _Paint extends State<Paint> {
const SizedBox(
height: 5,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
const SizedBox(
height: 5,
Expand Down Expand Up @@ -142,8 +152,19 @@ class _Paint extends State<Paint> {
SFSymbols.paintbrush_fill,
color: CupertinoColors.systemBackground,
),
Row(
children: _colorButtonsBuild(),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
],
),
Expand Down Expand Up @@ -197,11 +218,13 @@ class _Paint extends State<Paint> {
List<Widget> repetitionsText = List<Widget>.from(
widget.item.repetitionsText,
);
print(widget.item.direction);
setState(() {
if (widget.item.direction.startsWith("square")) {
widget.item.repetitions = 2;
repetitionsText = <Widget>[repetitionsText[2]];
} else if (widget.item.direction.startsWith("l")) {
} else if (widget.item.direction.startsWith("l") &&
!widget.item.direction.startsWith("left")) {
widget.item.repetitions = 3;
repetitionsText = <Widget>[repetitionsText[3]];
} else if (widget.item.direction.startsWith("zig-zag")) {
Expand Down Expand Up @@ -256,7 +279,8 @@ class _Paint extends State<Paint> {
if (widget.item.direction.startsWith("square")) {
widget.item.repetitions = 2;
repetitionsIcons = <Widget>[repetitionsIcons[2]];
} else if (widget.item.direction.startsWith("l")) {
} else if (widget.item.direction.startsWith("l") &&
!widget.item.direction.startsWith("left")) {
widget.item.repetitions = 3;
repetitionsIcons = <Widget>[repetitionsIcons[3]];
} else if (widget.item.direction.startsWith("zig-zag")) {
Expand Down Expand Up @@ -334,7 +358,8 @@ class _Paint extends State<Paint> {
setState(() {
if (widget.item.direction.startsWith("square")) {
widget.item.repetitions = 2;
} else if (widget.item.direction.startsWith("l")) {
} else if (widget.item.direction.startsWith("l") &&
!widget.item.direction.startsWith("left")) {
widget.item.repetitions = 3;
} else if (widget.item.direction.startsWith("zig-zag")) {
widget.item.repetitions = 1;
Expand Down Expand Up @@ -385,7 +410,8 @@ class _Paint extends State<Paint> {
setState(() {
if (widget.item.direction.startsWith("square")) {
widget.item.repetitions = 2;
} else if (widget.item.direction.startsWith("l")) {
} else if (widget.item.direction.startsWith("l") &&
!widget.item.direction.startsWith("left")) {
widget.item.repetitions = 3;
} else if (widget.item.direction.startsWith("zig-zag")) {
widget.item.repetitions = 1;
Expand Down
37 changes: 29 additions & 8 deletions lib/activities/block_based/containers/paint_single.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ class _PaintSingle extends State<PaintSingle> {
return Container(
key: widgetKey,
width: MediaQuery.of(context).size.width,
// width: constraints.maxWidth.isFinite
// ? constraints.maxWidth
// : MediaQuery.of(context).size.width / 4,
decoration: BoxDecoration(
color: Colors.teal,
borderRadius: const BorderRadius.all(Radius.circular(8)),
Expand Down Expand Up @@ -135,9 +132,22 @@ class _PaintSingle extends State<PaintSingle> {
color: CupertinoColors.systemBackground,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
],
),
Expand All @@ -152,8 +162,19 @@ class _PaintSingle extends State<PaintSingle> {
SFSymbols.paintbrush_fill,
color: CupertinoColors.systemBackground,
),
Row(
children: _colorButtonsBuild(),
Container(
padding: const EdgeInsets.all(1),
decoration: const BoxDecoration(
color: CupertinoColors.systemGrey5,
borderRadius: BorderRadius.all(
Radius.circular(8),
),
),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _colorButtonsBuild(),
),
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/activities/block_based/drop_down_blocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DropDownBlocks extends AnimatedWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(
width: MediaQuery.of(context).size.width * 0.20,
width: MediaQuery.of(context).size.width * 0.21,
child: Padding(
padding: const EdgeInsets.only(right: 10, bottom: 5, top: 5),
child: DecoratedBox(
Expand Down
2 changes: 1 addition & 1 deletion lib/activities/block_based/model/paint_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class PaintContainer extends SimpleContainer {
width: 20,
): "l down right",
SvgPicture.asset(
"resources/symbols/diagonal_down_right.svg",
"resources/symbols/zigzag_left_down_up.svg",
height: 20,
width: 20,
): "zig-zag left down up",
Expand Down
2 changes: 1 addition & 1 deletion lib/activities/block_based/side_menu_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class SideMenuBlockState extends State<SideMenuBlock> {
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.all(5),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.20,
width: MediaQuery.of(context).size.width * 0.21,
height: MediaQuery.of(context).size.height * 0.85,
child: Scrollbar(
controller: _firstController,
Expand Down
2 changes: 2 additions & 0 deletions lib/activities/gesture_based/bottom_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ class _BottomBarState extends State<BottomBar> {
context,
CupertinoPageRoute<Widget>(
builder: (BuildContext context) => ResultsScreen(
sessionID: widget.sessionID,
studentID: widget.studentID,
results: widget.allResults,
),
),
Expand Down
2 changes: 2 additions & 0 deletions lib/activities/gesture_based/gesture_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ class GestureHomeState extends State<GestureHome> {
Navigator.of(context).push(
CupertinoPageRoute<Widget>(
builder: (BuildContext context) => ResultsScreen(
sessionID: widget.sessionID,
studentID: widget.studentID,
results: _allResults,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/activities/gesture_based/model/cross_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class CrossButtonState extends State<CrossButton> {

return;
}
context.read<SelectedColorsNotifier>().clear();
t = Timer.periodic(const Duration(milliseconds: 1), (Timer timer) {
setState(() {
buttonColor = CupertinoColors.lightBackgroundGray;
Expand Down Expand Up @@ -427,7 +428,6 @@ class CrossButtonState extends State<CrossButton> {
description: CatLoggingLevel.confirmCommand,
),
);
// Timer(const Duration(milliseconds: 300), );
}

void _selectionMultiple() {
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class MyApp extends StatelessWidget {
routes: {
"/mode": (BuildContext context) => const ModeSelection(),
},
debugShowCheckedModeBanner: false,
theme: const CupertinoThemeData(
brightness: Brightness.light,
primaryColor: CupertinoColors.systemOrange,
Expand Down
Loading

0 comments on commit d1b19a1

Please sign in to comment.