1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-25 17:06:44 +00:00

[linting_tool] Implement saving rules to DB (#860)

This commit is contained in:
Abdullah Deshmukh
2021-08-05 03:48:22 +05:30
committed by GitHub
parent 1818925286
commit bbb8e342f1
22 changed files with 1045 additions and 24 deletions

View File

@@ -3,11 +3,13 @@
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:linting_tool/model/profiles_store.dart';
import 'package:linting_tool/model/rules_store.dart';
import 'package:linting_tool/theme/app_theme.dart';
import 'package:linting_tool/widgets/adaptive_nav.dart';
import 'package:linting_tool/routes.dart' as routes;
import 'package:provider/provider.dart';
import 'package:http/http.dart' as http;
class LintingTool extends StatefulWidget {
const LintingTool({Key? key}) : super(key: key);
@@ -21,8 +23,15 @@ class LintingTool extends StatefulWidget {
class _LintingToolState extends State<LintingTool> {
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<RuleStore>(
create: (context) => RuleStore(),
return MultiProvider(
providers: [
ChangeNotifierProvider<RuleStore>(
create: (context) => RuleStore(http.Client()),
),
ChangeNotifierProvider<ProfilesStore>(
create: (context) => ProfilesStore(),
),
],
child: MaterialApp(
title: 'Flutter Linting Tool',
theme: AppTheme.buildReplyLightTheme(context),