Size: a a a

Dart & Flutter по-русски

2020 December 13

А

Алекс in Dart & Flutter по-русски
Приветствую. Подскажите есть ли какой-то механизм по ожиданию результата от future переменной в обычной функции? Некий аналог await в async функции. Then не подходит так как выполнение кода идет далее без ожидания результата. А переделывать всю цепочку вызовов на async не хотелось бы. Нашел функцию waitFor, но, что-то не получилось ее использовать в webdev.
источник

GV

Gorohov Valeriy in Dart & Flutter по-русски
Миша
Ребят, крч, эта кнопка при создании класса от скэффолда создается автоматически, можно ли ей как-то присвоить значение, чтобы она возвращала уже обновленную страницу?
leading нужно определить у AppBar
источник

М

Миша in Dart & Flutter по-русски
Gorohov Valeriy
leading нужно определить у AppBar
большое спасибо!
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
Коллеги почему runner может не генерировать файлы для freezed?
Выводит просто что-то типа action и все, сами файлы не появляются :(
[INFO] Succeeded after 551ms with 0 outputs (12 actions)
источник

lf

les forest in Dart & Flutter по-русски
Константин Буланов
Коллеги почему runner может не генерировать файлы для freezed?
Выводит просто что-то типа action и все, сами файлы не появляются :(
[INFO] Succeeded after 551ms with 0 outputs (12 actions)
А в логе что?
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
les forest
А в логе что?
Никаких ошибок нет. Одни инфо. И на этом все заканчивается.
источник

P

Pa_blooo in Dart & Flutter по-русски
мб баг какой
источник

lf

les forest in Dart & Flutter по-русски
Константин Буланов
Никаких ошибок нет. Одни инфо. И на этом все заканчивается.
Запусти с параметром —v
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
les forest
Запусти с параметром —v
Вообще ничего подозрительного.
PS C:\Project\temp\fl_test> flutter pub run build_runner build -v
[ +164 ms] executing: [c:\Soft\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +132 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] 78910062997c3a836feee883712c241a5fd22983
[   +1 ms] executing: [c:\Soft\flutter/] git tag --points-at HEAD
[ +116 ms] Exit code 0 from: git tag --points-at HEAD
[   +1 ms] 1.22.5
[  +11 ms] executing: [c:\Soft\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +89 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [c:\Soft\flutter/] git ls-remote --get-url origin
[  +78 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +131 ms] executing: [c:\Soft\flutter/] git rev-parse --abbrev-ref HEAD
[  +88 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +122 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[  +30 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[  +32 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[  +32 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +25 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[  +14 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[  +77 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[  +40 ms] executing: c:\Soft\flutter\bin\cache\dart-sdk\bin\pub.bat run build_runner build -v
[INFO] Generating build script...
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
les forest
Запусти с параметром —v

[INFO] Generating build script completed, took 548ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 20.5s

[INFO] BuildDefinition:Initializing inputs
[INFO] BuildDefinition:Building new asset graph...
[INFO] BuildDefinition:Building new asset graph completed, took 994ms

[INFO] BuildDefinition:Checking for unexpected pre-existing outputs....
[INFO] BuildDefinition:Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Build:Running build...
[INFO] Build:Running build completed, took 444ms

[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 83ms

[INFO] Build:Succeeded after 543ms with 0 outputs (5 actions)

[+25554 ms] "flutter run" took 25 841ms.
[ +101 ms] ensureAnalyticsSent: 93ms
[   +2 ms] Running shutdown hooks
[  +29 ms] Shutdown hooks complete
[   +1 ms] exiting with code 0
PS C:\Project\temp\fl_test>
источник

AC

Aleksey Chumikov in Dart & Flutter по-русски
В пабспек в дев не забыл генератор подрубить?
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
Aleksey Chumikov
В пабспек в дев не забыл генератор подрубить?
Нет конечно
dependencies:
 flutter:
   sdk: flutter
 flutter_bloc: ^6.1.0
 freezed_annotation: ^0.12.0

dev_dependencies:
 flutter_test:
   sdk: flutter
 freezed: ^0.12.5
 build_runner:
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
Вроде большие ничего ему не нужно. Я и не помню чтоб нужно было да и доки еще раз пересмотрел ничего не нашел что бы ему мешало генерировать.
источник

lf

les forest in Dart & Flutter по-русски
Константин Буланов

[INFO] Generating build script completed, took 548ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 20.5s

[INFO] BuildDefinition:Initializing inputs
[INFO] BuildDefinition:Building new asset graph...
[INFO] BuildDefinition:Building new asset graph completed, took 994ms

[INFO] BuildDefinition:Checking for unexpected pre-existing outputs....
[INFO] BuildDefinition:Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Build:Running build...
[INFO] Build:Running build completed, took 444ms

[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 83ms

[INFO] Build:Succeeded after 543ms with 0 outputs (5 actions)

[+25554 ms] "flutter run" took 25 841ms.
[ +101 ms] ensureAnalyticsSent: 93ms
[   +2 ms] Running shutdown hooks
[  +29 ms] Shutdown hooks complete
[   +1 ms] exiting with code 0
PS C:\Project\temp\fl_test>
Иногда бывает так что после генерации нужно обновить папку
источник

lf

les forest in Dart & Flutter по-русски
Студия не видит сгенер. файлы
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
les forest
Иногда бывает так что после генерации нужно обновить папку
Меня вот это смущает
[INFO] Heartbeat:5.8s elapsed, 0/5 actions completed.
[INFO] build_resolvers:Generating SDK summary completed, took 5.8s

Он просто не преступает к генерации. Видит что нужно сделать 5 и все. И двигает дальше не выполняя генерацию этих пяти.
источник

lf

les forest in Dart & Flutter по-русски
Не забыл part “yourclass. Freezed.dart”
источник

lf

les forest in Dart & Flutter по-русски
?
источник

КБ

Константин Буланов... in Dart & Flutter по-русски
les forest
Не забыл part “yourclass. Freezed.dart”
Никак нет. Его генератор фризед блока сам добавляет. Но я проверял что он есть :)
источник

EC

Evgeny Cherkasov in Dart & Flutter по-русски
Добавил виджет ActionButton в мой пакет UIC. https://pub.dev/packages/uic#actionbuttonactionbutton. Это обертка на стандартными кнопками, которая позволяет показывать прогресс, пока действие по кнопке выполняется.
источник