nissy-fmc

A Rubik's cube FMC assistant
git clone https://git.tronto.net/nissy-fmc
Download | Log | Files | Refs | README | LICENSE

commit 598fcfb0fde56ff6e309ae46fe7a156affd82dd0
parent 50887719cc35cdada6177d9eec292c4b20ef40c9
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Sun, 18 Jun 2023 09:47:16 +0200

Setting up Flutter

Diffstat:
M.gitignore | 1+
MMakefile | 3++-
ATODO.md | 6++++++
Aflutter/lib/main.dart | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflutter/pubspec.yaml | 25+++++++++++++++++++++++++
5 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore @@ -1,4 +1,5 @@ buildtables +nissy_flutter nissy tables tables-old diff --git a/Makefile b/Makefile @@ -21,7 +21,8 @@ clean: rm -rf nissy nissy: clean - ${CC} ${CFLAGS} -o nissy src/*.c + flutter create nissy_flutter + cp -R flutter/* nissy_flutter/ debug: ${CC} ${DBFLAGS} -o nissy cli/*.c src/*.c diff --git a/TODO.md b/TODO.md @@ -0,0 +1,6 @@ +* Figure out FFI +* Read data file from flutter and pass it to C backend +* show EOs in gui (for example scramble) +* input text box for scramble, get EOs for that +* UI design +* other steps diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(const NissyApp()); +} + +class NissyApp extends StatelessWidget { + const NissyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Nissy', + theme: ThemeData( + colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), + useMaterial3: true, + ), + home: const MyHomePage(title: 'Nissy'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key, required this.title}); + + final String title; + + @override + State<MyHomePage> createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State<MyHomePage> { + int _counter = 0; + + void _incrementCounter() { + setState(() { + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: _counter % 3 == 0 ? + Theme.of(context).colorScheme.inversePrimary : + Theme.of(context).colorScheme.primary, + title: Text(widget.title), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: <Widget>[ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml @@ -0,0 +1,25 @@ +name: nissy_flutter +description: Flutter UI for nissy-fmc + +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +version: 3.0.0 + +environment: + sdk: '>=3.0.1 <4.0.0' + +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +flutter: + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg