feature/meldingen-hardening #6
9 changed files with 45 additions and 44 deletions
|
|
@ -62,9 +62,7 @@ class _ConsentGate extends ConsumerWidget {
|
|||
final consent = ref.watch(consentProvider);
|
||||
|
||||
if (consent.isLoading) {
|
||||
return const Scaffold(
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
return const Scaffold(body: Center(child: CircularProgressIndicator()));
|
||||
}
|
||||
|
||||
if (!consent.hasAccepted) {
|
||||
|
|
@ -72,9 +70,7 @@ class _ConsentGate extends ConsumerWidget {
|
|||
// supplies the theme and the AppLocalizations delegate, so context.l10n
|
||||
// resolves here. A nested MaterialApp would start a fresh Localizations
|
||||
// scope without our delegate and the consent text would render blank.
|
||||
return const Scaffold(
|
||||
body: Center(child: ConsentDialog()),
|
||||
);
|
||||
return const Scaffold(body: Center(child: ConsentDialog()));
|
||||
}
|
||||
|
||||
return const AppShell();
|
||||
|
|
|
|||
|
|
@ -41,9 +41,7 @@ class _ConsentDialogState extends ConsumerState<ConsentDialog> {
|
|||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.outlineVariant,
|
||||
),
|
||||
border: Border.all(color: theme.colorScheme.outlineVariant),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
|
|
@ -115,8 +113,9 @@ class _ConsentDialogState extends ConsumerState<ConsentDialog> {
|
|||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primaryContainer
|
||||
.withValues(alpha: 0.2),
|
||||
color: theme.colorScheme.primaryContainer.withValues(
|
||||
alpha: 0.2,
|
||||
),
|
||||
border: Border.all(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.3),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1648,7 +1648,10 @@ class _SettingsDialogState extends ConsumerState<SettingsDialog> {
|
|||
children: [
|
||||
Text(
|
||||
l10n.d('U hebt al toegestemd in het gebruik van OciDeck.'),
|
||||
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -270,9 +270,7 @@ class ImagePickerBar extends ConsumerWidget {
|
|||
}
|
||||
if (slide.imagePath2.isNotEmpty &&
|
||||
resolve(slide.imagePath2) == target) {
|
||||
updated = updated.copyWith(
|
||||
imagePath2: replacement(slide.imagePath2),
|
||||
);
|
||||
updated = updated.copyWith(imagePath2: replacement(slide.imagePath2));
|
||||
}
|
||||
if (!identical(updated, slide)) notifier.updateSlide(i, updated);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ void main() {
|
|||
home: Builder(
|
||||
builder: (context) => Center(
|
||||
child: ElevatedButton(
|
||||
onPressed: () async => picked = await AddSlideDialog.show(context),
|
||||
onPressed: () async =>
|
||||
picked = await AddSlideDialog.show(context),
|
||||
child: const Text('open'),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -108,7 +108,9 @@ void main() {
|
|||
const spec = ChartSpec(
|
||||
type: ChartType.line,
|
||||
x: ['Q1'],
|
||||
series: [ChartSeries(name: 'A', data: [10])],
|
||||
series: [
|
||||
ChartSeries(name: 'A', data: [10]),
|
||||
],
|
||||
minBound: 5,
|
||||
maxBound: 20,
|
||||
);
|
||||
|
|
@ -121,7 +123,9 @@ void main() {
|
|||
const spec = ChartSpec(
|
||||
type: ChartType.pie,
|
||||
x: ['Q1'],
|
||||
series: [ChartSeries(name: 'A', data: [10])],
|
||||
series: [
|
||||
ChartSeries(name: 'A', data: [10]),
|
||||
],
|
||||
minBound: 5,
|
||||
maxBound: 20,
|
||||
);
|
||||
|
|
@ -149,7 +153,9 @@ void main() {
|
|||
const spec = ChartSpec(
|
||||
type: ChartType.radar,
|
||||
x: ['A', 'B', 'C'],
|
||||
series: [ChartSeries(name: 'A', data: [1, 2, 3])],
|
||||
series: [
|
||||
ChartSeries(name: 'A', data: [1, 2, 3]),
|
||||
],
|
||||
minBound: 1,
|
||||
maxBound: 5,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ void main() {
|
|||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('syntax highlighting on uses HighlightView for a known language', (
|
||||
tester,
|
||||
) async {
|
||||
testWidgets(
|
||||
'syntax highlighting on uses HighlightView for a known language',
|
||||
(tester) async {
|
||||
final slide = Slide.create(
|
||||
SlideType.code,
|
||||
).copyWith(codeLanguage: 'dart', customMarkdown: 'void main() {}');
|
||||
|
|
@ -57,7 +57,8 @@ void main() {
|
|||
await tester.pump();
|
||||
|
||||
expect(find.byType(HighlightView), findsOneWidget);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('syntax highlighting off renders monochrome (CRT) text', (
|
||||
tester,
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ void main() {
|
|||
final a = write('a.png', [1]);
|
||||
final b = write('b.png', [1]);
|
||||
|
||||
final keeper = service.chooseKeeper(
|
||||
[a, b],
|
||||
usageCountOf: (path) => path == b ? 2 : 0,
|
||||
);
|
||||
final keeper = service.chooseKeeper([
|
||||
a,
|
||||
b,
|
||||
], usageCountOf: (path) => path == b ? 2 : 0);
|
||||
|
||||
expect(keeper, b);
|
||||
});
|
||||
|
|
@ -79,9 +79,9 @@ void main() {
|
|||
test('falls back to the oldest file when usages are equal', () {
|
||||
final newer = write('newer.png', [1]);
|
||||
final older = write('older.png', [1]);
|
||||
File(older).setLastModifiedSync(
|
||||
DateTime.now().subtract(const Duration(days: 7)),
|
||||
);
|
||||
File(
|
||||
older,
|
||||
).setLastModifiedSync(DateTime.now().subtract(const Duration(days: 7)));
|
||||
|
||||
expect(service.chooseKeeper([newer, older]), older);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -61,13 +61,10 @@ void main() {
|
|||
});
|
||||
|
||||
test('parses a markdown table and drops the separator row', () {
|
||||
expect(
|
||||
parseClipboardTable('| Naam | Score |\n|---|---:|\n| Jan | 8 |'),
|
||||
[
|
||||
expect(parseClipboardTable('| Naam | Score |\n|---|---:|\n| Jan | 8 |'), [
|
||||
['Naam', 'Score'],
|
||||
['Jan', '8'],
|
||||
],
|
||||
);
|
||||
]);
|
||||
});
|
||||
|
||||
test('plain text is not a table', () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue