cleanup code a bit
This commit is contained in:
@@ -31,7 +31,6 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
description: This file stores settings for Dart & Flutter DevTools.
|
||||
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||
extensions:
|
||||
@@ -1,21 +1,11 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||
import 'src/services/deck_repository.dart';
|
||||
import 'src/screens/start_screen.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
if (!kIsWeb &&
|
||||
(defaultTargetPlatform == TargetPlatform.windows ||
|
||||
defaultTargetPlatform == TargetPlatform.linux ||
|
||||
defaultTargetPlatform == TargetPlatform.macOS)) {
|
||||
sqfliteFfiInit();
|
||||
databaseFactory = databaseFactoryFfi;
|
||||
}
|
||||
|
||||
runApp(
|
||||
Provider<DeckRepository>(
|
||||
create: (_) => DeckRepository(),
|
||||
|
||||
@@ -102,7 +102,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
|
||||
final pickedType = choices[_random.nextInt(choices.length)];
|
||||
final readingsList = pickedType == 'onyomi' ? item.onyomi : item.kunyomi;
|
||||
final hint = 'Select the ${pickedType == 'onyomi' ? "on\'yomi" : "kunyomi"}';
|
||||
final hint = 'Select the ${pickedType == 'onyomi' ? "on'yomi" : "kunyomi"}';
|
||||
|
||||
return _ReadingInfo(readingsList, hint);
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
final repo = Provider.of<DeckRepository>(context, listen: false);
|
||||
await repo.setApiKey(apiKey);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('API key saved!')),
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('API key saved!')),
|
||||
);
|
||||
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(builder: (_) => const HomeScreen()),
|
||||
);
|
||||
|
||||
@@ -32,7 +32,9 @@ class DistractorGenerator {
|
||||
if (c.toLowerCase() == correctMeaning.toLowerCase()) continue;
|
||||
out.add(_toTitleCase(c));
|
||||
}
|
||||
while (out.length < needed) out.add('(no more)');
|
||||
while (out.length < needed) {
|
||||
out.add('(no more)');
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -44,7 +46,9 @@ class DistractorGenerator {
|
||||
if (out.length >= needed) break;
|
||||
out.add(o);
|
||||
}
|
||||
while (out.length < needed) out.add('—');
|
||||
while (out.length < needed) {
|
||||
out.add('—');
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -61,7 +65,9 @@ class DistractorGenerator {
|
||||
if (out.length >= needed) break;
|
||||
out.add(r);
|
||||
}
|
||||
while (out.length < needed) out.add('—');
|
||||
while (out.length < needed) {
|
||||
out.add('—');
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
58
pubspec.lock
58
pubspec.lock
@@ -21,10 +21,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
|
||||
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
version: "4.0.7"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -141,10 +141,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
sha256: "66f86e916d285c1a93d3b79587d94bd71984a66aac4ff74e524cfa7877f1395c"
|
||||
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.5"
|
||||
version: "0.4.2"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -242,10 +242,18 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_launcher_icons
|
||||
sha256: ce0e501cfc258907842238e4ca605e74b7fd1cdf04b3b43e86c43f3e40a1592c
|
||||
sha256: "10f13781741a2e3972126fae08393d3c4e01fa4cd7473326b94b72cf594195e7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.0"
|
||||
version: "0.14.4"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -308,10 +316,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "8e9d133755c3e84c73288363e6343157c383a0c6c56fc51afcc5d4d7180306d6"
|
||||
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
version: "4.5.4"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -360,6 +368,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -520,6 +536,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
posix:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: posix
|
||||
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.3"
|
||||
provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -693,14 +717,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.6"
|
||||
sqflite_common_ffi:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sqflite_common_ffi
|
||||
sha256: "9faa2fedc5385ef238ce772589f7718c24cdddd27419b609bb9c6f703ea27988"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.6"
|
||||
sqflite_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -717,14 +733,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
sqlite3:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqlite3
|
||||
sha256: f18fd9a72d7a1ad2920db61368f2a69368f1cc9b56b8233e9d83b47b0a8435aa
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.3"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -894,5 +902,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.9.2 <4.0.0"
|
||||
dart: ">=3.9.0 <4.0.0"
|
||||
flutter: ">=3.35.0"
|
||||
|
||||
20
pubspec.yaml
20
pubspec.yaml
@@ -2,25 +2,25 @@ name: wanikani_kanji_srs
|
||||
description: A modern Flutter app for practicing unlocked WaniKani kanji with three quiz modes.
|
||||
version: 0.1.0+1
|
||||
environment:
|
||||
sdk: ^3.9.2
|
||||
sdk: '>=3.3.0 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
shared_preferences: ^2.0.15
|
||||
sqflite: ^2.2.8+4
|
||||
sqflite_common_ffi: ^2.3.0
|
||||
path_provider: ^2.0.14
|
||||
path: ^1.8.3
|
||||
provider: ^6.0.5
|
||||
shared_preferences: ^2.5.3
|
||||
sqflite: ^2.4.2
|
||||
path_provider: ^2.1.5
|
||||
path: ^1.9.1
|
||||
provider: ^6.1.5+1
|
||||
http: ^1.5.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
mockito: ^5.4.0
|
||||
test: ^1.24.0
|
||||
flutter_launcher_icons: ^0.11.0
|
||||
mockito: ^5.5.0
|
||||
test: ^1.26.2
|
||||
flutter_launcher_icons: ^0.14.4
|
||||
flutter_lints: ^6.0.0
|
||||
|
||||
flutter_icons:
|
||||
android: true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:test/test.dart';
|
||||
import '../lib/src/services/distractor_generator.dart';
|
||||
import '../lib/src/models/kanji_item.dart';
|
||||
import 'package:wanikani_kanji_srs/src/services/distractor_generator.dart';
|
||||
import 'package:wanikani_kanji_srs/src/models/kanji_item.dart';
|
||||
|
||||
void main() {
|
||||
test('meaning distractors include plausible items', () {
|
||||
|
||||
Reference in New Issue
Block a user