нужно бы починить локализацию, а так хапи хапи

This commit is contained in:
mirain 2024-12-14 23:14:33 +03:00
parent b6990f63fc
commit 5171697023
15 changed files with 459 additions and 233 deletions

View File

@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.
version:
revision: "4cf269e36de2573851eaef3c763994f8f9be494d"
revision: "8495dee1fd4aacbe9de707e7581203232f591b2f"
channel: "stable"
project_type: app
@ -13,17 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
base_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: android
create_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
base_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: ios
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: linux
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: macos
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: web
create_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
base_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
- platform: windows
create_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
base_revision: 4cf269e36de2573851eaef3c763994f8f9be494d
create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f
# User provided section

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 64 KiB

5
assets/l10n/intl_en.arb Normal file
View File

@ -0,0 +1,5 @@
{
"appTitle": "My Application",
"likeButton": "Like",
"changeLanguage": "Change Language"
}

5
assets/l10n/intl_ru.arb Normal file
View File

@ -0,0 +1,5 @@
{
"appTitle": "Мое Приложение",
"likeButton": "Лайк",
"changeLanguage": "Сменить язык"
}

92
lib/generated/l10n.dart Normal file
View File

@ -0,0 +1,92 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'dart:async';
import 'package:identity/l10n/messages_all.dart';
class S {
S();
static S? _current;
static S get current {
assert(_current != null,
'No instance of S was loaded. Try to initialize the S delegate before accessing S.current.');
return _current!;
}
static const AppLocalizationDelegate delegate = AppLocalizationDelegate();
static Future<S> load(Locale locale) {
final name = locale.countryCode?.isEmpty ?? false
? locale.languageCode
: locale.toString();
final localeName = Intl.canonicalizedLocale(name);
Intl.defaultLocale = localeName;
return initializeMessages(localeName).then((_) {
final instance = S();
S._current = instance;
return instance;
});
}
static S of(BuildContext context) {
final instance = S.maybeOf(context);
assert(instance != null,
'No instance of S present in the widget tree. Did you add S.delegate in localizationsDelegates?');
return instance!;
}
static S? maybeOf(BuildContext context) {
return Localizations.of<S>(context, S);
}
// Translations
String get appTitle {
return Intl.message(
'My Application',
name: 'appTitle',
desc: '',
args: [],
);
}
String get likeButton {
return Intl.message(
'Like',
name: 'likeButton',
desc: '',
args: [],
);
}
String get changeLanguage {
return Intl.message(
'Change Language',
name: 'changeLanguage',
desc: '',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
const AppLocalizationDelegate();
@override
bool isSupported(Locale locale) {
return <String>['en', 'ru'].contains(locale.languageCode);
}
@override
Future<S> load(Locale locale) {
return S.load(locale);
}
@override
bool shouldReload(covariant LocalizationsDelegate<S> old) {
return false;
}
}

7
lib/l10n/intl_en.arb Normal file
View File

@ -0,0 +1,7 @@
{
"appTitle": "My Application",
"likeButton": "Like",
"changeLanguage": "Change Language",
"errorMessage": "{message}",
"noData": "No data"
}

7
lib/l10n/intl_ru.arb Normal file
View File

@ -0,0 +1,7 @@
{
"appTitle": "Мое Приложение",
"likeButton": "Лайк",
"changeLanguage": "Сменить язык",
"errorMessage": "{message}",
"noData": "Нет данных"
}

View File

@ -1,13 +1,22 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'bloc/bloc.dart';
import 'bloc/events.dart';
import 'bloc/state.dart';
import 'utils/character_service.dart';
import 'models/character.dart';
import 'pages/character_detail_page.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'l10n/messages_all.dart'; // Обновите на путь к сгенерированным локализациям
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Load saved language preference
final prefs = await SharedPreferences.getInstance();
final savedLocale = prefs.getString('locale') ?? 'en';
void main() {
runApp(
MultiBlocProvider(
providers: [
@ -18,26 +27,72 @@ void main() {
create: (_) => DebouncedSearchCubit(),
),
],
child: MyApp(),
child: MyApp(savedLocale: savedLocale),
),
);
}
class MyApp extends StatefulWidget {
final String savedLocale;
const MyApp({required this.savedLocale, super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
late Locale _locale;
@override
void initState() {
super.initState();
_locale = Locale(widget.savedLocale);
}
void _changeLanguage(String languageCode) async {
setState(() {
_locale = Locale(languageCode);
});
// Save selected language to preferences
final prefs = await SharedPreferences.getInstance();
prefs.setString('locale', languageCode);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'My App',
home: MyHomePage(title: 'Identity'),
localizationsDelegates: [
S.delegate, // Используйте сгенерированные локализации
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('en', ''),
const Locale('ru', ''),
],
locale: _locale,
localeResolutionCallback: (locale, supportedLocales) {
return supportedLocales.contains(locale) ? locale : const Locale('en');
},
home: MyHomePage(
title: S.of(context).appTitle, // Локализованная строка
onLanguageChanged: _changeLanguage,
),
);
}
}
class MyHomePage extends StatelessWidget {
final String title;
final Function(String) onLanguageChanged;
MyHomePage({required this.title});
const MyHomePage({
required this.title,
required this.onLanguageChanged,
super.key,
});
@override
Widget build(BuildContext context) {
@ -47,8 +102,24 @@ class MyHomePage extends StatelessWidget {
appBar: AppBar(
title: Text(title),
actions: [
PopupMenuButton<String>(
onSelected: (languageCode) {
onLanguageChanged(languageCode);
},
icon: const Icon(Icons.language),
itemBuilder: (context) => [
PopupMenuItem(
value: 'en',
child: Text(S.of(context).languageEnglish),
),
PopupMenuItem(
value: 'ru',
child: Text(S.of(context).languageRussian),
),
],
),
IconButton(
icon: Icon(Icons.search),
icon: const Icon(Icons.search),
onPressed: () {
showSearch(
context: context,
@ -61,9 +132,9 @@ class MyHomePage extends StatelessWidget {
body: BlocBuilder<HomeBloc, HomeState>(
builder: (context, state) {
if (state.status == HomeStatus.loading) {
return Center(child: CircularProgressIndicator());
return const Center(child: CircularProgressIndicator());
} else if (state.status == HomeStatus.error) {
return Center(child: Text('Ошибка: ${state.errorMessage}'));
return Center(child: Text(S.of(context).errorMessage(state.errorMessage)));
} else if (state.status == HomeStatus.loaded) {
final characters = state.characters;
@ -77,13 +148,12 @@ class MyHomePage extends StatelessWidget {
child: Image.network(characterDTO.imageUrl, width: 50, height: 50),
),
title: Text(characterDTO.name),
subtitle: Text(characterDTO.typeString), // Используем typeString из CharacterDTO
subtitle: Text(characterDTO.typeString),
onTap: () {
// Переход на страницу с деталями персонажа, передаем CharacterDTO
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CharacterDetailPage(characterDTO: characterDTO), // Передаем CharacterDTO
builder: (context) => CharacterDetailPage(characterDTO: characterDTO),
),
);
},
@ -91,123 +161,10 @@ class MyHomePage extends StatelessWidget {
},
);
} else {
return Center(child: Text('Нет данных.'));
return Center(child: Text(S.of(context).noData));
}
},
),
);
}
}
class CharacterSearchDelegate extends SearchDelegate {
@override
Widget buildSuggestions(BuildContext context) {
return BlocProvider<HomeBloc>(
create: (context) => HomeBloc(CharacterService()),
child: BlocBuilder<HomeBloc, HomeState>(
builder: (context, state) {
final suggestions = state.characters
.where((character) => character.name.toLowerCase().contains(query.toLowerCase()))
.toList();
return ListView.builder(
itemCount: suggestions.length,
itemBuilder: (context, index) {
final character = suggestions[index]; // Используем правильный тип
return ListTile(
title: Text(character.name),
subtitle: Text(character.typeString),
onTap: () {
// Переход на страницу с деталями персонажа
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CharacterDetailPage(characterDTO: character), // Передаем правильный параметр
),
);
},
);
},
);
},
),
);
}
@override
Widget buildResults(BuildContext context) {
final debouncedSearchCubit = context.read<DebouncedSearchCubit>();
debouncedSearchCubit.search(query);
return BlocBuilder<DebouncedSearchCubit, String>(
builder: (context, searchQuery) {
if (searchQuery.isNotEmpty) {
context.read<HomeBloc>().add(HomeLoadDataEvent(searchQuery: searchQuery));
}
return BlocBuilder<HomeBloc, HomeState>(
builder: (context, state) {
if (state.status == HomeStatus.loading) {
return Center(child: CircularProgressIndicator());
} else if (state.status == HomeStatus.error) {
return Center(child: Text('Ошибка: ${state.errorMessage}'));
} else if (state.status == HomeStatus.loaded) {
final characters = state.characters
.where((character) => character.name.toLowerCase().contains(searchQuery.toLowerCase()))
.toList();
return ListView.builder(
itemCount: characters.length,
itemBuilder: (context, index) {
final characterDTO = characters[index]; // Здесь определяем characterDTO
return ListTile(
leading: SizedBox(
width: 40,
child: Image.network(characterDTO.imageUrl, width: 50, height: 50),
),
title: Text(characterDTO.name),
subtitle: Text(characterDTO.typeString), // Используем typeString
onTap: () {
// Переход на страницу с деталями персонажа
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CharacterDetailPage(characterDTO: characterDTO), // Передаем characterDTO
),
);
},
);
}
);
} else {
return Center(child: Text('Нет результатов'));
}
},
);
},
);
}
@override
List<Widget> buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = '';
showSuggestions(context);
},
),
];
}
@override
Widget buildLeading(BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
close(context, null);
},
);
}
}

