Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from langx/myprofile-ui
Browse files Browse the repository at this point in the history
my profile ui
  • Loading branch information
xuelink authored Jun 22, 2024
2 parents 207ef5d + b548cee commit e962c82
Show file tree
Hide file tree
Showing 27 changed files with 1,438 additions and 71 deletions.
Binary file added assets/images/chain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/creator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/early-adopter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/pioneer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions lib/components/at_sign_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class AtSignSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const AtSignSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateAtSignSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M320 254.27c-4.5 51-40.12 80-80.55 80s-67.34-35.82-63.45-80 37.12-80 77.55-80 70.33 36 66.45 80z" ></path>
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M319.77 415.77c-28.56 12-47.28 14.5-79.28 14.5-97.2 0-169-78.8-160.49-176s94.31-176 191.51-176C381 78.27 441.19 150 432.73 246c-6.31 71.67-52.11 92.32-76.09 88.07-22.56-4-41.18-24.42-37.74-63.5l8.48-96.25" ></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateAtSignSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
40 changes: 40 additions & 0 deletions lib/components/battery_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class BatterySvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const BatterySvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateBatterySvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect x="32" y="144" width="400" height="224" rx="45.7" ry="45.7" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></rect>
<rect x="85.69" y="198.93" width="154.31" height="114.13" rx="4" ry="4" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></rect>
<path d="M480 218.67v74.66" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.yellow[700]!;
String infoSvg = generateBatterySvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
39 changes: 39 additions & 0 deletions lib/components/calendar_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class CalendarSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const CalendarSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateCalendarSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" >
<rect x="48" y="80" width="416" height="384" rx="48" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" ></rect>
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M128 48v32M384 48v32M464 160H48M304 260l43.42-32H352v168M191.87 306.63c9.11 0 25.79-4.28 36.72-15.47a37.9 37.9 0 0011.13-27.26c0-26.12-22.59-39.9-47.89-39.9-21.4 0-33.52 11.61-37.85 18.93M149 374.16c4.88 8.27 19.71 25.84 43.88 25.84 28.59 0 52.12-15.94 52.12-43.82 0-12.62-3.66-24-11.58-32.07-12.36-12.64-31.25-17.48-41.55-17.48" ></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateCalendarSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
39 changes: 39 additions & 0 deletions lib/components/clock_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class ClockSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const ClockSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateClockSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
<path d="M256 128v144h96" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateClockSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
39 changes: 39 additions & 0 deletions lib/components/country_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class CountrySvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const CountrySvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateCountrySvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M80 464V68.14a8 8 0 014-6.9C91.81 56.66 112.92 48 160 48c64 0 145 48 192 48a199.53 199.53 0 0077.23-15.77 2 2 0 012.77 1.85v219.36a4 4 0 01-2.39 3.65C421.37 308.7 392.33 320 352 320c-48 0-128-32-192-32s-80 16-80 16" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor">
</path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateCountrySvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
39 changes: 39 additions & 0 deletions lib/components/eye_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class EyeSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const EyeSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateEyeSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 00-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 000-17.47C428.89 172.28 347.8 112 255.66 112z" ></path>
<circle stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" cx="256" cy="256" r="80" ></circle>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.yellow[700]!;
String infoSvg = generateEyeSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
39 changes: 39 additions & 0 deletions lib/components/gender_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class GenderSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const GenderSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateGenderSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<circle cx="216" cy="200" r="136" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" ></circle>
<path d="M216 352v128M272 416H160M432 112V32h-80M335.28 128.72L432 32" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateGenderSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
41 changes: 41 additions & 0 deletions lib/components/info_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class InfoSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const InfoSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generateInfoSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184 184-82.39 184-184S349.61 64 248 64z" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
<path d="M220 220h32v116" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
<path d="M208 340h88" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
<path d="M248 130a26 26 0 1026 26 26 26 0 00-26-26z" stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor"></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.black;
String infoSvg = generateInfoSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
41 changes: 41 additions & 0 deletions lib/components/people_svg.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class PeopleSvg extends StatelessWidget {
final String fill;
final int strokeWidth;
final Color? color;
final double widht;
final double height;

const PeopleSvg(
{super.key,
this.color,
this.fill = "none",
this.strokeWidth = 30,
this.widht = 17,
this.height = 17});

String generatePeopleSvg(String fillColor, int strokeWidth, Color color) {
final colorHex = '#${color.value.toRadixString(16).substring(2)}';
return '''
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M402 168c-2.93 40.67-33.1 72-66 72s-63.12-31.32-66-72c-3-42.31 26.37-72 66-72s69 30.46 66 72z" ></path>
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M336 304c-65.17 0-127.84 32.37-143.54 95.41-2.08 8.34 3.15 16.59 11.72 16.59h263.65c8.57 0 13.77-8.25 11.72-16.59C463.85 335.36 401.18 304 336 304z" ></path>
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M200 185.94c-2.34 32.48-26.72 58.06-53 58.06s-50.7-25.57-53-58.06C91.61 152.15 115.34 128 147 128s55.39 24.77 53 57.94z" ></path>
<path stroke="$colorHex" stroke-width="$strokeWidth" fill="$fillColor" d="M206 306c-18.05-8.27-37.93-11.45-59-11.45-52 0-102.1 25.85-114.65 76.2-1.65 6.66 2.53 13.25 9.37 13.25H154" ></path>
</svg>
''';
}

@override
Widget build(BuildContext context) {
final Color defaultColor = color ?? Colors.yellow[700]!;
String infoSvg = generatePeopleSvg(fill, strokeWidth, defaultColor);
return SvgPicture.string(
infoSvg,
width: widht,
height: height,
);
}
}
Loading

0 comments on commit e962c82

Please sign in to comment.