Коммит 9b0a69d3 создал по автору Красавин Никита Сергеевич's avatar Красавин Никита Сергеевич
Просмотр файлов

move from flutter-plugins repo

владелец a3293fa0
## Updated: 05/29/2024 17:26:25 PM
## Info
- Last tag: google_fonts-0.5.0
- Released: 1
## Versions
- Version: google_fonts-0.5.0 (24/04/2024)
### Version: google_fonts-0.5.0 (24/04/2024)
#### Feature
- Add example application.
# google_fonts
Plugin support [google_fonts](https://pub.dev/packages/google_fonts).
The use of the `google_fonts` plugin in the Aurora OS ecosystem is supported.
The plugin depends on a platform-dependent plugin, that is, it itself is platform-dependent.
But implementation is not required.
## Usage
You have to include `path_provider` & `path_provider_aurora`
alongside `google_fonts` as dependencies in your `pubspec.yaml` file.
**pubspec.yaml**
```yaml
dependencies:
google_fonts: ^6.1.0
path_provider: ^2.0.15
path_provider_aurora:
git:
url: https://gitlab.com/omprussia/flutter/flutter-plugins.git
ref: path_provider_aurora-0.5.1
path: packages/path_provider/path_provider_aurora
```
***.desktop**
```desktop
Permissions=UserDirs;Internet
```
***.dart**
```dart
/// Import GoogleFonts
import 'package:google_fonts/google_fonts.dart';
/// To use GoogleFonts with the default TextStyle
Text(
'This is Google Fonts',
style: GoogleFonts.lato(),
);
```
## Application configuration file Changeln
## Version config: 0.0.2
## Comment tags by which they will be searched
## and groups by which they will be analyzed.
commits:
Bug: '[google_fonts][bug]'
Change: '[google_fonts][change]'
Feature: '[google_fonts][feature]'
## Path to mako template
template: ../../.changeln/changeln.mako
## Regular expression to break the comment into groups
## to format the comment output in the changelog in the
## "regex" variable.
##
## The empty value is not used.
parse: ''
## Filter tags using regular expressions
##
## The empty value is not used.
filter: '^((?!google_fonts).)*$'
# 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
# Aurora generated
/aurora/flutter
# Google fonts
Demonstrates how to use the `google_fonts` plugin.
## Usage
Get dependency
```shell
flutter-aurora pub get
```
Build aurora application
```shell
flutter-aurora build aurora --release
```
# SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
# SPDX-License-Identifier: BSD-3-Clause
include: package:flutter_lints/flutter.yaml
# SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.10)
project(ru.auroraos.google_fonts_example LANGUAGES CXX)
include(GNUInstallDirs)
set(BINARY_NAME ${CMAKE_PROJECT_NAME})
set(FLUTTER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/flutter)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_SKIP_RPATH OFF)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../share/${BINARY_NAME}/lib")
find_package(PkgConfig REQUIRED)
pkg_check_modules(FlutterEmbedder REQUIRED IMPORTED_TARGET flutter-embedder)
add_executable(${BINARY_NAME} main.cpp ${FLUTTER_DIR}/generated_plugin_registrant.cpp)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::FlutterEmbedder)
target_include_directories(${BINARY_NAME} PRIVATE ${FLUTTER_DIR})
include(flutter/generated_plugins.cmake)
set(PACKAGE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/${BINARY_NAME})
set(DESKTOP_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/applications)
set(ICONS_INSTALL_ROOT_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor)
add_custom_command(TARGET ${BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libflutter-embedder.so
${PROJECT_BINARY_DIR}/bundle/lib/libflutter-embedder.so)
install(FILES ${PROJECT_BINARY_DIR}/bundle/icudtl.dat DESTINATION ${PACKAGE_INSTALL_DIR})
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/flutter_assets DESTINATION ${PACKAGE_INSTALL_DIR})
install(DIRECTORY ${PROJECT_BINARY_DIR}/bundle/lib DESTINATION ${PACKAGE_INSTALL_DIR})
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES desktop/${BINARY_NAME}.desktop DESTINATION ${DESKTOP_INSTALL_DIR})
foreach(ICONS_SIZE 86x86 108x108 128x128 172x172)
install(FILES icons/${ICONS_SIZE}.png
RENAME ${BINARY_NAME}.png
DESTINATION ${ICONS_INSTALL_ROOT_DIR}/${ICONS_SIZE}/apps/)
endforeach(ICONS_SIZE)
[Desktop Entry]
Type=Application
Name=Google fonts
Comment=The Aurora OS example of google_fonts.
Icon=ru.auroraos.google_fonts_example
Exec=/usr/bin/ru.auroraos.google_fonts_example
X-Nemo-Application-Type=silica-qt5
[X-Application]
Permissions=UserDirs;Internet
OrganizationName=ru.auroraos
ApplicationName=google_fonts_example
/**
* SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <flutter/flutter_aurora.h>
#include "generated_plugin_registrant.h"
int main(int argc, char* argv[]) {
aurora::Initialize(argc, argv);
aurora::RegisterPlugins();
aurora::Launch();
return 0;
}
%global __provides_exclude_from ^%{_datadir}/%{name}/lib/.*$
%global __requires_exclude ^lib(dconf|flutter-embedder|maliit-glib|.+_platform_plugin)\\.so.*$
Name: ru.auroraos.google_fonts_example
Summary: Demonstrates how to use the google_fonts plugin.
Version: 0.1.0
Release: 1
License: BSD 3-Clause
Source0: %{name}-%{version}.tar.zst
BuildRequires: cmake
BuildRequires: ninja
%description
%{summary}.
%prep
%autosetup
%build
%cmake -GNinja -DCMAKE_BUILD_TYPE=%{_flutter_build_type} -DPSDK_VERSION=%{_flutter_psdk_version} -DPSDK_MAJOR=%{_flutter_psdk_major}
%ninja_build
%install
%ninja_install
%files
%{_bindir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
// SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:internal_aurora/list_item_info.dart';
import 'package:internal_aurora/list_separated.dart';
import 'package:internal_aurora/theme/colors.dart';
import 'package:internal_aurora/theme/theme.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: internalTheme,
home: Scaffold(
appBar: AppBar(
title: Text('Google fonts'.toUpperCase()),
),
body: ListSeparated(
children: [
const ListItemInfo("""
A Flutter package to use fonts from fonts.google.com.
"""),
TextBlock(
color: InternalColors.orange,
child: Text(
'Example text using GoogleFonts styles.',
style: GoogleFonts.roboto(
textStyle: const TextStyle(
fontSize: 16,
),
),
),
),
TextBlock(
color: InternalColors.green,
child: Text(
'Example text using GoogleFonts styles.',
style: GoogleFonts.oswald(
textStyle: const TextStyle(
fontSize: 16,
),
),
),
),
TextBlock(
color: InternalColors.blue,
child: Text(
'Example text using GoogleFonts styles.',
style: GoogleFonts.rubik(
textStyle: const TextStyle(
fontSize: 16,
),
),
),
),
TextBlock(
color: InternalColors.pink,
child: Text(
'Example text using GoogleFonts styles.',
style: GoogleFonts.singleDay(
textStyle: const TextStyle(
fontSize: 16,
),
),
),
),
TextBlock(
color: InternalColors.grey,
child: Text(
'Example text using GoogleFonts styles.',
style: GoogleFonts.quicksand(
textStyle: const TextStyle(
fontSize: 16,
),
),
),
),
],
),
),
);
}
}
class TextBlock extends StatelessWidget {
const TextBlock({super.key, required this.color, required this.child});
final Color color;
final Widget child;
@override
Widget build(BuildContext context) {
return Card(
surfaceTintColor: color,
child: SizedBox(
width: double.infinity,
child: Padding(padding: const EdgeInsets.all(16), child: child),
),
);
}
}
# SPDX-FileCopyrightText: Copyright 2024 Open Mobile Platform LLC <community@omp.ru>
# SPDX-License-Identifier: BSD-3-Clause
name: google_fonts_example
description: "The Aurora OS example of google_fonts."
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=3.2.2 <4.0.0'
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
internal_aurora:
path: ../../internal_aurora
google_fonts: ^5.1.0
path_provider: ^2.0.15
path_provider_aurora:
path: ../../path_provider/path_provider_aurora
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
flutter:
uses-material-design: true
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать