mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 00:40:39 +00:00
added basic navigation to settings
This commit is contained in:
parent
6dd0a9b192
commit
4696b7d2ee
4 changed files with 13 additions and 18 deletions
|
@ -7,7 +7,6 @@ import 'models/photography_value.dart';
|
||||||
import 'res/theme.dart';
|
import 'res/theme.dart';
|
||||||
import 'screens/metering/metering_bloc.dart';
|
import 'screens/metering/metering_bloc.dart';
|
||||||
import 'screens/metering/metering_screen.dart';
|
import 'screens/metering/metering_screen.dart';
|
||||||
import 'screens/settings/settings_screen.dart';
|
|
||||||
import 'utils/stop_type_provider.dart';
|
import 'utils/stop_type_provider.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -35,7 +34,7 @@ class MyApp extends StatelessWidget {
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
],
|
],
|
||||||
supportedLocales: S.delegate.supportedLocales,
|
supportedLocales: S.delegate.supportedLocales,
|
||||||
home: const SettingsScreen(),
|
home: const MeteringScreen(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
import 'package:lightmeter/res/dimens.dart';
|
||||||
import 'package:lightmeter/screens/metering/metering_event.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/bottom_controls/bottom_controls.dart';
|
||||||
import 'components/exposure_pairs_list/exposure_pairs_list.dart';
|
import 'components/exposure_pairs_list/exposure_pairs_list.dart';
|
||||||
|
@ -45,7 +46,7 @@ class MeteringScreen extends StatelessWidget {
|
||||||
MeteringBottomControls(
|
MeteringBottomControls(
|
||||||
onSourceChanged: () {},
|
onSourceChanged: () {},
|
||||||
onMeasure: () => context.read<MeteringBloc>().add(const MeasureEvent()),
|
onMeasure: () => context.read<MeteringBloc>().add(const MeasureEvent()),
|
||||||
onSettings: () {},
|
onSettings: () => Navigator.push(context, MaterialPageRoute(builder: (_) => const SettingsScreen())),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -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),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -16,7 +16,7 @@ class SettingsScreen extends StatelessWidget {
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
pinned: true,
|
pinned: true,
|
||||||
leading: null,
|
automaticallyImplyLeading: false,
|
||||||
expandedHeight: 160.0,
|
expandedHeight: 160.0,
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
|
@ -28,12 +28,19 @@ class SettingsScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {},
|
onPressed: Navigator.of(context).pop,
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SliverList(delegate: SliverChildListDelegate([CaffeineListTile(), HapticsListTile()])),
|
SliverList(
|
||||||
|
delegate: SliverChildListDelegate(
|
||||||
|
[
|
||||||
|
const CaffeineListTile(),
|
||||||
|
const HapticsListTile(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue