Skip to content

Commit

Permalink
add chrome custom tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nov1kov committed Sep 28, 2019
1 parent 8ab35ee commit ebe777a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 34 deletions.
5 changes: 5 additions & 0 deletions assets/it_jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Специалист по Data Science структурирует и анализирует большие объёмы данных, применяет машинное обучение для предсказания событий и обнаружения неочевидных закономерностей. Помогает создавать и улучшать продукты в бизнесе, промышленности и науке. ",
"salary": "от 40 тыс руб до 175 тыс. ",
"image": "3.png",
"link_text": "КУРС DATA SINCE",
"links": [
"https://course.skillbox.ru/profession-data-scientist"
]
Expand All @@ -13,6 +14,7 @@
"description": "Тестировщик проверяет IT-продукт: ищет недоделки и баги, определяет его функциональность, удобство навигации для пользователя. Он моделирует ситуации, которые могут возникнуть при использовании программного обеспечения, и проверяет, нет ли в нём слабых мест.",
"salary": "от 40 тыс руб до 80 тыс руб",
"image": "1.png",
"link_text": "КУРС ТЕСТИРОВАНИЕ ПО",
"links": [
"https://www.udemy.com/course/software-testing-demo/"
]
Expand All @@ -22,6 +24,7 @@
"description": "Java Developer – это специалист, основной задачей которого является создание сложных корпоративных систем для обработки данных. К таким системам можно отнести настольные приложения, веб-сервисы, облачные хранилища данных, веб-приложения, а также сложные банковские системы.",
"salary": "от 40 тыс руб до 80 тыс руб",
"image": "2.png",
"link_text": "КУРС JAVA DEVELOPER",
"links": [
"https://www.udemy.com/course/java-simple2advanced/"
]
Expand All @@ -31,6 +34,7 @@
"description": "Специалист обладает знаниями и навыками эффективного продвижения бренда в сети, медиапланирования, создания креативных концепций, мобильных продуктов и e-commerce. Выпускник программы – востребованный специалист с перспективой работы на позиции директора.",
"salary": "от 40 тыс руб до 80 тыс руб",
"image": "5.png",
"link_text": "ПРОГРАММА DIGITAL КОММУНИКАЦИИ",
"links": [
"https://macs.school/departments/digital-communications/interactive-communications/"
]
Expand All @@ -40,6 +44,7 @@
"description": "Такие специалисты осуществляют анализ юридических рисков, связанных с внедрением современных информационных технологий, разработку юридической архитектуры новых бизнес-моделей, а также юридическое сопровождение всех бизнес-процессов, связанных с информатизацией экономической деятельности.",
"salary": "от 40 тыс руб до 90 тыс руб",
"image": "4.png",
"link_text": "КУРС СЕТЕВОЙ ЮРИСТ",
"links": [
"https://www.udemy.com/course/software-testing-demo/"
]
Expand Down
4 changes: 3 additions & 1 deletion lib/authpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ class _AuthPageState extends State<AuthPage> {
child: const Text(
'ВОЙТИ ЧЕРЕЗ GOOGLE',
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold),
),
),
),
Expand Down
4 changes: 3 additions & 1 deletion lib/repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@ class ItJob{
final String description;
final String salary;
final String image;
final String link_text;
final List<String> links;
int predictRate;

ItJob({this.name, this.description, this.salary, this.image, this.links});
ItJob({this.name, this.description, this.salary, this.image, this.link_text, this.links});

factory ItJob.fromJson(Map<String, dynamic> json) {
return new ItJob(
name: json['name'] as String,
description: json['description'] as String,
salary: json['salary'] as String,
image: json['image'] as String,
link_text: json['link_text'] as String,
links: new List<String>.from(json['links']),
);
}
Expand Down
83 changes: 51 additions & 32 deletions lib/resultpage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_web_browser/flutter_web_browser.dart';

import 'Repository.dart';
import 'util.dart';
Expand Down Expand Up @@ -53,7 +54,7 @@ class _ResultPageState extends State<ResultPage> {
CustomColors.GradientMiddle,
CustomColors.GradientBottom
])),
child: Container(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
SizedBox(height: 80),
Expand Down Expand Up @@ -88,12 +89,12 @@ class _ResultPageState extends State<ResultPage> {
SizedBox(
height: 27,
),
SingleChildScrollView(
Container(
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.symmetric(horizontal: 48),
margin: const EdgeInsets.fromLTRB(48, 0, 48, 48),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
Expand Down Expand Up @@ -126,36 +127,53 @@ class _ResultPageState extends State<ResultPage> {
margin: EdgeInsets.fromLTRB(22, 0, 22, 0),
child: Text(
selectedItJob != null
? "Зарплата " + selectedItJob.salary
? "Зарплата: " + selectedItJob.salary
: "",
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: CustomColors.BorderColor))),
Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment(0.0, 0.0),
height: 58,
decoration: BoxDecoration(
color: Colors.white,
border: new Border.all(
color: CustomColors.BorderColor,
width: 2,
style: BorderStyle.solid),
borderRadius: new BorderRadius.all(
new Radius.circular(15.0)),
),
child: Text("КУРС ПО DATA SINCE",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: CustomColors.BorderColor))),

InkWell(
onTap: () => {
FlutterWebBrowser.openWebPage(
url: selectedItJob != null
? selectedItJob.links[0]
: "",
androidToolbarColor: CustomColors.AccentColor)
},
child: Container(
margin: EdgeInsets.all(22),
width: MediaQuery.of(context).size.width,
alignment: Alignment(0.0, 0.0),
height: 58,
decoration: BoxDecoration(
color: Colors.white,
border: new Border.all(
color: CustomColors.BorderColor,
width: 2,
style: BorderStyle.solid),
borderRadius: new BorderRadius.all(
new Radius.circular(15.0)),
),
child: Text(
selectedItJob != null
? selectedItJob.link_text
: "",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: CustomColors.BorderColor))),
),
],
),
),
//_buildNotMyButton(),
Text("Не твое?",
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: CustomColors.TextHeader)),
_buildNotMyButton(),
],
),
),
Expand All @@ -167,9 +185,10 @@ class _ResultPageState extends State<ResultPage> {
);
}

