mirror of
https://github.com/ALEZ-DEV/Babylonia-terminal.git
synced 2026-03-21 21:58:52 +00:00
starting GUI
This commit is contained in:
parent
88b730f65f
commit
9aaf3a0672
49
babylonia_terminal_launcher/.gitignore
vendored
Normal file
49
babylonia_terminal_launcher/.gitignore
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Miscellaneous
|
||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
*.pyc
|
||||||
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.buildlog/
|
||||||
|
.history
|
||||||
|
.svn/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
|
# IntelliJ related
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
|
|
||||||
|
# Flutter/Dart/Pub related
|
||||||
|
**/doc/api/
|
||||||
|
**/ios/Flutter/.last_build_id
|
||||||
|
.dart_tool/
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
.pub-cache/
|
||||||
|
.pub/
|
||||||
|
/build/
|
||||||
|
|
||||||
|
# Symbolication related
|
||||||
|
app.*.symbols
|
||||||
|
|
||||||
|
# Obfuscation related
|
||||||
|
app.*.map.json
|
||||||
|
|
||||||
|
# Android Studio will place build artifacts here
|
||||||
|
/android/app/debug
|
||||||
|
/android/app/profile
|
||||||
|
/android/app/release
|
||||||
|
|
||||||
|
# Ignore platforms
|
||||||
|
/linux
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
/test
|
||||||
30
babylonia_terminal_launcher/.metadata
Normal file
30
babylonia_terminal_launcher/.metadata
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: "54e66469a933b60ddf175f858f82eaeb97e48c8d"
|
||||||
|
channel: "stable"
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
||||||
|
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
||||||
|
- platform: linux
|
||||||
|
create_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
||||||
|
base_revision: 54e66469a933b60ddf175f858f82eaeb97e48c8d
|
||||||
|
|
||||||
|
# User provided section
|
||||||
|
|
||||||
|
# List of Local paths (relative to this file) that should be
|
||||||
|
# ignored by the migrate tool.
|
||||||
|
#
|
||||||
|
# Files that are not part of the templates will be ignored by default.
|
||||||
|
unmanaged_files:
|
||||||
|
- 'lib/main.dart'
|
||||||
|
- 'ios/Runner.xcodeproj/project.pbxproj'
|
||||||
28
babylonia_terminal_launcher/analysis_options.yaml
Normal file
28
babylonia_terminal_launcher/analysis_options.yaml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
# The lint rules applied to this project can be customized in the
|
||||||
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||||
|
# included above or to enable additional rules. A list of all available lints
|
||||||
|
# and their documentation is published at https://dart.dev/lints.
|
||||||
|
#
|
||||||
|
# Instead of disabling a lint rule for the entire project in the
|
||||||
|
# section below, it can also be suppressed for a single line of code
|
||||||
|
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||||
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||||
|
# producing the lint.
|
||||||
|
rules:
|
||||||
|
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||||
|
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||||
|
|
||||||
|
# Additional information about this file can be found at
|
||||||
|
# https://dart.dev/guides/language/analysis-options
|
||||||
BIN
babylonia_terminal_launcher/assets/images/Lee6.png
Normal file
BIN
babylonia_terminal_launcher/assets/images/Lee6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
102
babylonia_terminal_launcher/lib/main.dart
Normal file
102
babylonia_terminal_launcher/lib/main.dart
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
import 'package:babylonia_terminal_launcher/screens/screens.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:yaru/theme.dart';
|
||||||
|
|
||||||
|
import './screens/screens.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
runApp(const BabyloniaLauncher());
|
||||||
|
}
|
||||||
|
|
||||||
|
class BabyloniaLauncher extends StatelessWidget {
|
||||||
|
const BabyloniaLauncher({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return YaruTheme(
|
||||||
|
builder: (context, yaru, child) => MaterialApp(
|
||||||
|
title: "Babylonia Terminal",
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
theme: yaru.theme,
|
||||||
|
darkTheme: yaru.darkTheme,
|
||||||
|
themeMode: ThemeMode.system,
|
||||||
|
highContrastTheme: yaruHighContrastLight,
|
||||||
|
highContrastDarkTheme: yaruHighContrastDark,
|
||||||
|
home: const Menu(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Menu extends StatefulWidget {
|
||||||
|
const Menu({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Menu> createState() => _MenuState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MenuState extends State<Menu> {
|
||||||
|
int _selectedIndex = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
List<Widget> items = Screens.drawerItem(
|
||||||
|
selectedIndex: _selectedIndex,
|
||||||
|
onSelected: (index) {
|
||||||
|
setState(() => _selectedIndex = index);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
items.insert(
|
||||||
|
0,
|
||||||
|
Center(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8.0,
|
||||||
|
horizontal: 50.0,
|
||||||
|
),
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/Lee6.png',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"Babylonia Terminal",
|
||||||
|
style: TextStyle(fontSize: 24),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
drawer: Drawer(
|
||||||
|
child: ListView(
|
||||||
|
children: items,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text("Babylonia Terminal"),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
body: Screens.getCurrent(_selectedIndex),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
babylonia_terminal_launcher/lib/screens/home_screen.dart
Normal file
27
babylonia_terminal_launcher/lib/screens/home_screen.dart
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HomeScreen extends StatelessWidget {
|
||||||
|
const HomeScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 50),
|
||||||
|
child: FilledButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const SizedBox(
|
||||||
|
width: 300,
|
||||||
|
height: 25,
|
||||||
|
child: Center(
|
||||||
|
child: Text("Download"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
36
babylonia_terminal_launcher/lib/screens/screens.dart
Normal file
36
babylonia_terminal_launcher/lib/screens/screens.dart
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import 'package:babylonia_terminal_launcher/screens/settings_screen.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:yaru/icons.dart';
|
||||||
|
|
||||||
|
import 'package:babylonia_terminal_launcher/screens/home_screen.dart';
|
||||||
|
|
||||||
|
class Screens {
|
||||||
|
static final screens = <Widget, (Widget, Widget, String)>{
|
||||||
|
const HomeScreen(): (
|
||||||
|
const Icon(YaruIcons.home_filled),
|
||||||
|
const Icon(YaruIcons.home),
|
||||||
|
'Home',
|
||||||
|
),
|
||||||
|
const SettingsScreen(): (
|
||||||
|
const Icon(YaruIcons.settings_filled),
|
||||||
|
const Icon(YaruIcons.settings),
|
||||||
|
'Settings',
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
static List<Widget> drawerItem(
|
||||||
|
{required Function(int) onSelected, required int selectedIndex}) =>
|
||||||
|
[
|
||||||
|
for (int i = 0; i < Screens.screens.values.length; i++)
|
||||||
|
ListTile(
|
||||||
|
selected: i == selectedIndex,
|
||||||
|
leading: i == selectedIndex
|
||||||
|
? Screens.screens.values.elementAt(i).$1
|
||||||
|
: Screens.screens.values.elementAt(i).$2,
|
||||||
|
title: Text(Screens.screens.values.elementAt(i).$3),
|
||||||
|
onTap: () => onSelected(i),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
static Widget getCurrent(int index) => Screens.screens.keys.toList()[index];
|
||||||
|
}
|
||||||
12
babylonia_terminal_launcher/lib/screens/settings_screen.dart
Normal file
12
babylonia_terminal_launcher/lib/screens/settings_screen.dart
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SettingsScreen extends StatelessWidget {
|
||||||
|
const SettingsScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return const Center(
|
||||||
|
child: Text('Settings screen'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
91
babylonia_terminal_launcher/pubspec.yaml
Normal file
91
babylonia_terminal_launcher/pubspec.yaml
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
name: babylonia_terminal_launcher
|
||||||
|
description: "A new Flutter project."
|
||||||
|
# The following line prevents the package from being accidentally published to
|
||||||
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
|
# The following defines the version and build number for your application.
|
||||||
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
|
# followed by an optional build number separated by a +.
|
||||||
|
# Both the version and the builder number may be overridden in flutter
|
||||||
|
# build by specifying --build-name and --build-number, respectively.
|
||||||
|
# In Android, build-name is used as versionName while build-number used as versionCode.
|
||||||
|
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
|
||||||
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
||||||
|
# Read more about iOS versioning at
|
||||||
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
|
version: 1.0.0+1
|
||||||
|
|
||||||
|
environment:
|
||||||
|
sdk: '>=3.3.4 <4.0.0'
|
||||||
|
|
||||||
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
|
# consider running `flutter pub upgrade --major-versions`. Alternatively,
|
||||||
|
# dependencies can be manually updated by changing the version numbers below to
|
||||||
|
# the latest version available on pub.dev. To see which dependencies have newer
|
||||||
|
# versions available, run `flutter pub outdated`.
|
||||||
|
dependencies:
|
||||||
|
flutter:
|
||||||
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
|
# The following adds the Cupertino Icons font to your application.
|
||||||
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
|
cupertino_icons: ^1.0.6
|
||||||
|
yaru: ^4.1.0
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
flutter_test:
|
||||||
|
sdk: flutter
|
||||||
|
|
||||||
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
|
# package. See that file for information about deactivating specific lint
|
||||||
|
# rules and activating additional ones.
|
||||||
|
flutter_lints: ^3.0.0
|
||||||
|
|
||||||
|
# For information on the generic Dart part of this file, see the
|
||||||
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
# The following section is specific to Flutter packages.
|
||||||
|
flutter:
|
||||||
|
|
||||||
|
# The following line ensures that the Material Icons font is
|
||||||
|
# included with your application, so that you can use the icons in
|
||||||
|
# the material Icons class.
|
||||||
|
uses-material-design: true
|
||||||
|
|
||||||
|
# To add assets to your application, add an assets section, like this:
|
||||||
|
assets:
|
||||||
|
- assets/images/Lee6.png
|
||||||
|
# - images/a_dot_ham.jpeg
|
||||||
|
|
||||||
|
# An image asset can refer to one or more resolution-specific "variants", see
|
||||||
|
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||||
|
|
||||||
|
# For details regarding adding assets from package dependencies, see
|
||||||
|
# https://flutter.dev/assets-and-images/#from-packages
|
||||||
|
|
||||||
|
# To add custom fonts to your application, add a fonts section here,
|
||||||
|
# in this "flutter" section. Each entry in this list should have a
|
||||||
|
# "family" key with the font family name, and a "fonts" key with a
|
||||||
|
# list giving the asset and other descriptors for the font. For
|
||||||
|
# example:
|
||||||
|
# fonts:
|
||||||
|
# - family: Schyler
|
||||||
|
# fonts:
|
||||||
|
# - asset: fonts/Schyler-Regular.ttf
|
||||||
|
# - asset: fonts/Schyler-Italic.ttf
|
||||||
|
# style: italic
|
||||||
|
# - family: Trajan Pro
|
||||||
|
# fonts:
|
||||||
|
# - asset: fonts/TrajanPro.ttf
|
||||||
|
# - asset: fonts/TrajanPro_Bold.ttf
|
||||||
|
# weight: 700
|
||||||
|
#
|
||||||
|
# For details regarding fonts from package dependencies,
|
||||||
|
# see https://flutter.dev/custom-fonts/#from-packages
|
||||||
Loading…
Reference in New Issue
Block a user