Skip to content

Commit

Permalink
remove provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Barabas5532 committed Feb 3, 2024
1 parent 81ea5d0 commit d31e74e
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 243 deletions.
136 changes: 0 additions & 136 deletions frontend/lib/fake_provisioning.dart

This file was deleted.

31 changes: 2 additions & 29 deletions frontend/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@

import 'dart:async';

import 'package:esp_softap_provisioning/esp_softap_provisioning.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod;
import 'package:google_fonts/google_fonts.dart';
import 'package:logging/logging.dart';
import 'package:provider/provider.dart';

import 'audio_events.dart';
import 'midi_mapping/model/midi_learn.dart';
Expand All @@ -37,8 +35,6 @@ import 'presets/view/presets.dart';
import 'status/view/websocket_status.dart';
import 'wifi_provisioning.dart';

final _log = Logger('shrapnel.main');

String formatDateTime(DateTime t) {
final builder = StringBuffer()
..write(t.hour.toString().padLeft(2, '0'))
Expand Down Expand Up @@ -83,34 +79,11 @@ void setupLogger(Level level) {
}

class App extends riverpod.ConsumerWidget {
App({
super.key,
this.provisioning,
});

final WifiProvisioningService? provisioning;
App({super.key});

@override
Widget build(BuildContext context, riverpod.WidgetRef ref) {
return MultiProvider(
providers: [
if (provisioning != null)
ChangeNotifierProvider.value(value: provisioning!)
else
ChangeNotifierProvider(
create: (context) => WifiProvisioningService(
provisioningFactory: () {
_log.info('Creating provisioning connection');
return Provisioning(
security: Security1(pop: 'abcd1234'),
transport: TransportHTTP('guitar-dsp.local'),
);
},
),
),
],
child: const MyApp(),
);
return const MyApp();
}
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/presets/model/presets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* ShrapnelDSP. If not, see <https://www.gnu.org/licenses/>.
*/

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:state_notifier/state_notifier.dart';

part 'presets.freezed.dart';

Expand Down
Loading

0 comments on commit d31e74e

Please sign in to comment.