Widget _buildNotMyButton(){
Widget _buildNotMyButton() {
return Container(
width: MediaQuery.of(context).size.width / 1.2,
margin: EdgeInsets.fromLTRB(0, 18, 0, 50),
height: 58,
decoration: const BoxDecoration(
gradient: LinearGradient(
Expand All @@ -192,9 +211,9 @@ class _ResultPageState extends State<ResultPage> {
),
child: Center(
child: const Text(
'ВОЙТИ ЧЕРЕЗ GOOGLE',
'РАССКАЗАТЬ О СЕБЕ БОЛЬШЕ',
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
),
),
);
Expand Down Expand Up @@ -223,7 +242,7 @@ class PredictionsList extends StatelessWidget {
return _buildList(context);
}

void itemOnTapped(int index){
void itemOnTapped(int index) {
selectedIndex = index;
onItemTap(index);
}
Expand All @@ -237,9 +256,7 @@ class PredictionsList extends StatelessWidget {
borderRadius: new BorderRadius.all(new Radius.circular(15.0)),
),
child: InkWell(
onTap: () => {
itemOnTapped(index)
},
onTap: () => {itemOnTapped(index)},
child: Column(
children: <Widget>[
Stack(children: <Widget>[
Expand Down Expand Up @@ -269,7 +286,9 @@ class PredictionsList extends StatelessWidget {
SizedBox(height: 12),
Text(predictionItJobs[index].name,
style: TextStyle(
fontWeight: selectedIndex == index ? FontWeight.bold : FontWeight.w400,
fontWeight: selectedIndex == index
? FontWeight.bold
: FontWeight.w400,
fontSize: 14,
color: CustomColors.TextHeader))
],
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_browser:
dependency: "direct main"
description:
name: flutter_web_browser
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.0"
gradient_app_bar:
dependency: "direct main"
description:
Expand Down Expand Up @@ -151,3 +158,4 @@ packages:
version: "2.0.8"
sdks:
dart: ">=2.2.2 <3.0.0"
flutter: ">=0.1.4 <2.0.0"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
gradient_app_bar: ^0.1.3
flutter_web_browser: ^0.11.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit ebe777a

Please sign in to comment.