-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: pull request #103 from Solvro/feat/ui-improvements
Add youtube and github icon [MOBILE 53]
- Loading branch information
Showing
13 changed files
with
54 additions
and
65 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
abstract class UrlIconsConfig { | ||
static const icons = { | ||
"facebook": "assets/icons/ic_fb.png", | ||
abstract class IconsConfig { | ||
static const iconsPaths = { | ||
"facebook": "assets/icons/ic_fb.png", | ||
"instagram": "assets/icons/ic_insta.png", | ||
"linkedin": "assets/icons/ic_linkedin.png", | ||
"github": "assets/icons/ic_github.png", | ||
"mailto:": "assets/icons/ic_email.png", | ||
"youtu": "assets/icons/ic_youtube.png", | ||
"github": "assets/icons/ic_github.png", | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 2 additions & 22 deletions
24
lib/features/study_circle_details/models/contact_section_data.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,12 @@ | ||
import 'package:collection/collection.dart'; | ||
|
||
import '../../../config/ui_config.dart'; | ||
import '../../../utils/determine_icon.dart'; | ||
|
||
class ContactSectionData { | ||
String iconUrl; | ||
String? text; | ||
String? url; | ||
|
||
static const _icons = { | ||
"facebook": "assets/icons/ic_fb.png", | ||
"instagram": "assets/icons/ic_insta.png", | ||
"linkedin": "assets/icons/ic_linkedin.png", | ||
"mailto:": "assets/icons/ic_email.png", | ||
}; | ||
|
||
ContactSectionData({ | ||
required this.text, | ||
required this.url, | ||
}) : iconUrl = _determineIcon(url); | ||
|
||
static String _determineIcon(String? url) { | ||
return url != null | ||
? _icons.entries | ||
.firstWhereOrNull( | ||
(e) => url.contains(e.key), | ||
) | ||
?.value ?? | ||
DetailsScreenConfig.defaultIconUrl | ||
: DetailsScreenConfig.defaultIconUrl; | ||
} | ||
}) : iconUrl = url.determineIcon(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
import 'package:collection/collection.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
import '../config/ui_config.dart'; | ||
import '../config/url_icons.dart'; | ||
|
||
@immutable | ||
class UrlIconsUtilModel { | ||
class UrlIconsModel { | ||
final String iconUrl; | ||
final String? text; | ||
final String? url; | ||
|
||
UrlIconsUtilModel({ | ||
UrlIconsModel({ | ||
String? text, | ||
this.url, | ||
}) : iconUrl = _determineIcon(url), | ||
}) : iconUrl = url.determineIcon(), | ||
text = text ?? url; | ||
} | ||
|
||
static String _determineIcon(String? url) { | ||
return url != null | ||
? UrlIconsConfig.icons.entries | ||
extension IconDeterminer on String? { | ||
String determineIcon() { | ||
return this != null | ||
? IconsConfig.iconsPaths.entries | ||
.firstWhereOrNull( | ||
(e) => url.contains(e.key), | ||
(e) => this!.contains(e.key), | ||
) | ||
?.value ?? | ||
DetailsScreenConfig.defaultIconUrl | ||
: DetailsScreenConfig.defaultIconUrl; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters