authProviderTemplate top-level constant

String const authProviderTemplate

Implementation

const String authProviderTemplate = '''
import 'package:flutter/foundation.dart';

import 'auth_service.dart';

class AuthProvider extends ChangeNotifier {
  final AuthService _authService;

  AuthProvider({AuthService? authService})
      : _authService = authService ?? AuthService();

  bool _isLoading = false;
  bool get isLoading => _isLoading;

  Future<bool> login(String email, String password) async {
    _isLoading = true;
    notifyListeners();

    final success = await _authService.login(email: email, password: password);

    _isLoading = false;
    notifyListeners();
    return success;
  }
}
''';