Skip to content

Commit

Permalink
Add ResourcesScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
anhappdev committed Nov 6, 2024
1 parent eb7d741 commit 1e24327
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions flutter/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"menuHome": "MLPerf Mobile",
"menuHistory": "History",
"menuSettings": "Settings",
"menuResources": "Resources",
"menuAbout": "About",
"menuProfile": "Profile",
"menuSignIn": "Sign In",
Expand Down
14 changes: 14 additions & 0 deletions flutter/lib/ui/home/app_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:mlperfbench/ui/history/history_list_screen.dart';
import 'package:mlperfbench/ui/home/user_profile.dart';
import 'package:mlperfbench/ui/settings/about_screen.dart';
import 'package:mlperfbench/ui/settings/settings_screen.dart';
import 'package:mlperfbench/ui/settings/resources_screen.dart';

class AppDrawer extends StatelessWidget {
const AppDrawer({super.key});
Expand Down Expand Up @@ -104,6 +105,19 @@ class AppDrawer extends StatelessWidget {
);
},
),
ListTile(
leading: const Icon(Icons.file_present),
title: Text(l10n.menuResources),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const ResourcesScreen(),
),
);
},
),
ListTile(
leading: const Icon(Icons.info),
title: Text(l10n.menuAbout),
Expand Down
53 changes: 53 additions & 0 deletions flutter/lib/ui/settings/resources_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'dart:io';

import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:mlperfbench/app_constants.dart';
import 'package:mlperfbench/benchmark/run_mode.dart';
import 'package:mlperfbench/benchmark/state.dart';
import 'package:mlperfbench/build_info.dart';
import 'package:mlperfbench/firebase/firebase_manager.dart';
import 'package:mlperfbench/localizations/app_localizations.dart';
import 'package:mlperfbench/resources/config_manager.dart';
import 'package:mlperfbench/store.dart';
import 'package:mlperfbench/ui/app_styles.dart';
import 'package:mlperfbench/ui/confirm_dialog.dart';
import 'package:mlperfbench/ui/settings/task_config_section.dart';

class ResourcesScreen extends StatefulWidget {
const ResourcesScreen({super.key});

@override
State<ResourcesScreen> createState() => _ResourcesScreen();
}

class _ResourcesScreen extends State<ResourcesScreen> {
late AppLocalizations l10n;
late BenchmarkState state;
late Store store;

@override
Widget build(BuildContext context) {
store = context.watch<Store>();
state = context.watch<BenchmarkState>();
l10n = AppLocalizations.of(context)!;

return Scaffold(
appBar: AppBar(title: Text(l10n.menuResources)),
body: SafeArea(
child: ListView(
padding: const EdgeInsets.only(top: 20),
children: [
_mainSection(),
const Divider(),
const SizedBox(height: 20)
],
)));
}

Widget _mainSection() {
return const Text('data');
}
}

0 comments on commit 1e24327

Please sign in to comment.