mirror of
https://github.com/rrousselGit/riverpod.git
synced 2025-08-14 17:41:48 +08:00

<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated dependency configurations to allow greater flexibility and removed an obsolete linting tool. - **Refactor** - Streamlined state management and theme handling to improve maintainability without impacting visible functionality. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
37 lines
964 B
Dart
37 lines
964 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
import 'common.dart';
|
|
import 'home.dart';
|
|
|
|
void main() {
|
|
runApp(ProviderScope(child: MyApp()));
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
theme: ThemeData(
|
|
scaffoldBackgroundColor: const Color(0xFF2d2d2d),
|
|
),
|
|
builder: (context, child) {
|
|
final theme = Theme.of(context);
|
|
|
|
return ProviderScope(
|
|
overrides: [
|
|
/// We override "themeProvider" with a valid theme instance.
|
|
/// This allows providers such as "tagThemeProvider" to read the
|
|
/// current theme, without having a BuildContext.
|
|
themeProvider.overrideWithValue(theme),
|
|
],
|
|
child: const ListTileTheme(
|
|
textColor: Color(0xFFe7e8eb),
|
|
child: MyHomePage(),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|