parent
							
								
									b7d0ec75eb
								
							
						
					
					
						commit
						58263f4548
					
				| @ -1,14 +1,17 @@ | |||||||
| FROM google/dart:latest | FROM dart:stable AS build-env | ||||||
| 
 | LABEL stage=dart_builder | ||||||
|  | ENV PUB_HOSTED_URL="https://pub.flutter-io.cn" | ||||||
|  | ENV ANGEL_ENV=production | ||||||
| COPY ./ ./ | COPY ./ ./ | ||||||
| 
 |  | ||||||
| # Install dependencies, pre-build |  | ||||||
| RUN pub get | RUN pub get | ||||||
|  | RUN dart compile exe bin/prod.dart -o /server | ||||||
| 
 | 
 | ||||||
| # Optionally build generaed sources. | FROM scratch | ||||||
| # RUN pub run build_runner build | WORKDIR /app | ||||||
| 
 |  | ||||||
| # Set environment, start server |  | ||||||
| ENV ANGEL_ENV=production | ENV ANGEL_ENV=production | ||||||
|  | ADD ./views ./views | ||||||
|  | ADD ./config ./config | ||||||
|  | COPY --from=build-env /runtime/ / | ||||||
|  | COPY --from=build-env /server /app | ||||||
| EXPOSE 3000 | EXPOSE 3000 | ||||||
| CMD dart bin/prod.dart | ENTRYPOINT ["./server", "-a", "0.0.0.0", "--port", "3000"] | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | version: "2.1" | ||||||
|  | 
 | ||||||
|  | services: | ||||||
|  |   mysql: | ||||||
|  |     image: postgres:latest | ||||||
|  |     restart: always | ||||||
|  |     container_name: dgm_postgres | ||||||
|  |     command: --default-authentication-plugin=mysql_native_password | ||||||
|  |     environment: | ||||||
|  |       MYSQL_ROOT_PASSWORD: Dx@8917312 | ||||||
|  |       MYSQL_DATABASE: piwigo | ||||||
|  |       MYSQL_USER: debuggerx | ||||||
|  |       MYSQL_PASSWORD: dx8917312 | ||||||
|  |     volumes: | ||||||
|  |       - /mnt/hd500/db:/var/lib/mysql | ||||||
|  |     ports: | ||||||
|  |       - "5432:5432" | ||||||
|  |     networks: | ||||||
|  |       - mynet | ||||||
|  | 
 | ||||||
|  |   api: | ||||||
|  |     build: . | ||||||
|  |     container_name: dgm_api | ||||||
|  |     links: | ||||||
|  |       - dgm_postgres | ||||||
|  |     ports: | ||||||
|  |       - 8888:8888 | ||||||
|  |     networks: | ||||||
|  |       - mynet | ||||||
|  |     restart: unless-stopped | ||||||
|  | 
 | ||||||
|  | networks: | ||||||
|  |   mynet: | ||||||
|  |     driver: bridge | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | docker build -t dgm_api_image . | ||||||
|  | docker image prune -f --filter label=stage=dart_builder | ||||||
|  | docker rm -f dgm_api | ||||||
|  | docker run -d --restart=always --name dgm_api -p 3000:3000 dgm_api_image | ||||||
|  | docker image prune -f | ||||||
| @ -0,0 +1,102 @@ | |||||||
|  | import 'package:dde_gesture_manager/constants/constants.dart'; | ||||||
|  | import 'package:dde_gesture_manager/widgets/dde_button.dart'; | ||||||
|  | import 'package:flutter/material.dart'; | ||||||
|  | import 'package:dde_gesture_manager/extensions.dart'; | ||||||
|  | 
 | ||||||
