Skip to content

Commit

Permalink
Merge pull request #1 from J-Marte/feature/basik
Browse files Browse the repository at this point in the history
Feature/basik
  • Loading branch information
J-Marte committed Jun 21, 2022
2 parents 5ded04b + 096ad4c commit 39eeffc
Show file tree
Hide file tree
Showing 18 changed files with 367 additions and 114 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Johannes Marte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# quixx
# Qwixx

A new Flutter project.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)

For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
This is a App to hold the state of the dice game Qwixx.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.quixx"
applicationId "com.example.qwixx"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.quixx">
package="com.example.qwixx">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
5 changes: 3 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.quixx">
package="com.example.qwixx">
<application
android:label="quixx"
android:label="qwixx"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:screenOrientation="landscape"
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.quixx
package com.example.qwixx

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.quixx">
package="com.example.qwixx">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.quixx;
PRODUCT_BUNDLE_IDENTIFIER = com.example.qwixx;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -422,7 +422,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.quixx;
PRODUCT_BUNDLE_IDENTIFIER = com.example.qwixx;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -444,7 +444,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.quixx;
PRODUCT_BUNDLE_IDENTIFIER = com.example.qwixx;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
4 changes: 2 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Quixx</string>
<string>qwixx</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>quixx</string>
<string>qwixx</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
111 changes: 111 additions & 0 deletions lib/UI/number_tick.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
MIT License
Copyright (c) [2022] [Johannes Marte]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

import 'package:flutter/material.dart';

class NumberTick extends StatelessWidget {
const NumberTick({Key? key, required this.color, this.number = 1, this.size, this.backgroundColor = Colors.white, required this.value, this.onClick, this.enabled = true}) : super(key: key);

final Color color;
final Color backgroundColor;
final int number;
final double? size;
final bool value;
final bool enabled;
final void Function(bool)? onClick;

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: (){
if (enabled && onClick != null){
onClick!(!value);
}
},
child: Container(
decoration: BoxDecoration(
border: Border.all(color: color, width: 2),
borderRadius: const BorderRadius.all(Radius.circular(7)),
color: backgroundColor,
),
child: Stack(
alignment: Alignment.center,
children: [
AspectRatio(
aspectRatio: 1,
child: FittedBox(
fit: BoxFit.fitHeight,
child: Padding(
padding: const EdgeInsets.all(3),
child: Text(
"$number",
style: TextStyle(
color: enabled ? color : color.withOpacity(0.5),
fontWeight: FontWeight.bold,
fontSize: 32,
decoration: enabled ? null : TextDecoration.underline
),
),
),
)
),
if (value)
const AspectRatio(
aspectRatio: 1,
child: FittedBox(fit: BoxFit.fitHeight, child: Icon(Icons.cancel_outlined))
),

// CustomPaint(
// painter: NumberTickPainter(
// color: color,
// number: number
// ),
// ),

],
)
)
);
}
}

class NumberTickPainter extends CustomPainter{

const NumberTickPainter({required this.color, required this.number});

final Color color;
final int number;

@override
void paint(Canvas canvas, Size size) {
// TODO: implement paint
}

@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
// TODO: implement shouldRepaint
return true;
}

}
Loading

0 comments on commit 39eeffc

Please sign in to comment.