added basic navigation to settings

This commit is contained in:
Vadim 2022-10-30 22:07:39 +03:00
parent 6dd0a9b192
commit 4696b7d2ee
4 changed files with 13 additions and 18 deletions

View file

@ -7,7 +7,6 @@ import 'models/photography_value.dart';
import 'res/theme.dart';
import 'screens/metering/metering_bloc.dart';
import 'screens/metering/metering_screen.dart';
import 'screens/settings/settings_screen.dart';
import 'utils/stop_type_provider.dart';
void main() {
@ -35,7 +34,7 @@ class MyApp extends StatelessWidget {
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: S.delegate.supportedLocales,
home: const SettingsScreen(),
home: const MeteringScreen(),
),
),
);

View file

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/metering_event.dart';
import 'package:lightmeter/screens/settings/settings_screen.dart';
import 'components/bottom_controls/bottom_controls.dart';
import 'components/exposure_pairs_list/exposure_pairs_list.dart';
@ -45,7 +46,7 @@ class MeteringScreen extends StatelessWidget {
MeteringBottomControls(
onSourceChanged: () {},
onMeasure: () => context.read<MeteringBloc>().add(const MeasureEvent()),
onSettings: () {},
onSettings: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SettingsScreen())),
),
],
);

View file

@ -1,12 +0,0 @@
import 'package:flutter/material.dart';
class StopTypeTile extends StatelessWidget {
const StopTypeTile({super.key});
@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(Icons.rule),
);
}
}

View file

@ -16,7 +16,7 @@ class SettingsScreen extends StatelessWidget {
slivers: <Widget>[
SliverAppBar(
pinned: true,
leading: null,
automaticallyImplyLeading: false,
expandedHeight: 160.0,
flexibleSpace: FlexibleSpaceBar(
centerTitle: false,
@ -28,12 +28,19 @@ class SettingsScreen extends StatelessWidget {
),
actions: [
IconButton(
onPressed: () {},
onPressed: Navigator.of(context).pop,
icon: const Icon(Icons.close),
),
],
),
SliverList(delegate: SliverChildListDelegate([CaffeineListTile(), HapticsListTile()])),
SliverList(
delegate: SliverChildListDelegate(
[
const CaffeineListTile(),
const HapticsListTile(),
],
),
),
],
),
);