1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-11 07:18:15 +00:00

[Gallery] Fix directory structure (#312)

This commit is contained in:
Pierre-Louis
2020-02-05 20:11:54 +01:00
committed by GitHub
parent 082592e9a9
commit cee267cf88
762 changed files with 12 additions and 12 deletions

View File

@@ -0,0 +1,7 @@
// Copyright 2019 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';
typedef TextSpan CodeDisplayer(BuildContext context);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
// Copyright 2019 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';
class CodeStyle extends InheritedWidget {
const CodeStyle({
this.baseStyle,
this.numberStyle,
this.commentStyle,
this.keywordStyle,
this.stringStyle,
this.punctuationStyle,
this.classStyle,
this.constantStyle,
@required Widget child,
}) : super(child: child);
final TextStyle baseStyle;
final TextStyle numberStyle;
final TextStyle commentStyle;
final TextStyle keywordStyle;
final TextStyle stringStyle;
final TextStyle punctuationStyle;
final TextStyle classStyle;
final TextStyle constantStyle;
static CodeStyle of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<CodeStyle>();
}
@override
bool updateShouldNotify(CodeStyle oldWidget) =>
oldWidget.baseStyle != baseStyle ||
oldWidget.numberStyle != numberStyle ||
oldWidget.commentStyle != commentStyle ||
oldWidget.keywordStyle != keywordStyle ||
oldWidget.stringStyle != stringStyle ||
oldWidget.punctuationStyle != punctuationStyle ||
oldWidget.classStyle != classStyle ||
oldWidget.constantStyle != constantStyle;
}