Giter VIP home page Giter VIP logo

brook's Introduction

brook

Music app

B站视频

Run

flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
flutter run --release --dart-define=APP_ENV=prod

启动时通过 --dart-define=APP_ENV= 指定环境,若不指定则默认 dev

config_service.dart:14

static Future<void> init() async {
  const env = String.fromEnvironment('APP_ENV');

  await GetStorage.init();
  await ConfigCache.setEnvironment(env.isNotEmpty ? env : Environment.dev);
  initHttpClient(env.isNotEmpty ? env : Environment.dev);

  ...
}

配置不同环境的域名 _hostProd _hostDev

music_dao.dart:27

static const _hostProd = 'https://brook.vercel.app';
static const _hostDev = 'http://192.168.8.27:3000';
static const _search = '/cloudsearch';
static const _personalized = '/personalized';
static const _playlistDetail = '/playlist/detail';
static const _songUrl = '/song/url/v1';

static init(String env) {
  client = summer.Client(
    baseURL: env == Environment.prod ? _hostProd : _hostDev,
    udBeforeRequest: onBeforeRequest,
    afterResponse: onAfterResponse,
  );
}

Api 用的是NeteaseCloudMusicApi,建议你自行部署。 演示地址(https://brook.vercel.app) 部署在 vercel 上,可能需要科学上网才能访问。

i18n

get generate locales assets/locales

thanks

brook's People

Contributors

lysander66 avatar

Stargazers

 avatar  avatar  avatar 波西米亚上将 avatar XinYang avatar 爱编程的小芯 avatar est7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.