Provider rename

This commit is contained in:
2024-05-12 13:43:30 +03:00
parent 6c4c2c4acd
commit 78e468cc29
3 changed files with 6 additions and 6 deletions

View File

@@ -18,8 +18,8 @@ class MyExampleApp extends StatelessWidget {
title: 'GymLink Example App',
debugShowCheckedModeBanner: false,
home: ChangeNotifierProvider(
create: (_) => ModuleMethods(),
child: Consumer<ModuleMethods>(
create: (_) => GymLinkProvider(),
child: Consumer<GymLinkProvider>(
builder: (context, provider, __) => const ExamplePage(),
),
),
@@ -38,12 +38,12 @@ class _ExamplePageState extends State<ExamplePage> {
@override
void initState() {
super.initState();
context.read<ModuleMethods>().onTokenReceived('token123');
context.read<GymLinkProvider>().onTokenReceived('token123');
}
@override
Widget build(BuildContext context) {
return Consumer<ModuleMethods>(
return Consumer<GymLinkProvider>(
builder: (context, provider, __) => Scaffold(
appBar: AppBar(title: const Text('GymLink Example App')),
body: Column(

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:gymlink_module_web/theme.dart';
class ModuleMethods with ChangeNotifier {
class GymLinkProvider with ChangeNotifier {
bool _isLoading = true;
bool get isLoading => _isLoading;
bool _blackTheme = false;

View File

@@ -7,7 +7,7 @@ import 'package:provider/provider.dart';
class MyAppStateMobile extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Consumer<ModuleMethods>(
return Consumer<GymLinkProvider>(
builder: (context, provider, __) => MaterialApp(
title: 'GymLink Module',
theme: provider.theme,