1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00
Files
samples/next_gen_ui_demo/lib/assets.dart
Brett Morgan aec29f869b Next Gen UI demo (#1778)
First pass at a Next Generation UI demo app. The UI needs work, feedback
gratefully accepted.

## Pre-launch Checklist

- [x] I read the [Flutter Style Guide] _recently_, and have followed its
advice.
- [x] I signed the [CLA].
- [x] I read the [Contributors Guide].
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-devrel
channel on [Discord].

<!-- Links -->
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Contributors Guide]:
https://github.com/flutter/samples/blob/main/CONTRIBUTING.md
2023-05-17 12:45:47 +10:00

42 lines
1.7 KiB
Dart

// Copyright 2023 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui';
class AssetPaths {
/// Images
static const String _images = 'assets/images';
static const String titleBgBase = '$_images/bg-base.jpg';
static const String titleBgReceive = '$_images/bg-light-receive.png';
static const String titleFgEmit = '$_images/fg-light-emit.png';
static const String titleFgReceive = '$_images/fg-light-receive.png';
static const String titleFgBase = '$_images/fg-base.png';
static const String titleMgEmit = '$_images/mg-light-emit.png';
static const String titleMgReceive = '$_images/mg-light-receive.png';
static const String titleMgBase = '$_images/mg-base.png';
static const String titleStartBtn = '$_images/button-start.png';
static const String titleStartBtnHover = '$_images/button-start-hover.png';
static const String titleStartArrow = '$_images/button-start-arrow.png';
static const String titleSelectedLeft = '$_images/select-left.png';
static const String titleSelectedRight = '$_images/select-right.png';
static const String pulseParticle = '$_images/particle3.png';
/// Shaders
static const String _shaders = 'assets/shaders';
static const String orbShader = '$_shaders/orb_shader.frag';
static const String uiShader = '$_shaders/ui_glitch.frag';
}
typedef Shaders = ({FragmentShader orb, FragmentShader ui});
Future<Shaders> loadShaders() async => (
orb: (await _loadShader(AssetPaths.orbShader)),
ui: (await _loadShader(AssetPaths.uiShader)),
);
Future<FragmentShader> _loadShader(String path) async {
return (await FragmentProgram.fromAsset(path)).fragmentShader();
}