1
0
mirror of https://github.com/flutter/samples.git synced 2026-05-13 10:27:09 +00:00

[linting_tool] Add lint rules list (#856)

This commit is contained in:
Abdullah Deshmukh
2021-07-21 16:59:28 +05:30
committed by GitHub
parent 3b65403631
commit 6bac1b9694
13 changed files with 711 additions and 19 deletions

View File

@@ -3,9 +3,11 @@
// found in the LICENSE file.
import 'package:flutter/material.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';
class LintingTool extends StatefulWidget {
const LintingTool({Key? key}) : super(key: key);
@@ -19,22 +21,25 @@ class LintingTool extends StatefulWidget {
class _LintingToolState extends State<LintingTool> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Linting Tool',
theme: AppTheme.buildReplyLightTheme(context),
darkTheme: AppTheme.buildReplyDarkTheme(context),
themeMode: ThemeMode.light,
initialRoute: LintingTool.homeRoute,
onGenerateRoute: (settings) {
switch (settings.name) {
case LintingTool.homeRoute:
return MaterialPageRoute<void>(
builder: (context) => const AdaptiveNav(),
settings: settings,
);
}
return null;
},
return ChangeNotifierProvider<RuleStore>(
create: (context) => RuleStore(),
child: MaterialApp(
title: 'Flutter Linting Tool',
theme: AppTheme.buildReplyLightTheme(context),
darkTheme: AppTheme.buildReplyDarkTheme(context),
themeMode: ThemeMode.light,
initialRoute: LintingTool.homeRoute,
onGenerateRoute: (settings) {
switch (settings.name) {
case LintingTool.homeRoute:
return MaterialPageRoute<void>(
builder: (context) => const AdaptiveNav(),
settings: settings,
);
}
return null;
},
),
);
}
}