flutter-sudoku
this is a fully fledged sudoku game written in dart using flutter.
it can be exported to android, ios, fuchsia, windows, linux, macos, pwa or a web app.
installation & usage:
- can be played online in the browser.
- can be installed as a progressive web app on any platform.
see use progressive web apps - can be installed as an android app. see downloads
building:
requirements:
- flutter
- for exporting to android:
- android studio 3.0+
/ intellij idea 2017.1+
with flutter plugin
and dart plugin (recommeded) - android sdk from android studio or intellij idea (api level 30 recommended)
- java se jdk (v8 recommended)
- gradle
- set android_home and android_sdk_root variables
- add jdk to path
- android studio 3.0+
- for exporting to web:
- set current working directory to sudoku
- run these commands:
flutter config --enable-web
- for exporting to windows:
- set current working directory to sudoku
- run these commands:
flutter config --enable-windows-desktop
installing required packages
- buy this source
- set current working directory to sudoku
- run these commands:
flutter pub get flutter pub upgrade flutter pub outdated
- this will install all the required packages
- run
flutter doctor
to check fo any issues (optional)
steps for exporting to a pwa or web app
- set current working directory to sudoku
- run
flutter build web --release
- this will compile the program and store the files in the
sudoku/build/web
directory - you can run a simple http server in this directory to run your app in the browser
- dhttpd is a dart package for running a simple http server
steps for exporting to windows
- set current working directory to sudoku
- run
flutter build windows --release
- this will compile the program and store the files in the
sudoku/build/windows/runner/release
directory - it will export a release build that can be run directly
steps for exporting to android
- set current working directory to sudoku
- to export as an android app run:
flutter build apk
to build a fat apk for all abisor
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
to build multiple apks
for every abi
- this will export a release build of the apk file signed with debug keys which can be installed on an android phone or
emulator - the apk file/s will be saved in
sudoku/build/app/outputs/flutter-apk
- minimum android version required : android 4.1.x jellybean (api level 16)
features:
- uses a combination of a sudoku generation and solving algorithm to create a unique game
- generates a new game when you start the app
- clicking a box displays a dialog with buttons 1-9 to input in the box
- clickable buttons will initially have no number and will turn red after the first click
- after completely solving the grid, if the solution is correct it will alert you that you successfully solved the
sudoku - the numbers in all the clickable buttons will turn blue if the solution is correct (this will also happen if you click
show solution) - 4 different difficulty levels to choose from :
- beginner – 18 empty squares
- easy – 27 empty squares
- medium – 36 empty squares
- hard – 54 empty squares
- new game
- restart game
- show solution
- dark and light theme
- material design
note:
- flutter_animated_dialog is used for animated alert dialogs
- shared_preferences is used for saving preferences locally
- splashscreen is used for the splashscreen
- url_launcher is used for hyperlinks
- referred algorithms:
- sudoku generation algorithm in java
- sudoku generation and solving algorithm in python
- untested on ios, macos, linux and fuchsia. additional chnages might be required to work correctly
- if you face any issue or have suggestions then feel free to open an issue on github
screenshots:
- main screen while solved with dark theme:
- main screen while solving with light theme:
- choose number alert:
- game over alert box:
- options:
Comments are closed.