|  | enum MarketSortType { | ||||||
|  |   recommend, | ||||||
|  |   updated, | ||||||
|  |   likes, | ||||||
|  |   downloads, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | class MarketWidget extends StatefulWidget { | ||||||
|  |   const MarketWidget({Key? key}) : super(key: key); | ||||||
|  | 
 | ||||||
|  |   @override | ||||||
|  |   _MarketWidgetState createState() => _MarketWidgetState(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | class _MarketWidgetState extends State<MarketWidget> { | ||||||
|  |   MarketSortType _type = MarketSortType.recommend; | ||||||
|  | 
 | ||||||
|  |   @override | ||||||
|  |   Widget build(BuildContext context) { | ||||||
|  |     return Column( | ||||||
|  |       mainAxisSize: MainAxisSize.max, | ||||||
|  |       mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||||
|  |       children: [ | ||||||
|  |         Padding( | ||||||
|  |           padding: const EdgeInsets.only(top: 15, bottom: 2), | ||||||
|  |           child: Row( | ||||||
|  |             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||||
|  |             children: [ | ||||||
|  |               MarketSortType.recommend, | ||||||
|  |               MarketSortType.updated, | ||||||
|  |               MarketSortType.likes, | ||||||
|  |               MarketSortType.downloads, | ||||||
|  |             ] | ||||||
|  |                 .map( | ||||||
|  |                   (e) => Flexible( | ||||||
|  |                     flex: 1, | ||||||
|  |                     fit: FlexFit.tight, | ||||||
|  |                     child: MouseRegion( | ||||||
|  |                       cursor: SystemMouseCursors.click, | ||||||
|  |                       child: GestureDetector( | ||||||
|  |                         onTap: () { | ||||||
|  |                           setState(() { | ||||||
|  |                             _type = e; | ||||||
|  |                           }); | ||||||
|  |                         }, | ||||||
|  |                         child: Center( | ||||||
|  |                           child: Text( | ||||||
|  |                             '${LocaleKeys.market_sort_types}.${e.name}'.tr(), | ||||||
|  |                             style: _type == e ? TextStyle(fontWeight: FontWeight.bold, fontSize: 15) : null, | ||||||
|  |                           ), | ||||||
|  |                         ), | ||||||
|  |                       ), | ||||||
|  |                     ), | ||||||
|  |                   ), | ||||||
|  |                 ) | ||||||
|  |                 .toList(), | ||||||
|  |           ), | ||||||
|  |         ), | ||||||
|  |         Expanded( | ||||||
|  |           child: Container( | ||||||
|  |             decoration: BoxDecoration( | ||||||
|  |               border: Border.all( | ||||||
|  |                 width: .3, | ||||||
|  |                 color: context.t.dividerColor, | ||||||
|  |               ), | ||||||
|  |               borderRadius: BorderRadius.circular(defaultBorderRadius), | ||||||
|  |             ), | ||||||
|  |             child: Column( | ||||||
|  |               children: [Text('asd')], | ||||||
|  |             ), | ||||||
|  |           ), | ||||||
|  |         ), | ||||||
|  |         Padding( | ||||||
|  |           padding: const EdgeInsets.only(top: 5), | ||||||
|  |           child: Row( | ||||||
|  |             mainAxisAlignment: MainAxisAlignment.end, | ||||||
|  |             children: [ | ||||||
|  |               DButton.like( | ||||||
|  |                 enabled: true, | ||||||
|  |                 onTap: () {}, | ||||||
|  |               ), | ||||||
|  |               DButton.download( | ||||||
|  |                 enabled: true, | ||||||
|  |                 onTap: () {}, | ||||||
|  |               ), | ||||||
|  |             ] | ||||||
|  |                 .map((e) => Padding( | ||||||
|  |                       padding: const EdgeInsets.only(right: 4), | ||||||
|  |                       child: e, | ||||||
|  |                     )) | ||||||
|  |                 .toList(), | ||||||
|  |           ), | ||||||
|  |         ), | ||||||
|  |       ], | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | } | ||||||
					Loading…
					
					
				
		Reference in new issue