You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
759 B
25 lines
759 B
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:thesis_shop/benchmark_counter.dart';
|
|
import 'package:thesis_shop/stores/user_store.dart';
|
|
|
|
class UserSwitch extends ConsumerWidget {
|
|
const UserSwitch() : super(key: const Key('user_switch'));
|
|
|
|
@override
|
|
Widget build(BuildContext context, ref) {
|
|
final isSignedIn = ref.watch(userStoreProvider);
|
|
BenchmarkCounters.userSwitch++;
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const Icon(Icons.account_circle),
|
|
Switch(
|
|
value: isSignedIn,
|
|
onChanged: ref.read(userStoreProvider.notifier).changeSignInStatus,
|
|
activeColor: Colors.green,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|