mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
add web_dashboard API (#333)
* add web_dashboard sample * add docs * address code review comments * restructure web_dashboard * set up provider and mock service * add copyright headers, use relative imports * add API class, add tests * fmt * rename services -> API, remove data library * use new API in app * add stream to items api * convert from StreamBuilder to StreamProvider * add subscription to Entry API * rename API classes * address comments * Update README.md * update README * remove routing_demo
This commit is contained in:
25
experimental/web_dashboard/lib/src/app.dart
Normal file
25
experimental/web_dashboard/lib/src/app.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2020, the Flutter project authors. Please see the AUTHORS file
|
||||
// for details. 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:provider/provider.dart';
|
||||
|
||||
import 'pages/home.dart';
|
||||
import 'api/api.dart';
|
||||
import 'api/mock.dart';
|
||||
|
||||
/// An app that shows a responsive dashboard.
|
||||
class DashboardApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
Provider<DashboardApi>(create: (_) => MockDashboardApi()),
|
||||
],
|
||||
child: MaterialApp(
|
||||
home: HomePage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user