Unverified Commit b0e51db8 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Fixes for upcoming changes to avoid_classes_with_only_static_members (#86744)

parent f3d8562c
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter_gallery/demo/shrine/model/product.dart'; import 'package:flutter_gallery/demo/shrine/model/product.dart';
import 'package:flutter_gallery/demo/shrine/model/products_repository.dart'; import 'package:flutter_gallery/demo/shrine/model/products_repository.dart' as product_repository;
import 'package:scoped_model/scoped_model.dart'; import 'package:scoped_model/scoped_model.dart';
double _salesTaxRate = 0.06; double _salesTaxRate = 0.06;
...@@ -99,7 +99,7 @@ class AppStateModel extends Model { ...@@ -99,7 +99,7 @@ class AppStateModel extends Model {
// Loads the list of available products from the repo. // Loads the list of available products from the repo.
void loadProducts() { void loadProducts() {
_availableProducts = ProductsRepository.loadProducts(Category.all); _availableProducts = product_repository.loadProducts(Category.all);
notifyListeners(); notifyListeners();
} }
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
import 'package:flutter_gallery/demo/shrine/model/product.dart'; import 'package:flutter_gallery/demo/shrine/model/product.dart';
class ProductsRepository { List<Product> loadProducts(Category category) {
static List<Product> loadProducts(Category category) {
const List<Product> allProducts = <Product>[ const List<Product> allProducts = <Product>[
Product( Product(
category: Category.accessories, category: Category.accessories,
...@@ -279,5 +278,4 @@ class ProductsRepository { ...@@ -279,5 +278,4 @@ class ProductsRepository {
} else { } else {
return allProducts.where((Product p) => p.category == category).toList(); return allProducts.where((Product p) => p.category == category).toList();
} }
}
} }
...@@ -83,6 +83,10 @@ Future<PortForwarder> _dummyPortForwardingFunction( ...@@ -83,6 +83,10 @@ Future<PortForwarder> _dummyPortForwardingFunction(
/// `FUCHSIA_SSH_CONFIG` variables must be set. If run on a Fuchsia device, will /// `FUCHSIA_SSH_CONFIG` variables must be set. If run on a Fuchsia device, will
/// connect locally without need for environment variables. /// connect locally without need for environment variables.
class FuchsiaCompat { class FuchsiaCompat {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
FuchsiaCompat._();
static void _init() { static void _init() {
fuchsiaPortForwardingFunction = _dummyPortForwardingFunction; fuchsiaPortForwardingFunction = _dummyPortForwardingFunction;
} }
......
...@@ -26,6 +26,10 @@ String _keyLabel(LogicalKeyboardKey key) { ...@@ -26,6 +26,10 @@ String _keyLabel(LogicalKeyboardKey key) {
/// A class that serves as a namespace for a bunch of keyboard-key generation /// A class that serves as a namespace for a bunch of keyboard-key generation
/// utilities. /// utilities.
class KeyEventSimulator { class KeyEventSimulator {
// This class is not meant to be instantiated or extended; this constructor
// prevents instantiation and extension.
KeyEventSimulator._();
// Look up a synonym key, and just return the left version of it. // Look up a synonym key, and just return the left version of it.
static LogicalKeyboardKey _getKeySynonym(LogicalKeyboardKey origKey) { static LogicalKeyboardKey _getKeySynonym(LogicalKeyboardKey origKey) {
if (origKey == LogicalKeyboardKey.shift) { if (origKey == LogicalKeyboardKey.shift) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment