mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-08 00:45:13 +08:00
Make the bottom menu bar settings prettier
We now show how the bottom menu bar will look inside the settings. This is so much nicer. Later, I can add more options to configure exactly what icons are visible and what they do.
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gitjournal/settings.dart';
|
||||
import 'package:gitjournal/widgets/new_note_nav_bar.dart';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:gitjournal/screens/home_screen.dart';
|
||||
import 'package:gitjournal/settings.dart';
|
||||
|
||||
class BottomMenuBarSettings extends StatefulWidget {
|
||||
@override
|
||||
_BottomMenuBarSettingsState createState() => _BottomMenuBarSettingsState();
|
||||
@ -16,11 +18,8 @@ class _BottomMenuBarSettingsState extends State<BottomMenuBarSettings> {
|
||||
|
||||
var body = Column(
|
||||
children: [
|
||||
Center(
|
||||
child: NewNoteNavBar(
|
||||
onPressed: (_) {},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
bottomMenuBar(),
|
||||
const SizedBox(height: 16),
|
||||
SwitchListTile(
|
||||
title: Text(tr("settings.bottomMenuBar.enable")),
|
||||
@ -56,4 +55,31 @@ class _BottomMenuBarSettingsState extends State<BottomMenuBarSettings> {
|
||||
body: body,
|
||||
);
|
||||
}
|
||||
|
||||
Widget bottomMenuBar() {
|
||||
var theme = Theme.of(context);
|
||||
var mq = MediaQuery.of(context);
|
||||
|
||||
var homeScreen = Transform.scale(
|
||||
scale: 0.75,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(2.0),
|
||||
color: theme.accentColor.withAlpha(256 ~/ 10),
|
||||
child: Container(
|
||||
width: mq.size.width,
|
||||
height: mq.size.height,
|
||||
child: IgnorePointer(child: HomeScreen()),
|
||||
),
|
||||
),
|
||||
alignment: Alignment.bottomCenter,
|
||||
);
|
||||
|
||||
return ClipRect(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
heightFactor: 0.10,
|
||||
child: homeScreen,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:dynamic_theme/dynamic_theme.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:gitjournal/screens/settings_bottom_menu_bar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@ -11,6 +10,7 @@ import 'package:gitjournal/core/notes_folder_fs.dart';
|
||||
import 'package:gitjournal/features.dart';
|
||||
import 'package:gitjournal/screens/debug_screen.dart';
|
||||
import 'package:gitjournal/screens/feature_timeline_screen.dart';
|
||||
import 'package:gitjournal/screens/settings_bottom_menu_bar.dart';
|
||||
import 'package:gitjournal/screens/settings_editors.dart';
|
||||
import 'package:gitjournal/screens/settings_experimental.dart';
|
||||
import 'package:gitjournal/screens/settings_git_remote.dart';
|
||||
|
Reference in New Issue
Block a user