1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

[linting_tool] Add Adaptive Layout with Theming (#852)

This commit is contained in:
Abdullah Deshmukh
2021-07-14 03:01:14 +05:30
committed by GitHub
parent 35f1670098
commit 8e73c73f4b
25 changed files with 984 additions and 80 deletions

View File

@@ -0,0 +1,40 @@
// Copyright 2021 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.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;
class LintingTool extends StatefulWidget {
const LintingTool({Key? key}) : super(key: key);
static const String homeRoute = routes.homeRoute;
@override
_LintingToolState createState() => _LintingToolState();
}
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;
},
);
}
}