View File

@ -1,6 +1,43 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
url: "https://pub.dev"
source: hosted
version: "76.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
url: "https://pub.dev"
source: hosted
version: "6.11.0"
archive:
dependency: transitive
description:
name: archive
sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8"
url: "https://pub.dev"
source: hosted
version: "4.0.1"
args:
dependency: transitive
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.dev"
source: hosted
version: "2.6.0"
async:
dependency: transitive
description:
@ -33,6 +70,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
url: "https://pub.dev"
source: hosted
version: "2.0.3"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c
url: "https://pub.dev"
source: hosted
version: "0.4.2"
clock:
dependency: transitive
description:
@ -45,10 +98,26 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.dev"
source: hosted
version: "3.1.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
cupertino_icons:
dependency: "direct main"
description:
@ -57,6 +126,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.8"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab"
url: "https://pub.dev"
source: hosted
version: "2.3.7"
equatable:
dependency: "direct main"
description:
@ -102,14 +179,27 @@ packages:
url: "https://pub.dev"
source: hosted
version: "8.1.6"
flutter_launcher_icons:
dependency: "direct dev"
description:
name: flutter_launcher_icons
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
url: "https://pub.dev"
source: hosted
version: "0.13.1"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "2.0.3"
flutter_localizations:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
@ -120,6 +210,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
http:
dependency: "direct main"
description:
@ -132,26 +230,58 @@ packages:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.1.1"
image:
dependency: transitive
description:
name: image
sha256: "599d08e369969bdf83138f5b4e0a7e823d3f992f23b8a64dd626877c37013533"
url: "https://pub.dev"
source: hosted
version: "4.4.0"
intl:
dependency: "direct main"
description:
name: intl
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.19.0"
intl_translation:
dependency: "direct main"
description:
name: intl_translation
sha256: b3f1ebfab4109d1a946b45c57523628da92a0e2a2df5f2d9981ef4334fd24a26
url: "https://pub.dev"
source: hosted
version: "0.20.1"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
@ -164,10 +294,18 @@ packages:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "2.1.1"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
@ -200,6 +338,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path:
dependency: transitive
description:
@ -232,6 +378,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.0"
petitparser:
dependency: transitive
description:
name: petitparser
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.dev"
source: hosted
version: "6.0.2"
platform:
dependency: transitive
description:
@ -248,6 +402,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
posix:
dependency: transitive
description:
name: posix
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
url: "https://pub.dev"
source: hosted
version: "6.0.1"
provider:
dependency: transitive
description:
@ -256,6 +418,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.2"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
shared_preferences:
dependency: "direct main"
description:
@ -268,18 +438,18 @@ packages:
dependency: transitive
description:
name: shared_preferences_android
sha256: "7f172d1b06de5da47b6264c2692ee2ead20bbbc246690427cdb4fc301cd0c549"
sha256: "02a7d8a9ef346c9af715811b01fbd8e27845ad2c41148eefd31321471b41863d"
url: "https://pub.dev"
source: hosted
version: "2.3.4"
version: "2.4.0"
shared_preferences_foundation:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
url: "https://pub.dev"
source: hosted
version: "2.5.3"
version: "2.5.4"
shared_preferences_linux:
dependency: transitive
description:
@ -316,7 +486,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_span:
dependency: transitive
description:
@ -329,10 +499,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
@ -345,10 +515,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
term_glyph:
dependency: transitive
description:
@ -361,10 +531,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
typed_data:
dependency: transitive
description:
@ -385,10 +555,18 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
@ -405,6 +583,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
xml:
dependency: transitive
description:
name: xml
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
url: "https://pub.dev"
source: hosted
version: "6.5.0"
yaml:
dependency: transitive
description:
name: yaml
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.5.2 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"

View File

@ -1,96 +1,47 @@
name: identity
description: A new Flutter project.
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
publish_to: 'none' # Указывает, что проект не публикуется в 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.5.2
sdk: ">=3.5.0 <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
flutter_localizations:
sdk: flutter
intl: ^0.19.0
http: ^1.2.2
equatable: ^2.0.5
flutter_bloc: ^8.1.5
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
shared_preferences: ^2.3.3
cupertino_icons: ^1.0.8
intl_translation: ^0.20.1
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: ^4.0.0
flutter_lints: ^2.0.0
flutter_launcher_icons: ^0.13.1
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
flutter_icons:
android: true
ios: true
image_path: "assets/icon/app_icon.png"
remove_alpha_ios: true
# The following section is specific to Flutter packages.
flutter:
assets:
- assets/images/
# 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
generate: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# 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/to/font-from-package
assets:
- assets/icon/app_icon.png
- assets/images/

View File

@ -13,7 +13,6 @@ import 'package:identity/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);