repo_id
stringlengths
21
168
file_path
stringlengths
36
210
content
stringlengths
1
9.98M
__index_level_0__
int64
0
0
mirrored_repositories/flutter21/mi_card_flutter
mirrored_repositories/flutter21/mi_card_flutter/lib/main.dart
import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( backgroundColor: Colors.teal, body: SafeArea( child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ CircleAvatar( radius: 50.0, backgroundImage: AssetImage('images/2.jpeg'), ), Text( 'Prahlad Nayak', style: TextStyle( fontFamily: 'Pacifico', fontSize: 40.0, color: Colors.white, fontWeight: FontWeight.bold, ), ), Text( 'FLUTTER DEVELOPER', style: TextStyle( fontFamily: 'SourceSansPro', fontSize: 20.0, color: Colors.teal.shade100, letterSpacing: 2.5, fontWeight: FontWeight.bold, ), ), SizedBox( height: 20.0, width: 150.0, child: Divider( color: Colors.teal.shade100, ), ), Card( color: Colors.white, margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), child: ListTile( leading: Icon( Icons.phone, color: Colors.teal, ), title: Text( '+91 7045093070', style: TextStyle( color: Colors.teal.shade900, fontFamily: 'SourceSansPro', ), ), ), ), Card( color: Colors.white, margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), child: ListTile( leading: Icon( Icons.email, color: Colors.teal, ), title: Text( '[email protected]', style: TextStyle( color: Colors.teal.shade900, fontFamily: 'SourceSansPro', ), ), ), ), Card( color: Colors.white, margin: EdgeInsets.symmetric(vertical: 10.0, horizontal: 25.0), child: ListTile( leading: Icon( Icons.language, color: Colors.teal, ), title: Text( 'https://prahlad-nayak.netlify.app/', style: TextStyle( color: Colors.teal.shade900, fontFamily: 'SourceSansPro', ), ), ), ), ]), ), ), ); } }
0
mirrored_repositories/flutter_dribble
mirrored_repositories/flutter_dribble/lib/keys.dart
//keys for dribbble applications //Applied in https://dribbble.com/account/applications const String DRIBBBLE_CLIENT_ID = "d848d2aafaee29561da1694244ad2ee145251e0ab45b884d06638ca72072eb04"; const String DRIBBBLE_CLIENT_SECRET = "c4e2e46a00f5f5991cae4b4b7dca4eecd78400532ebc65e6e9f70c072808225f"; const String DRIBBBLE_ACCESS_TOKEN = "c14f402db06bc15be330b7a4fd049d1ca88fe5fa23892c073ca97dc422cfe9ee";
0
mirrored_repositories/flutter_dribble
mirrored_repositories/flutter_dribble/lib/main.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/ui/app.dart'; //Entry for this app void main() => runApp(new MainApp());
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/model/dribbble_user.dart
import 'package:flutter_drib/model/dribbble_links.dart'; class DribbbleUser { final num id; final String name; final String avatarUrl; final String bio; final String location; final DribbbleLinks links; DribbbleUser(this.id, this.name, this.avatarUrl, this.bio, this.location, this.links); static DribbbleUser fromJson(Map<String, dynamic> json) { var id = json["id"]; var name = json["name"]; var avatarUrl = json["avatar_url"]; var bio = json["bio"]; var location = json["location"]; var links = DribbbleLinks.fromJson(json['links']); return new DribbbleUser(id, name, avatarUrl, bio, location, links); } @override String toString() { return 'DribbbleUser{id: $id, name: $name, avatarUrl: $avatarUrl, bio: $bio, location: $location, links: $links}'; } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/model/dribbble_image.dart
class DribbbleImage { final String hidpi; final String normal; final String teaser; DribbbleImage(this.hidpi, this.normal, this.teaser); static DribbbleImage fromJson(Map<String, dynamic> json) { var hidpi = json['hidpi']; var normal = json['normal']; var teaser = json['teaser']; return new DribbbleImage(hidpi, normal, teaser); } @override String toString() { return 'DribbbleImage{hidpi: $hidpi, normal: $normal, teaser: $teaser}'; } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/model/dribbble_shot.dart
import 'package:flutter_drib/model/dribbble_image.dart'; import 'package:flutter_drib/model/dribbble_user.dart'; class DribbbleShot { final String title; final num id; final DribbbleImage images; final DribbbleUser user; final String description; final int likesCount; final int viewsCount; final int bucketCount; final int commentsCount; final bool animated; final List<String> tags; DribbbleShot(this.title, this.id, this.images, this.user, this.description, this.likesCount, this.viewsCount, this.bucketCount, this.commentsCount, this.animated, this.tags); static DribbbleShot fromJson(Map<String, dynamic> json) { var title = json['title']; var id = json['id']; var images = DribbbleImage.fromJson(json['images']); var user = json['user'] == null ? null : DribbbleUser.fromJson(json['user']); var description = json['description']; var likesCount = json['likes_count']; var viewsCount = json['views_count']; var bucketCount = json['bucket_count']; var commentsCount = json['comments_count']; var animated = json['animated']; var tags = json['tags']; return new DribbbleShot( title, id, images, user, description, likesCount, viewsCount, bucketCount, commentsCount, animated, tags); } @override String toString() { return 'DribbbleShot{title: $title, id: $id, images: $images, user: $user, description: $description, likesCount: $likesCount, viewsCount: $viewsCount, bucketCount: $bucketCount, commentsCount: $commentsCount, animated: $animated}'; } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/model/dribbble_comment.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/model/dribbble_user.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; class DribbbleComment { final num id; final String body; final DribbbleUser user; final String createAt; final int likesCount; DribbbleComment(this.id, this.body, this.user, this.createAt, this.likesCount); static DribbbleComment fromJson(Map<String, dynamic> json) { var id = json['id']; var body = json['body']; var likesCount = json['likes_count']; var createAt = json['created_at']; var user = DribbbleUser.fromJson(json['user']); return new DribbbleComment(id, body, user, createAt, likesCount); } List<Widget> convertBodyToTexts() { var pRemoved = body.replaceAll("<p>", ""); pRemoved = pRemoved.replaceAll("</p>", ""); var lines = pRemoved.split("<br />"); lines = pRemoved.split("\\n"); var result = []; lines.forEach((String lineString) { result.add(new Wrap(children: _getBodyWidgetList(lineString))); }); return result; } List<Widget> _getBodyWidgetList(String content) { final commonTextStyle = const TextStyle( color: FDColors.fontTitleColor, fontSize: 14.0); final linkTextStyle = const TextStyle( color: FDColors.linkBlue, fontSize: 14.0); var widgetList = []; var leftContent = content; while (leftContent.contains("<a")) { var startIndex = content.indexOf("<a"); var endIndex = content.indexOf("</a>"); if (startIndex != 0) { //content before <a> tag var commonText = leftContent.substring(0, startIndex); widgetList.add(new Text(commonText, style: commonTextStyle)); leftContent = leftContent.substring(0, endIndex); continue; } else { //Parse link address and name var addressStartIndex = leftContent.indexOf("href=\"") + 6; var addressEndIndex = leftContent.indexOf("\">"); var nameStartIndex = addressEndIndex + 2; var nameEndIndex = leftContent.indexOf("</a>"); var address = leftContent.substring(addressStartIndex, addressEndIndex); var name = leftContent.substring(nameStartIndex, nameEndIndex); widgetList.add( new GestureDetector(child: new Text(name, style: linkTextStyle), onTap: () {},)); leftContent = leftContent.substring(nameEndIndex + 4); continue; } } widgetList.add(new Text(leftContent, style: commonTextStyle)); return widgetList; } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/model/dribbble_links.dart
class DribbbleLinks { final String web; final String twitter; DribbbleLinks(this.web, this.twitter); @override String toString() { return 'DribbbleLinks{web: $web, twitter: $twitter}'; } static DribbbleLinks fromJson(Map<String, dynamic> json) { var web = json["web"]; var twitter = json["twitter"]; return new DribbbleLinks(web, twitter); } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/api/basicApi.dart
//Basic api import 'dart:convert'; import 'dart:io'; import 'package:flutter_drib/keys.dart'; class BasicApi { static const String BASE_URL = "api.dribbble.com"; request(String path, Map params, {String method = "GET"}) async { var httpClient = new HttpClient(); var uri = new Uri.https(BASE_URL, path, params); var request; //Only post and get for this moment, add others later. if (method == "POST") { request = await httpClient.postUrl(uri); } else { request = await httpClient.getUrl(uri); } request.headers.add("Authorization", "Bearer $DRIBBBLE_ACCESS_TOKEN"); var response = await request.close(); var result; if (response.statusCode == HttpStatus.OK) { var responseBody = await response.transform(UTF8.decoder).join(); result = json.decode(responseBody); } return result; } }
0
mirrored_repositories/flutter_dribble/lib/api
mirrored_repositories/flutter_dribble/lib/api/shots/shotsApi.dart
import 'dart:async'; import 'package:flutter_drib/api/basicApi.dart'; import 'package:flutter_drib/model/dribbble_comment.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; class ShotsApi extends BasicApi { //Get shorts //Sort types: views / recent //Limit: result size limit Future<List<DribbbleShot>> getShots(String sortType, int limit) async { List<DribbbleShot> shots = new List<DribbbleShot>(); List<Map<String, dynamic>> callResult = await request( "/v1/shots", {"sort": sortType, "per_page": limit.toString()}); if (callResult != null) { callResult.forEach((shotString) { shots.add(DribbbleShot.fromJson(shotString)); }); } return shots; } //Get comments in shots Future<List<DribbbleComment>> getCommentByShot(num shotId) async { List<DribbbleComment> comments = new List<DribbbleComment>(); List<Map<String, dynamic>> callResult = await request( "/v1/shots/$shotId/comments", null); if (callResult != null) { callResult.forEach((commentString) { comments.add(DribbbleComment.fromJson(commentString)); }); } return comments; } }
0
mirrored_repositories/flutter_dribble/lib/api
mirrored_repositories/flutter_dribble/lib/api/shots/user_api.dart
import 'dart:async'; import 'package:flutter_drib/api/basicApi.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; import 'package:flutter_drib/model/dribbble_user.dart'; class UserApi extends BasicApi { Future<List<DribbbleShot>> getShotsByUser(DribbbleUser user, int limit) async { List<DribbbleShot> shots = new List<DribbbleShot>(); List<Map<String, dynamic>> callResult = await request( "/v1/users/${user.id}/shots/", { "per_page": limit.toString()}); if (callResult != null) { callResult.forEach((shotString) { var shot = DribbbleShot.fromJson(shotString); //Add user to shot shots.add(new DribbbleShot( shot.title, shot.id, shot.images, user, shot.description, shot.likesCount, shot.viewsCount, shot.bucketCount, shot.commentsCount, shot.animated, shot.tags)); }); } return shots; } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/ui/app.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/ui/shots/shots_page.dart'; import 'basic/fdThemeData.dart'; //Main app class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'FlutterDrib', theme: fdThemeData, home: new ShotsPage(), ); } }
0
mirrored_repositories/flutter_dribble/lib
mirrored_repositories/flutter_dribble/lib/ui/fdDrawer.dart
import 'package:flutter/material.dart'; // Drawer for this app. // Including header(user info) and list of feature entries class FDDrawer extends StatelessWidget { @override Widget build(BuildContext context) { return new Drawer(child: new Column( children: <Widget>[ new UserAccountsDrawerHeader(accountName: new Text("Login"), accountEmail: new Text("Tap to login"), currentAccountPicture: new CircleAvatar( backgroundColor: Colors.grey)), new ListTile( leading: new Icon(Icons.camera_alt, color: Colors.orange), title: new Text("SHOTS")), new ListTile( leading: new Icon(Icons.favorite, color: Colors.pink), title: new Text("USER LIKES")), new ListTile( leading: new Icon(Icons.group, color: Colors.green), title: new Text("FOLLOWING")), new ListTile( leading: new Icon(Icons.help, color: Colors.blue), title: new Text("APPI INFO")), new ListTile( leading: new Icon(Icons.exit_to_app, color: Colors.grey), title: new Text("LOG OUT")) ], )); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/shots/shot_list_page.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/api/shots/shotsApi.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; import 'package:flutter_drib/ui/items/grid_shot_item.dart'; class ShotListPage extends StatefulWidget { static const SHOT_TYPE_POPULAR = "views"; static const SHOT_TYPE_RECENT = "recent"; final String shotType; ShotListPage({Key key, this.shotType}) : super(key: key); @override State createState() { return new ShotListPageState(shotType); } } class ShotListPageState extends State<ShotListPage> { List<DribbbleShot> _shots = []; final String shotType; ShotListPageState(this.shotType) : super(); @override void initState() { super.initState(); fetchShots(); } void fetchShots() { new ShotsApi() .getShots(shotType, 500) .then((shots) => this.setState(() { _shots = shots; })); } @override Widget build(BuildContext context) { var child; if (_shots.isEmpty) { child = new Center( child: new CircularProgressIndicator(), ); } else { child = new GridView.count( crossAxisCount: 2, childAspectRatio: 1.0, crossAxisSpacing: 12.0, mainAxisSpacing: 12.0, padding: const EdgeInsets.all(12.0), children: _shots.map((DribbbleShot shot) { return new GridShotItem(shot: shot); }).toList() ); } return new Container(child: child, color: FDColors.bgColor); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/shots/shots_page.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/ui/fdDrawer.dart'; import 'package:flutter_drib/ui/shots/shot_list_page.dart'; // Shots page. Including two tabs: 'poplar' and 'recent' class ShotsPage extends StatelessWidget { final _tabs = [ new Tab(text: "POPULAR"), new Tab(text: "RECENT")]; final popularPage = new ShotListPage( shotType: ShotListPage.SHOT_TYPE_POPULAR); final recentPage = new ShotListPage(shotType: ShotListPage.SHOT_TYPE_RECENT); @override Widget build(BuildContext context) { return new DefaultTabController(length: _tabs.length, child: new Scaffold( appBar: new AppBar( title: new Text("SHOTS"), bottom: new TabBar(tabs: _tabs), ), body: _buildBody, drawer: new FDDrawer(), )); } Widget get _buildBody { return new TabBarView( children: <Widget>[ popularPage, recentPage ], ); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/detail/comment_item.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/model/dribbble_comment.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; class CommentItem extends StatelessWidget { final DribbbleComment comment; CommentItem({key, this.comment}) : super(key: key); final usernameTextStyle = const TextStyle(color: FDColors.fontTitleColor, fontSize: 11.0, fontWeight: FontWeight.w600); final dateTextStyle = const TextStyle( color: FDColors.fontDateColor, fontSize: 11.0); @override Widget build(BuildContext context) { return new Container( padding: const EdgeInsets.only( top: 12.0, right: 16.0, left: 16.0, bottom: 8.0), child: new Row( children: <Widget>[ new CircleAvatar( radius: 20.0, backgroundImage: new NetworkImage(comment.user.avatarUrl) ), new Flexible(child: new Container( margin: const EdgeInsets.only(left: 16.0), child: new Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ new Text(comment.user.name, style: usernameTextStyle), new Container( margin: const EdgeInsets.only(top: 3.0), child: new Column( children: comment.convertBodyToTexts(), ), ), new Container( margin: const EdgeInsets.only(top: 5.0), child: new Text(comment.createAt, style: dateTextStyle), ), ], ), ) ) ], ), ); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/detail/shot_detail_page.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/api/shots/shotsApi.dart'; import 'package:flutter_drib/model/dribbble_comment.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; import 'package:flutter_drib/ui/detail/comment_item.dart'; import 'package:flutter_drib/ui/user/user_page.dart'; class ShotDetailPage extends StatefulWidget { final DribbbleShot shot; ShotDetailPage({Key key, this.shot}) : assert (shot != null), super(key: key); @override State<StatefulWidget> createState() { return new ShotDetailPageState(shot); } } class ShotDetailPageState extends State<ShotDetailPage> { final DribbbleShot shot; List<DribbbleComment> _comments = []; var isLoadingComments = true; ShotDetailPageState(this.shot) : assert (shot != null), super(); @override void initState() { super.initState(); fetchShots(); } void fetchShots() { new ShotsApi() .getCommentByShot(shot.id) .then((comments) => this.setState(() { _comments = comments; isLoadingComments = false; })); } @override Widget build(BuildContext context) { final appBarHeight = 250.0; return new Scaffold( appBar: new AppBar(title: new Text(shot.title), actions: <Widget>[ new IconButton(icon: new Icon(Icons.share), tooltip: "Share", onPressed: () {}), ],), body: new CustomScrollView( slivers: <Widget>[ _buildImageContainer(appBarHeight), new SliverList(delegate: new SliverChildListDelegate( _getContents(context).toList())) ] ) ); } List<Widget> _getContents(BuildContext context) { var result = [_getHeader(context)]; if (isLoadingComments) { result.add(new Center(child: new CircularProgressIndicator(),)); } else if (_comments.isNotEmpty) { //Divider line result.add(new Container( decoration: new BoxDecoration( border: new Border( bottom: new BorderSide( color: FDColors.dividerColor, width: 0.5)), ), )); result.addAll(_comments.map((DribbbleComment comment) { return new CommentItem(comment: comment); }).toList()); } return result; } Widget _getHeader(BuildContext context) { return new Container( padding: const EdgeInsets.symmetric( vertical: 18.0, horizontal: 16.0), child: new Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _buildTitle(), _buildCountAndDateContainer(), _buildUserInfo(context), _buildTagContainer() ] ), ); } Widget _buildTitle() { var titleTextStyle = new TextStyle( fontWeight: FontWeight.bold, color: FDColors.fontTitleColor, fontSize: 13.0); return new Text(shot.title, style: titleTextStyle); } Container _buildUserInfo(BuildContext context) { return new Container( margin: const EdgeInsets.only(top: 16.0), child: new GestureDetector( child: new Row( children: <Widget>[ new Hero( tag: shot.user.id, child: new CircleAvatar( backgroundImage: new NetworkImage(shot.user.avatarUrl), radius: 16.0, )), new Flexible( child: new Container( margin: const EdgeInsets.only(left: 8.0), child: new Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ new Text(shot.user.name, style: new TextStyle( fontSize: 12.0, color: FDColors.fontTitleColor),), new Text( shot.user.location == null ? "" : shot.user.location, style: new TextStyle( fontSize: 10.0, color: FDColors.fontSubTitleColor),), ],)),) ], ), onTap: () { _gotoUserPage(context); }, ), ); } void _gotoUserPage(BuildContext context) { Navigator.push( context, new MaterialPageRoute(builder: (BuildContext context) { return new UserPage( user: shot.user, bgImgUrl: this.shot.images.normal); })); } SliverAppBar _buildImageContainer(double appBarHeight) { return new SliverAppBar( expandedHeight: appBarHeight, //Set false to hide leading(back button) automaticallyImplyLeading: false, flexibleSpace: new FlexibleSpaceBar( background: new Stack( fit: StackFit.expand, children: <Widget>[ new Hero( tag: shot.id, child: new Image.network( shot.images.normal, fit: BoxFit.cover, height: appBarHeight)), ], ), )); } Widget _buildCountAndDateContainer() { const fontSize = 11.0; final textStyle = const TextStyle( color: FDColors.fontTipColor, fontSize: fontSize); //Spacing between counts final spacingOuter = const EdgeInsets.only(left: 16.0); //Space between icon and number final spacingInner = const EdgeInsets.only(left: 4.0); return new Container( margin: const EdgeInsets.only(top: 15.0), child: new Row( children: <Widget>[ new Text("2018.03.1", style: textStyle), new Padding( padding: spacingOuter, child: new Icon(Icons.visibility, size: 14.0, color: FDColors.fontSubTitleColor), ), new Padding( padding: spacingInner, child: new Text( shot.viewsCount.toString(), style: textStyle)), new Padding( padding: spacingOuter, child: new Icon( Icons.chat_bubble, size: fontSize, color: FDColors.fontSubTitleColor)), new Padding( padding: spacingInner, child: new Text( shot.commentsCount.toString(), style: textStyle)), new Padding( padding: spacingOuter, child: new Icon( Icons.favorite, size: fontSize, color: FDColors.fontSubTitleColor)), new Padding( padding: spacingInner, child: new Text( shot.likesCount.toString(), style: textStyle)), ] )); } Widget _buildTagContainer() { if (shot.tags.isEmpty) { return new Text(""); } final tagTextStyle = const TextStyle( color: FDColors.fontTipColor, fontSize: 12.0); var tags = shot.tags.map((String tag) { return new Text(tag, style: tagTextStyle); }).toList(); //Insert label tags.insert(0, new Text("Tags: ", style: const TextStyle( color: FDColors.fontContentColor, fontSize: 13.0),)); return new Container( margin: const EdgeInsets.only(top: 12.0), child: new Wrap( spacing: 8.0, runSpacing: 3.0, children: tags), ); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/user/user_page.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/api/shots/user_api.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; import 'package:flutter_drib/model/dribbble_user.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; import 'package:flutter_drib/ui/items/grid_shot_item.dart'; import 'package:flutter_drib/ui/shots/shot_list_page.dart'; class UserPage extends StatefulWidget { final DribbbleUser user; final String bgImgUrl; UserPage({Key key, this.user, this.bgImgUrl}) : super(key: key); final userShots = new ShotListPage( shotType: ShotListPage.SHOT_TYPE_POPULAR); @override State createState() { return new UserPageState(user, bgImgUrl); } } class UserPageState extends State<UserPage> { List<DribbbleShot> _shots = []; final DribbbleUser user; final String bgImgUrl; UserPageState(this.user, this.bgImgUrl) : super(); @override void initState() { super.initState(); fetchShots(); } void fetchShots() { new UserApi() .getShotsByUser(user, 20) .then((shots) => this.setState(() { _shots = shots; })); } @override Widget build(BuildContext context) { final appBarHeight = 250.0; return new Scaffold( appBar: new AppBar( title: new Text(user.name), actions: <Widget>[ new IconButton( icon: new Icon(Icons.mail, color: FDColors.fontSubTitleColor,), onPressed: () {}), new FlatButton(child: new Text("Follow", style: new TextStyle( color: FDColors.fontSubTitleColor, fontSize: 17.0),), onPressed: () {}), ], ), body: new CustomScrollView( slivers: <Widget>[ _buildUserInfoContainer(appBarHeight), new SliverPadding( padding: new EdgeInsets.all(12.0), sliver: new SliverGrid.count( crossAxisCount: 2, crossAxisSpacing: 12.0, mainAxisSpacing: 12.0, children: _shots.map((DribbbleShot shot) { return new GridShotItem(shot: shot); }).toList()) ) ] ), ); } SliverAppBar _buildUserInfoContainer(double appBarHeight) { return new SliverAppBar( expandedHeight: appBarHeight, //Set false to hide leading(back button) automaticallyImplyLeading: false, flexibleSpace: new FlexibleSpaceBar( background: new Container( decoration: new BoxDecoration( image: new DecorationImage( image: new NetworkImage(bgImgUrl), fit: BoxFit.cover, ), ), child: new Container( child: new Container( padding: new EdgeInsets.only( top: 40.0, left: 20.0, right: 20.0, bottom: 20.0), decoration: new BoxDecoration( gradient: new LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [new Color(0xCCFFFFFF), Colors.white]) ), child: new Column( crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ new Hero( tag: user.id, child: new CircleAvatar( backgroundImage: new NetworkImage( user.avatarUrl), radius: 40.0 )), new Container( margin: new EdgeInsets.only(top: 10.0), child: new Text(user.name, maxLines: 1, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: new TextStyle( fontSize: 18.0, color: FDColors.fontTitleColor, fontWeight: FontWeight.w500),) ), new Container( margin: new EdgeInsets.only(top: 5.0), child: new Text(user.location, maxLines: 1, overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, style: new TextStyle( fontSize: 11.0, color: FDColors.fontTitleColor),),), new Container( margin: new EdgeInsets.only(top: 5.0), child: new Text( user.bio, textAlign: TextAlign.center, style: new TextStyle( fontSize: 11.0, color: FDColors.fontTitleColor),)), ], ), ), ) ) ) ); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/items/grid_shot_item.dart
import 'package:flutter/material.dart'; import 'package:flutter_drib/model/dribbble_shot.dart'; import 'package:flutter_drib/ui/basic/fdColors.dart'; import 'package:flutter_drib/ui/detail/shot_detail_page.dart'; class GridShotItem extends StatelessWidget { final titleTextStyle = new TextStyle( color: FDColors.fontTitleColor, fontSize: 13.0,); final usernameTextStyle = new TextStyle( fontSize: 11.0, color: FDColors.fontTitleColor); final DribbbleShot shot; GridShotItem({Key key, this.shot}) :assert(shot != null), super(key: key); @override Widget build(BuildContext context) { return new GestureDetector( onTap: () { _gotoShotPage(context); }, child: _buildGridItem() ); } void _gotoShotPage(BuildContext context) { Navigator.push( context, new MaterialPageRoute(builder: (BuildContext context) { return new ShotDetailPage(shot: shot); })); } Widget _buildGridItem() { var itemContent = <Widget>[new Hero( tag: shot.id, child: new DecoratedBox( decoration: new BoxDecoration( borderRadius: new BorderRadius.circular(5.0), image: new DecorationImage( image: new NetworkImage( shot.images.normal), fit: BoxFit.cover, alignment: Alignment.center, ), ), )), ]; if (shot.animated) { itemContent.add(new Container( alignment: AlignmentDirectional.topEnd, margin: const EdgeInsets.only(top: 8.0, right: 8.0), child: new Image.asset("assets/images/ic_gif.png", width: 24.0, height: 16.0), )); } return new Stack( fit: StackFit.expand, children: itemContent, alignment: AlignmentDirectional.topEnd, ); } }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/basic/fdColors.dart
import 'dart:ui'; // Colors in this app. class FDColors { // Official colors from dribbble static const Color pink = const Color(0xFFea4c89); static const Color charcoal = const Color(0xFF333333); static const Color linkBlue = const Color(0xFF3a8bbb); static const Color pro = const Color(0xFF66cccc); static const Color jobsHiring = const Color(0xFF7bbb5e); static const Color teams = const Color(0xFF00b6e3); static const Color playbook = const Color(0xFF66cc99); static const Color slate = const Color(0xFF9da3a5); static const Color dividerColor = const Color(0xFFD9D9D9); static const Color fontTitleColor = const Color(0xFF404040); static const Color fontSubTitleColor = const Color(0xFFA1A1A1); static const Color fontContentColor = const Color(0xFF606060); static const Color fontTipColor = const Color(0xFFA0A0A0); static const Color fontDateColor = const Color(0xFFC0C0C0); static const Color bgColor = const Color(0xFFECECEC); }
0
mirrored_repositories/flutter_dribble/lib/ui
mirrored_repositories/flutter_dribble/lib/ui/basic/fdThemeData.dart
import 'package:flutter/material.dart'; import 'fdColors.dart'; // App's theme data final ThemeData fdThemeData = new ThemeData( primaryColor: FDColors.charcoal );
0
mirrored_repositories/flutter_dribble
mirrored_repositories/flutter_dribble/test/widget_test.dart
// This is a basic Flutter widget test. // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to // find child widgets in the widget tree, read text, and verify that the values of widget properties // are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_drib/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(new MainApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/SpotifyClone-Flutter
mirrored_repositories/SpotifyClone-Flutter/lib/main.dart
import 'package:flutter/material.dart'; import 'package:spotify_clone/Screen/Home.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return Scaffold( body: HomePage(), ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Data/Home.dart
import 'package:spotify_clone/Model/Song.dart'; List<Song> recents = [ Song( coverImage: 'https://i.scdn.co/image/ab67706f0000000240938563ca398084eb43cb21', caption: 'AR Rahman Tamil Collection AR Rahman Tamil Hits Collection AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273605b0a27fa9a476ab21a19f4ab67616d0000b273628bde32da0efa8f91995b7dab67616d0000b273c13a3f23e023484b6fac32d3ab67616d0000b273db3ea10e227f45a2904f077d', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://assets2.sharedplaylists.cdn.crowds.dk/playlists/36/0b/34/sz300x300_tamil-love-failure-songs-a029059d41.jpeg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273476dd4ecf104ced7a778eeb8ab67616d0000b273812bfb4e32feb448e527e8b1ab67616d0000b2739faaa01ed035e4e3c3e4d184ab67616d0000b273a19cdda1305f8a0a0a59b4a0', caption: 'Levi 3', ), Song( coverImage: 'https://i.pinimg.com/736x/7f/d0/62/7fd062088d057e7469a37b81aa56f619.jpg', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://cdn.playlists.net/images/playlists/image/medium/bf23b9570f3005d23620eed40e6ef3fb.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://community.spotify.com/t5/image/serverpage/image-id/84150i636E7C774153B0DC?v=1.0', caption: 'Levi2', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Latest Tamil', ), ]; List<Song> madefor = [ Song( coverImage: 'https://images.8tracks.com/cover/i/010/107/251/random-8939.jpg?rect=0,0,400,400&q=98&fm=jpg&fit=max', caption: 'AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://miro.medium.com/max/600/1*94MOjMwe6v6udVuWYiDqyQ.png', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://images.thequint.com/thequint/2019-02/9d9735c1-4453-48c9-8aff-1c4653e4efb2/IMG_20190227_001443.jpg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://i.gadgets360cdn.com/large/spotify_logo_1585741714525.jpg', caption: 'Levi 3', ), Song( coverImage: 'https://pbs.twimg.com/media/D8lclKYXsAIO-W9.png', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://i.pinimg.com/originals/44/e3/27/44e327f4e854be238e5a6d0801c936a0.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://i1.sndcdn.com/artworks-000557806932-iwvz2w-t500x500.jpg', caption: 'Levi2', ), Song( coverImage: 'https://i.redd.it/czvuc269l3s31.jpg', caption: 'Latest Tamil', ), ]; List<Song> unique = [ Song( coverImage: 'https://assets0.sharedplaylists.cdn.crowds.dk/playlists/db/2b/74/sz300x300_tamil-top-50-daa78d4da0.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSuf7y7ZaiIH4hOdjknWtigAIixaQnpCI66xQ&usqp=CAU', caption: 'AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://somethingturquoise.com/wp-content/uploads/2018/04/Spotify-Playlist-Graphic-COMPLETE-RECEPTION.png', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://economictimes.indiatimes.com/thumb/msid-77237996,width-1200,height-900,resizemode-4,imgsize-34723/untitled-4.jpg?from=mdr', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://external-preview.redd.it/sABFnXWh1f9ovx3Iy7nGD9aMWCUQzM4fRySLVsrIV6c.jpg?auto=webp&s=42e5995de102c55a44b094e36c08456de5e7e172', caption: 'Levi 3', ), Song( coverImage: 'https://images.8tracks.com/cover/i/000/316/246/Various-Artists-Bollywood-Hits-3775.jpg?rect=0,0,600,600&q=98&fm=jpg&fit=max&w=960&h=960', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://external-preview.redd.it/sABFnXWh1f9ovx3Iy7nGD9aMWCUQzM4fRySLVsrIV6c.jpg?auto=webp&s=42e5995de102c55a44b094e36c08456de5e7e172', caption: 'Levi2', ), Song( coverImage: 'https://cdn.playlists.net/images/playlists/image/medium/216723.jpg', caption: 'Latest Tamil', ), ]; List<Song> bestof = [ Song( coverImage: 'https://images.8tracks.com/cover/i/010/107/251/random-8939.jpg?rect=0,0,400,400&q=98&fm=jpg&fit=max', caption: 'AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://miro.medium.com/max/600/1*94MOjMwe6v6udVuWYiDqyQ.png', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://images.thequint.com/thequint/2019-02/9d9735c1-4453-48c9-8aff-1c4653e4efb2/IMG_20190227_001443.jpg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://i.gadgets360cdn.com/large/spotify_logo_1585741714525.jpg', caption: 'Levi 3', ), Song( coverImage: 'https://pbs.twimg.com/media/D8lclKYXsAIO-W9.png', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://i.pinimg.com/originals/44/e3/27/44e327f4e854be238e5a6d0801c936a0.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://i1.sndcdn.com/artworks-000557806932-iwvz2w-t500x500.jpg', caption: 'Levi2', ), Song( coverImage: 'https://i.redd.it/czvuc269l3s31.jpg', caption: 'Latest Tamil', ), ]; List<Song> recommentation = [ Song( coverImage: 'https://i.scdn.co/image/ab67706f0000000240938563ca398084eb43cb21', caption: 'AR Rahman Tamil Collection AR Rahman Tamil Hits Collection AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273605b0a27fa9a476ab21a19f4ab67616d0000b273628bde32da0efa8f91995b7dab67616d0000b273c13a3f23e023484b6fac32d3ab67616d0000b273db3ea10e227f45a2904f077d', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://assets2.sharedplaylists.cdn.crowds.dk/playlists/36/0b/34/sz300x300_tamil-love-failure-songs-a029059d41.jpeg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273476dd4ecf104ced7a778eeb8ab67616d0000b273812bfb4e32feb448e527e8b1ab67616d0000b2739faaa01ed035e4e3c3e4d184ab67616d0000b273a19cdda1305f8a0a0a59b4a0', caption: 'Levi 3', ), Song( coverImage: 'https://i.pinimg.com/736x/7f/d0/62/7fd062088d057e7469a37b81aa56f619.jpg', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://cdn.playlists.net/images/playlists/image/medium/bf23b9570f3005d23620eed40e6ef3fb.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://community.spotify.com/t5/image/serverpage/image-id/84150i636E7C774153B0DC?v=1.0', caption: 'Levi2', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Latest Tamil', ), ]; List<Song> charts = [ Song( coverImage: 'https://images.8tracks.com/cover/i/010/107/251/random-8939.jpg?rect=0,0,400,400&q=98&fm=jpg&fit=max', caption: 'AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://miro.medium.com/max/600/1*94MOjMwe6v6udVuWYiDqyQ.png', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://images.thequint.com/thequint/2019-02/9d9735c1-4453-48c9-8aff-1c4653e4efb2/IMG_20190227_001443.jpg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://i.gadgets360cdn.com/large/spotify_logo_1585741714525.jpg', caption: 'Levi 3', ), Song( coverImage: 'https://pbs.twimg.com/media/D8lclKYXsAIO-W9.png', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://i.pinimg.com/originals/44/e3/27/44e327f4e854be238e5a6d0801c936a0.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://i1.sndcdn.com/artworks-000557806932-iwvz2w-t500x500.jpg', caption: 'Levi2', ), Song( coverImage: 'https://i.redd.it/czvuc269l3s31.jpg', caption: 'Latest Tamil', ), ]; List<Song> foryoulistening = [ Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Levi 3', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Levi2', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Latest Tamil', ), ]; List<Song> recommendedToday = [ Song( coverImage: 'https://i.scdn.co/image/ab67706f0000000240938563ca398084eb43cb21', caption: 'AR Rahman Tamil Collection AR Rahman Tamil Hits Collection AR Rahman Tamil Hits Collection', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273605b0a27fa9a476ab21a19f4ab67616d0000b273628bde32da0efa8f91995b7dab67616d0000b273c13a3f23e023484b6fac32d3ab67616d0000b273db3ea10e227f45a2904f077d', caption: 'Tea Kadai talks', ), Song( coverImage: 'https://assets2.sharedplaylists.cdn.crowds.dk/playlists/36/0b/34/sz300x300_tamil-love-failure-songs-a029059d41.jpeg', caption: 'Depavalli kondatam Covers', ), Song( coverImage: 'https://mosaic.scdn.co/640/ab67616d0000b273476dd4ecf104ced7a778eeb8ab67616d0000b273812bfb4e32feb448e527e8b1ab67616d0000b2739faaa01ed035e4e3c3e4d184ab67616d0000b273a19cdda1305f8a0a0a59b4a0', caption: 'Levi 3', ), Song( coverImage: 'https://i.pinimg.com/736x/7f/d0/62/7fd062088d057e7469a37b81aa56f619.jpg', caption: 'Evergreen Tamil hits', ), Song( coverImage: 'https://cdn.playlists.net/images/playlists/image/medium/bf23b9570f3005d23620eed40e6ef3fb.jpg', caption: 'HillSongs Favourite', ), Song( coverImage: 'https://community.spotify.com/t5/image/serverpage/image-id/84150i636E7C774153B0DC?v=1.0', caption: 'Levi2', ), Song( coverImage: 'https://akm-img-a-in.tosshub.com/indiatoday/images/story/202007/JIO_0.png?j11EnIisIelaFz_yAp461nrEqbiuX56r&size=770:433', caption: 'Latest Tamil', ), ];
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Screen/Home.dart
import 'package:flutter/material.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:spotify_clone/Screen/HomeScreen.dart'; import 'package:spotify_clone/Screen/Search.dart'; void main() { runApp(HomePage()); } class HomePage extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Spotify Clone', theme: ThemeData.dark(), home: MyHomePage(title: 'Spotify Clone APp'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { Widget _widgetBody = HomeScreen(); int _currrentIndex = 0; @override void initState() { // TODO: implement initState super.initState(); } void _onItemTapped(int index) async{ setState(() { if(index == 0){ _currrentIndex = index; _widgetBody = HomeScreen(); } else if(index == 1){ _currrentIndex = index; _widgetBody = SearchScreen(); } else if(index == 2){ _currrentIndex = index; _widgetBody = Center(child: Text('Hell'),); } else if(index == 3){ _currrentIndex = index; _widgetBody = Center(child: Text('Hell'),); } }); } @override Widget build(BuildContext context) { return Scaffold( body: Container( decoration: new BoxDecoration( gradient: new LinearGradient( begin: Alignment.topCenter, end: Alignment.centerRight, colors: [ Color(0XFF383333), Colors.black54, Colors.black54, ], )), child: _widgetBody, ), bottomNavigationBar: Theme( data: Theme.of(context).copyWith( canvasColor: Colors.grey[900], ), child: BottomNavigationBar( currentIndex: _currrentIndex, type: BottomNavigationBarType.fixed, unselectedItemColor: Colors.grey, selectedItemColor: Colors.white, onTap: _onItemTapped, items: [ BottomNavigationBarItem( icon: _currrentIndex==0?Icon(Icons.home, size: 25):Icon(Icons.home_outlined, size: 25), title: Text("Home") ), BottomNavigationBarItem( icon: Icon(Icons.search_outlined, size: 25), title: Text("Search") ), BottomNavigationBarItem( icon: _currrentIndex==2?Icon(Icons.library_music, size: 25):Icon(Icons.library_music_outlined, size: 25), title: Text("Library") ), BottomNavigationBarItem( icon: Icon(MdiIcons.spotify, size: 25), title: Text("Premium") ), ], ), ), ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Screen/Search.dart
import 'package:flutter/material.dart'; import 'package:spotify_clone/Screen/Home.dart'; import 'package:spotify_clone/Widget/Genere.dart'; void main() { runApp(SearchScreen()); } class SearchScreen extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return SearchScreenPage(); } } class SearchScreenPage extends StatefulWidget { SearchScreenPage({Key key, this.title}) : super(key: key); final String title; @override _SearchScreenState createState() => _SearchScreenState(); } class _SearchScreenState extends State<SearchScreenPage> { @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( gradient: LinearGradient(colors: [ Color(0xFF414345), Color(0xFF000000), ], begin: Alignment.topLeft, end: FractionalOffset(0.2, 0.7)), ), child: ListView( children: <Widget>[ SingleChildScrollView( scrollDirection: Axis.vertical, child: Column( children: <Widget>[ Padding(padding: EdgeInsets.all(30.0),), Container( child: Text('Search', style: TextStyle( color: Colors.white.withOpacity(1.0), fontFamily: 'SpotifyFont', fontWeight: FontWeight.w500, fontSize: 50.0, ), ), ), Padding(padding: EdgeInsets.all(10.0),), Container( padding: EdgeInsets.only(left: 10, right: 10), child: Card( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)), clipBehavior: Clip.antiAlias, child: Container( height: 50.0, width: MediaQuery.of(context).size.width, color: Colors.white, child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ Padding(padding: EdgeInsets.only(left:10),), Icon(Icons.search,color: Colors.black,), Padding(padding: EdgeInsets.all(5),), Text('Artists, ',style: TextStyle(color: Colors.black,fontSize: 20.0, fontWeight: FontWeight.bold),), Text('songs or',style: TextStyle(color: Colors.black,fontSize: 20.0,fontWeight: FontWeight.bold),), Text(' podcasts',style: TextStyle(color: Colors.black,fontSize: 20.0,fontWeight: FontWeight.bold),) ], ), ), ), ), Align( alignment: Alignment.topLeft, child: Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Your top genres ',style: TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold),), GridView.builder( itemCount: 2, gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), shrinkWrap: true, controller: ScrollController(keepScrollOffset: false), itemBuilder: (BuildContext context, int index){ return GenereWidget(); }, ), ], ), ), ), ), Align( alignment: Alignment.topLeft, child: Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Browse all',style: TextStyle(fontSize: 17.0, fontWeight: FontWeight.bold),), GridView.builder( itemCount: 18, gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), shrinkWrap: true, controller: ScrollController(keepScrollOffset: false), itemBuilder: (BuildContext context, int index){ return GenereWidget(); }, ), ], ), ), ), ), ], ), ), ], ), ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Screen/HomeScreen.dart
import 'package:flutter/material.dart'; import 'package:spotify_clone/Data/Home.dart'; import 'package:spotify_clone/Screen/Home.dart'; import 'package:spotify_clone/Widget/SongConver.dart'; void main() { runApp(HomeScreen()); } class HomeScreen extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return HomeScreenPage(); } } class HomeScreenPage extends StatefulWidget { HomeScreenPage({Key key, this.title}) : super(key: key); final String title; @override _HomeScreenPageState createState() => _HomeScreenPageState(); } class _HomeScreenPageState extends State<HomeScreenPage> { @override Widget build(BuildContext context) { return Container( child: ListView( children: <Widget>[ SingleChildScrollView( scrollDirection: Axis.vertical, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ Container( alignment: Alignment.topRight, padding: EdgeInsets.only(top: 30, right: 30), child: Icon(Icons.settings_outlined), ), Container( padding: EdgeInsets.only(left: 10), height: 300.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Recently Played', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 250.0, child: ListView.builder( itemCount: recents.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(height: 150,width: 130,song: recents[index],); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Made for sjlouji', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: madefor.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: madefor[index],); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Unique For you', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: unique.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: unique[index]); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Best of Artist', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: bestof.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: bestof[index]); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Recommended radio', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: recommentation.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: recommentation[index]); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Charts', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: charts.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: charts[index]); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'For Your Listening Pleasure', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: foryoulistening.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: foryoulistening[index]); }, ), ), ], ), ), Container( padding: EdgeInsets.only(left: 10), height: 350.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'Recommended for today', style: TextStyle( color: Colors.white.withOpacity(1.0), fontSize: 23.0, fontFamily: 'SpotifyFont', fontWeight: FontWeight.bold), ), Padding( padding: EdgeInsets.all(10.0), ), Container( height: 300.0, child: ListView.builder( itemCount: recommendedToday.length, scrollDirection: Axis.horizontal, itemBuilder: (BuildContext context, int index) { return SongCoverWidget(width: 180.0, height: 220.0,song: recommendedToday[index]); }, ), ), ], ), ), ], ), ), ], ), ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Widget/Genere.dart
import 'package:flutter/material.dart'; import 'package:spotify_clone/Screen/Home.dart'; void main() { runApp(GenereWidget()); } class GenereWidget extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return GenereWidgetPage(); } } class GenereWidgetPage extends StatefulWidget { GenereWidgetPage({Key key, this.title}) : super(key: key); final String title; @override _GenereWidgetPageState createState() => _GenereWidgetPageState(); } class _GenereWidgetPageState extends State<GenereWidgetPage> { @override Widget build(BuildContext context) { return Container( child: GridTile( child: Padding( padding: EdgeInsets.all(10.0), child: Container( height: 10, child: Card( margin: EdgeInsets.symmetric(vertical: 30.0, horizontal: 0), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)), clipBehavior: Clip.antiAlias, ), ), ), ) ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Widget/SongConver.dart
import 'package:flutter/material.dart'; import 'package:spotify_clone/Model/Song.dart'; import 'package:spotify_clone/Screen/Home.dart'; void main() { runApp(SongCoverWidget()); } class SongCoverWidget extends StatelessWidget { // This widget is the root of your application. SongCoverWidget({Key key, this.width, this.height, this.song}) : super(key: key); double width; double height; Song song; @override Widget build(BuildContext context) { return SongCoverWidgetPage(width: width,height: height,song: song,); } } class SongCoverWidgetPage extends StatefulWidget { SongCoverWidgetPage({Key key, this.title, this.width, this.height, this.song}) : super(key: key); final String title; double width; double height; Song song; @override _SongCoverWidgetState createState() => _SongCoverWidgetState(); } class _SongCoverWidgetState extends State<SongCoverWidgetPage> { @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ SizedBox( height: widget.height!=null?widget.height:170.0, width: widget.width!=null?widget.width:160.0, child: Image.network( widget.song.coverImage, fit: BoxFit.fitHeight, ), ), Padding(padding: EdgeInsets.all(5.0)), Container( width: 150, height: 35, child: Text(widget.song.caption, overflow: TextOverflow.ellipsis, maxLines: 2, style: TextStyle( color: Colors.white.withOpacity(1.0), fontFamily: 'SpotifyFont', fontSize: 15.0, ), ), ) ], ), ); } }
0
mirrored_repositories/SpotifyClone-Flutter/lib
mirrored_repositories/SpotifyClone-Flutter/lib/Model/Song.dart
class Song { final String coverImage; final String caption; Song({this.coverImage, this.caption}); }
0
mirrored_repositories/SpotifyClone-Flutter
mirrored_repositories/SpotifyClone-Flutter/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:spotify_clone/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/estimating-text-color-based-on-background-color
mirrored_repositories/estimating-text-color-based-on-background-color/lib/home_page.dart
import 'dart:math'; import 'package:flutter/material.dart'; Color getRandomBackgroundColor() { List<Color> colors = [ ...Colors.primaries, ...Colors.accents, ]; return colors[Random().nextInt(colors.length)]; } Color getTextColorForBackground(Color backgroundColor) { if (ThemeData.estimateBrightnessForColor(backgroundColor) == Brightness.dark) { return Colors.white; } return Colors.black; } class ColorEstimationPage extends StatefulWidget { const ColorEstimationPage({Key? key}) : super(key: key); @override State<ColorEstimationPage> createState() => _ColorEstimationPageState(); } class _ColorEstimationPageState extends State<ColorEstimationPage> { late Color bgColor; late Color textColor; @override void initState() { super.initState(); getColors(); } void getColors() { bgColor = getRandomBackgroundColor(); textColor = getTextColorForBackground(bgColor); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: bgColor, body: Center( child: TextButton( onPressed: () { setState(() { getColors(); }); }, child: Text( "Tap me to get a new color", style: Theme.of(context).textTheme.headline2?.copyWith( color: textColor, ), ), ), ), ); } }
0
mirrored_repositories/estimating-text-color-based-on-background-color
mirrored_repositories/estimating-text-color-based-on-background-color/lib/main.dart
import 'package:fl_dynamic_color/home_page.dart'; import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: const ColorEstimationPage(), ); } }
0
mirrored_repositories/estimating-text-color-based-on-background-color
mirrored_repositories/estimating-text-color-based-on-background-color/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:fl_dynamic_color/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/NitorXK
mirrored_repositories/NitorXK/lib/perfil.dart
import 'package:flutter/material.dart'; class Perfil extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Perfil do usuário'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ const Padding( padding: const EdgeInsets.all(16.0), child: CircleAvatar( radius: 60, // backgroundImage: AssetImage('assets/user_avatar.png'), // Substitua pelo caminho da imagem do usuário ), ), const Text( 'Nome de Usuário', style: TextStyle(fontSize: 20), ), const Text( 'Email:', style: TextStyle(fontSize: 16), ), const Text( 'Data de Nascimento: 01/01/1990', style: TextStyle(fontSize: 16), ), ElevatedButton( onPressed: () { // Implemente a lógica de logout aqui }, child: Text('Logout'), ), ], ), ), ); } }
0
mirrored_repositories/NitorXK
mirrored_repositories/NitorXK/lib/login.dart
import 'dart:convert'; import 'package:flutter/material.dart'; import 'perfil.dart'; import 'package:http/http.dart' as http; class Login extends StatefulWidget { @override _LoginState createState() => _LoginState(); } class _LoginState extends State<Login> { final TextEditingController emailController = TextEditingController(); final TextEditingController passwordController = TextEditingController(); Future<void> _login() async { final String email = emailController.text; final String password = passwordController.text; try { final response = await http.post( Uri.parse('https://eab6-190-115-67-177.ngrok-free.app/login'), // Substitua pelo seu endereço da API headers: <String, String>{ 'Content-Type': 'application/json', }, body: jsonEncode(<String, String>{ 'email': email, 'password': password, }), ); if (response.statusCode == 200) { // Login bem-sucedido, você pode navegar para a tela de perfil Navigator.push( context, MaterialPageRoute(builder: (context) => Perfil()), ); } else { // Tratar erros de login, por exemplo, exibindo uma mensagem de erro ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text('Erro ao fazer login. Verifique suas credenciais.'), )); } } catch (e) { print('Erro na solicitação: $e'); ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text('Erro na solicitação. Verifique sua conexão.'), )); } } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Login de usuário'), ), body: Padding( padding: EdgeInsets.all(16.0), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ const SizedBox(height: 10), TextField( controller: emailController, decoration: InputDecoration( border: OutlineInputBorder(), labelText: 'E-mail', ), ), const SizedBox(height: 10), TextField( controller: passwordController, obscureText: true, decoration: InputDecoration( border: OutlineInputBorder(), labelText: 'Senha', ), ), const SizedBox(height: 10), ElevatedButton( onPressed: _login, child: Text('Logar'), ), ], ), ), ); } }
0
mirrored_repositories/NitorXK
mirrored_repositories/NitorXK/lib/main.dart
import 'package:flutter/material.dart'; import 'package:http/http.dart'; import 'login.dart'; import 'package:carousel_slider/carousel_slider.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed( seedColor: Color.fromARGB(255, 123, 21, 21), primary: Color.fromARGB(255, 24, 35, 74), secondary: Color.fromARGB(255, 184, 32, 32) ), primarySwatch: Colors.deepOrange, useMaterial3: true, ), home: const MyHomePage(title: ''), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({Key? key, required this .title}) : super(key: key); final String title; @override State<MyHomePage> createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; void _incrementCounter() { setState(() { _counter++; }); } void _decrementCounter() { setState(() { _counter--; }); } List<String> listaImagens = [ 'https://images.unsplash.com/photo-1675663186185-a53733496b74?auto=format&fit=crop&q=80&w=2104&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', 'https://images.unsplash.com/photo-1679621219668-2649b35d0021?auto=format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1pYWdlfHx8fGVufDB8fHx8fA%3D%3D', 'https://images.unsplash.com/photo-1508974239320-0a029497e820?auto.format&fit=crop&q=80&w=2070&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D', ]; List<Map<String, String>> listaCarros = [ { "carro": "Ferrari", "modelo": "F40", "ano": "1987", "preco": "R\$ 1.679.000,00", "image": "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimages8.alphacoders.com%2F360%2F360535.jpg&f=1&nofb=1&ipt=c99f42fc4c296f0a25ae8a054b0fc9c461e5642ada2f502cbc0900a710bb61ee&ipo=images", }, { "carro": "maserati", "modelo": "GranTurismo", "ano": "2018", "preco": "R\$ 1.985.000,00", "image": "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fthecarguy.com.au%2Fwp-content%2Fuploads%2F2018%2F02%2FLarge-12937-GranTurismoSportMY18a.jpg&f=1&nofb=1&ipt=82a8753483798dc7dd2b39d3538d484e75f31b70133572d4838ad8270c53a0d9&ipo=images", }, { "carro": "Lamborghini", "modelo": "Aventador", "ano": "2018", "preco": "R\$ 1.479.000,00", "image": "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.lamborghini.com%2Fsites%2Fit-en%2Ffiles%2FDAM%2Flamborghini%2Fmodel%2Faventador%2Faventador-sv%2Fslider%2Faventador-sv.jpg&f=1&nofb=1&ipt=5393b9bc7f4af3ac0905b181c5e9b548ce577cfc58c535519104297bb644ad0b&ipo=images", } ]; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( backgroundColor: Theme.of(context).colorScheme.primary, title: Text(widget.title), actions: [ TextButton( onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => Login()), ); }, child: const Text( 'Login', style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold, ), ), ), ], ), body: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ // Carrossel CarouselSlider( items: listaImagens.map((url) { return Container( margin: const EdgeInsets.all(10), width: MediaQuery.of(context).size.width - 20, height: 230, decoration: BoxDecoration( color: Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(10), ), child: Image.network( url, fit: BoxFit.cover, ), ); }).toList(), options: CarouselOptions( height: 200, enableInfiniteScroll: true, autoPlay: true, autoPlayInterval: const Duration(seconds: 3), autoPlayAnimationDuration: const Duration(milliseconds: 800), autoPlayCurve: Curves.fastOutSlowIn, ), ), Container( width: MediaQuery.of(context).size.width, height: 40, color: Theme.of(context).colorScheme.primary, padding: const EdgeInsets.only(left: 10, top: 0, bottom: 0), child: const Align( alignment: Alignment.centerLeft, child: Text( 'Carros mais exclusivos do mundo', style: TextStyle( fontSize: 20, color: Colors.white, fontFamily: 'Roboto', ), ), ), ), // cards com imagnes e texto dos carros Container( width: MediaQuery.of(context).size.width, height: 200, padding: const EdgeInsets.all(10), child: ListView( scrollDirection: Axis.horizontal, children: listaCarros.map((carro) { return Container( width: 250, margin: const EdgeInsets.only(right: 10), decoration: BoxDecoration( color: Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(10), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.network( carro['image'] ?? '', // Use '' (string vazia) se carro['image'] for nulo height: 77, width: 250, fit: BoxFit.cover, ), Padding( padding: const EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Carro: ${carro["carro"]}', style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white)), Text('Modelo: ${carro["modelo"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), Text('Ano: ${carro["ano"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), Text('Preço: ${carro["preco"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), ], ), ), ], ), ); }).toList(), ), ), Container( width: MediaQuery.of(context).size.width, height: 200, padding: const EdgeInsets.all(10), child: ListView( scrollDirection: Axis.horizontal, children: listaCarros.map((carro) { return Container( width: 250, margin: const EdgeInsets.only(right: 10), decoration: BoxDecoration( color: Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(10), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.network( carro['image'] ?? '', // Use '' (string vazia) se carro['image'] for nulo height: 77, width: 250, fit: BoxFit.cover, ), Padding( padding: const EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Carro: ${carro["carro"]}', style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white)), Text('Modelo: ${carro["modelo"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), Text('Ano: ${carro["ano"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), Text('Preço: ${carro["preco"]}', style: const TextStyle(fontSize: 14, color: Colors.white)), ], ), ), ], ), ); }).toList(), ), ), // footer Container( width: MediaQuery.of(context).size.width, height: 80, color: Theme.of(context).colorScheme.primary, padding: const EdgeInsets.only(left: 10, top: 0, bottom: 0), child: const Align( alignment: Alignment.centerLeft, child: Text( '', style: TextStyle( fontSize: 20, color: Colors.white, fontFamily: 'Roboto', ), ), ), ), ], ), ), ); } }
0
mirrored_repositories/NitorXK
mirrored_repositories/NitorXK/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/annoying_friend_app
mirrored_repositories/annoying_friend_app/lib/Settings.dart
import 'package:annoying_friend_app/Data/Texts.dart'; import 'package:annoying_friend_app/Services.dart'; import 'package:flutter/material.dart'; class Settings extends StatefulWidget { const Settings({super.key}); @override State<StatefulWidget> createState() => SettingsState(); } class SettingsState extends State<Settings> { bool light = true; final LocalNotification _localNotification = LocalNotification(); final Notificationlist _notificationlist = Notificationlist(); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( automaticallyImplyLeading: false, title: const Text("Settings"), backgroundColor: Colors.black87, ), body: ListView(padding: const EdgeInsets.all(10), children: <Widget>[ const Center( child: Card( elevation: 4.0, child: Column(children: <Widget>[ // custom card that shows annoying friend stuff. ])), ), const Padding( padding: EdgeInsets.all(16.0), child: Text( "Display", style: TextStyle( fontSize: 18.0, ), ), ), Card( elevation: 4.0, child: Column( children: <Widget>[ // stop receiving notifications ListTile( title: const Text("Notifications"), trailing: Row( mainAxisSize: MainAxisSize.min, children: <Widget>[ //Notifications toggle switch Switch( activeColor: Colors.yellow, value: light, onChanged: (bool value) { setState(() { light = value; if (light) { _localNotification.scheduleRandomNotification( _notificationlist.notificationList); } else { _localNotification.cancelAllNotifications(); } }); }), ], ), ), ], )), const Padding( padding: EdgeInsets.all(16.0), child: Text( "More", style: TextStyle( fontSize: 18.0, ), ), ), Card( elevation: 4.0, child: Column(children: <Widget>[ //Displaying name ListTile( title: const Text("Feed Back"), trailing: Row( mainAxisSize: MainAxisSize.min, children: <Widget>[ //feedback page IconButton( icon: const Icon(Icons.arrow_forward_ios), onPressed: () {}, ) ], ), ), /// Terms and conditions // ListTile( // leading: const Text("Terms and Conditions"), // trailing: Row( // mainAxisSize: MainAxisSize.min, // children: <Widget>[ // //Terms and Conditions // IconButton( // icon: // const Icon(Icons.arrow_forward_ios), // onPressed: () { // }, // ), // ], // ), // ), const ListTile( title: Text("About"), trailing: Row( mainAxisSize: MainAxisSize.min, children: <Widget>[ //version Text('Mock version'), ], ), ) ])) ])); } }
0
mirrored_repositories/annoying_friend_app
mirrored_repositories/annoying_friend_app/lib/main.dart
import 'package:flutter/material.dart'; import 'Services.dart'; import 'onboarding/onboarding_1.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await LocalNotification.init(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Annoying Friend', theme: ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or simply save your changes to "hot reload" in a Flutter IDE). // Notice that the counter didn't reset back to zero; the application // is not restarted. //primarySwatch: Colors.blue, primaryColor: Colors.black87), debugShowCheckedModeBanner: false, home: OnboardingPage(pages: [ //#1 OnboardingPageModel( title: "Hello", description: "Welcome to Annoying Friend App", image: 'assets/img/sketch-1679189034408-removebg-preview.png', bgColor: Colors.white, ), //#2 OnboardingPageModel( title: "What is it about?", description: "This App is designed to send you random notifications on random days with random content to either annoy,cheer or make you smile.", image: 'assets/img/sketch-1679189034408-removebg-preview.png', bgColor: Colors.white), //#3 OnboardingPageModel( title: "Why?", description: "Well because we all need that 'One' annoying friend.", image: 'assets/img/sketch-1679189034408-removebg-preview.png', bgColor: Colors.white), ])); } }
0
mirrored_repositories/annoying_friend_app
mirrored_repositories/annoying_friend_app/lib/Services.dart
import 'dart:math'; import 'package:timezone/data/latest.dart' as tz; import 'package:timezone/timezone.dart' as tz; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; class Notificationmanager extends StatelessWidget { const Notificationmanager({super.key}); @override Widget build(BuildContext context) { // TODO: implement build throw UnimplementedError(); } } class LocalNotification { static final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); //initialize the local notification static Future init() async { // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project const AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings('ic_launcher_adaptive_fore'); final DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings( onDidReceiveLocalNotification: (id, title, body, payload) {}, ); const LinuxInitializationSettings initializationSettingsLinux = LinuxInitializationSettings(defaultActionName: 'Open notification'); final InitializationSettings initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsDarwin, linux: initializationSettingsLinux); _flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (details) {}); } //show a simple notification static Future showSimpleNotification({ required String title, required String body, required String payload, }) async { const AndroidNotificationDetails androidNotificationDetails = AndroidNotificationDetails('your channel id', 'your channel name', channelDescription: 'your channel description', importance: Importance.max, priority: Priority.high, ticker: 'ticker'); const NotificationDetails notificationDetails = NotificationDetails(android: androidNotificationDetails); await _flutterLocalNotificationsPlugin .show(0, title, body, notificationDetails, payload: payload); } Future initializetimezone() async { tz.initializeTimeZones(); } //scheduling random notifications Future<void> scheduleRandomNotification(List<String> notificationList) async { await initializetimezone(); final Random random = Random(); DateTime dt = DateTime.now(); //converting DateTime to TZDateTime final scheduledTime = tz.TZDateTime.from(dt, tz.local); // random days between 0 and 29 final int randomDays = random.nextInt(30); // random hours between 0 and 24 final int randomHours = random.nextInt(24); //random minutes between 0 and 59 final int randomMinutes = random.nextInt(60); //setting schedule time to set random day, hour and minutes final updatedScheduledTime = scheduledTime.add( Duration(days: randomDays, hours: randomHours, minutes: randomMinutes)); if (updatedScheduledTime.isBefore(dt)) { //If the scheduled time is in the pas, add one day to it updatedScheduledTime.add(const Duration(days: 1)); } await _flutterLocalNotificationsPlugin.zonedSchedule( 0, 'Random Notification', notificationList[random.nextInt(notificationList.length)], updatedScheduledTime, const NotificationDetails( android: AndroidNotificationDetails( 'random_channel_id', 'Random Channel', importance: Importance.high, ), ), androidAllowWhileIdle: true, uiLocalNotificationDateInterpretation: UILocalNotificationDateInterpretation.absoluteTime, ); } // cancel all Notifications Future<void> cancelAllNotifications() async { await _flutterLocalNotificationsPlugin.cancelAll(); } }
0
mirrored_repositories/annoying_friend_app/lib
mirrored_repositories/annoying_friend_app/lib/Data/Texts.dart
class Notificationlist { // this list contains 20 random texts var notificationList = [ 'yoh, the brain named itself?', 'You good?', 'I am a concept of a shower thought', 'By the way, I think you are awesome', 'We should bring back ugly sweaters', 'yoU aRe So aNnOyInG!', 'Do you think day dreams come true?', 'All my friend are heathens take it slow...', 'M nOt An aLgOrItHm By ThE wAy', 'KrXVWKAZERTDWrD', 'all phones are the same and not the same at the same time', 'i dont care what you say Edge is the best browser', 'And iiiiiiiiii eeeeee iiiii will always love you', 'i dare you to tickle yourself', 'try pronouncing Eigengrau which is the color of a pitch-back room.', 'Hey you national animal of Scotland.... i mean you unicorn', 'THiccc', 'crazy', 'u got this' 'if no one will say it i will.I am proud of you', ]; }
0
mirrored_repositories/annoying_friend_app/lib
mirrored_repositories/annoying_friend_app/lib/onboarding/onboarding_1.dart
import 'package:flutter/material.dart'; import '../Settings.dart'; class OnboardingPageModel { final String title; final String description; final String image; final Color bgColor; final Color textColor; OnboardingPageModel( {required this.title, required this.description, required this.image, this.bgColor = Colors.white, this.textColor = Colors.black87}); } class OnboardingPage extends StatefulWidget { final List<OnboardingPageModel> pages; const OnboardingPage({Key? key, required this.pages}) : super(key: key); @override OnboardingPageState createState() => OnboardingPageState(); } class OnboardingPageState extends State<OnboardingPage> { // Store the currently visible page int _currentPage = 0; // Define a controller for the pageview final PageController _pageController = PageController(initialPage: 0); @override Widget build(BuildContext context) { return Scaffold( body: AnimatedContainer( duration: const Duration(milliseconds: 250), color: widget.pages[_currentPage].bgColor, child: SafeArea( child: Column( children: [ Expanded( // Page view to render each page child: PageView.builder( controller: _pageController, itemCount: widget.pages.length, onPageChanged: (idx) { // Change current page when page view changes setState(() { _currentPage = idx; }); }, itemBuilder: (context, idx) { final item = widget.pages[idx]; return Column( children: [ Expanded( flex: 3, child: Padding( padding: const EdgeInsets.all(32.0), child: Image.asset( item.image, ), ), ), Expanded( flex: 1, child: Column(children: [ Padding( padding: const EdgeInsets.all(16.0), child: Text(item.title, style: Theme.of(context) .textTheme .titleLarge ?.copyWith( fontWeight: FontWeight.bold, color: item.textColor, )), ), Container( constraints: const BoxConstraints(maxWidth: 280), padding: const EdgeInsets.symmetric( horizontal: 24.0, vertical: 8.0), child: Text(item.description, textAlign: TextAlign.center, style: Theme.of(context) .textTheme .bodyMedium ?.copyWith( color: item.textColor, )), ) ])) ], ); }, ), ), // Current page indicator Row( mainAxisAlignment: MainAxisAlignment.center, children: widget.pages .map((item) => AnimatedContainer( duration: const Duration(milliseconds: 250), width: _currentPage == widget.pages.indexOf(item) ? 20 : 4, height: 4, margin: const EdgeInsets.all(2.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10.0)), )) .toList(), ), // Bottom buttons SizedBox( height: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ TextButton( onPressed: () { //TODO Handle Skipping onboarding page Navigator.push(context, MaterialPageRoute(builder:(context) => const Settings())); }, child: const Text( "Skip", style: TextStyle(color: Colors.black87), )), TextButton( onPressed: () { if (_currentPage == widget.pages.length - 1) { // This is the last page Navigator.push(context, MaterialPageRoute(builder:(context) => const Settings())); } else { _pageController.animateToPage(_currentPage + 1, curve: Curves.easeInOutCubic, duration: const Duration(milliseconds: 250)); } }, child: Text( _currentPage == widget.pages.length - 1 ? "Finish" : "Next", style: const TextStyle(color: Colors.black), ), ), ], ), ) ], ), ), ), ); } }
0
mirrored_repositories/annoying_friend_app
mirrored_repositories/annoying_friend_app/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:annoying_friend_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/streams-demo
mirrored_repositories/streams-demo/lib/main.dart
import 'dart:async'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Stream Demo', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: 'Flutter Stream Counter'), ); } } class MyHomePage extends StatefulWidget { MyHomePage({Key? key, required this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { int _counter = 0; final StreamController<int> _streamController = StreamController<int>(); @override void dispose() { _streamController.close(); super.dispose(); } void _incrementCounter() { _counter++; _streamController.sink.add(_counter); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( 'You have pushed the button this many times:', ), StreamBuilder<int>( stream: _streamController.stream, initialData: 0, builder: (context, snapshot) { return Text( '${snapshot.data}', style: Theme.of(context).textTheme.headline4, ); }), ], ), ), floatingActionButton: FloatingActionButton( onPressed: _incrementCounter, tooltip: 'Increment', child: Icon(Icons.add), ), ); } }
0
mirrored_repositories/streams-demo
mirrored_repositories/streams-demo/test/widget_test.dart
import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:counter_streams/main.dart'; void main() { testWidgets('Counter increments smoke test', (tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/openings-moe
mirrored_repositories/openings-moe/lib/main.dart
import 'package:flutter/material.dart'; import 'pages/opening_list_page.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.green, ), home: OpeningListPage(title: 'Opening List'), ); } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/viewModels/opening_list_viewmodel.dart
import 'dart:collection'; import 'package:scoped_model/scoped_model.dart'; import '../models/opening.dart'; import '../models/opening_filter_type.dart'; class OpeningListViewModel extends Model { List<Opening> _openingListSource; List<Opening> get openingListSource => _openingListSource; set openingListSource(List<Opening> openings) { _openingListSource = openings; _openingList = openings.map((x) => x).toList(); notifyListeners(); } List<Opening> _openingList; List<Opening> get openingList => _openingList; set openingList(List<Opening> openings) { _openingList = openings; notifyListeners(); } void filterOpenings() { var x = openingListSource; switch (currentFilter) { case OpeningFilterType.Opening: openingList = x.where((o) { var x = o.title.contains(RegExp("[O|o]pening")); return x; }).toList(); break; case OpeningFilterType.Ending: openingList = x.where((o) => o.title.contains(RegExp("[E|e]nding"))).toList(); break; default: openingList = x; break; } } void setOpeningList(List<Opening> openingList) {} OpeningFilterType _currentFilter; OpeningFilterType get currentFilter => _currentFilter; set currentFilter(OpeningFilterType filter) { _currentFilter = filter; notifyListeners(); } final Map<String, bool> _filterOptions = LinkedHashMap.fromIterables(["Opening", "Ending"], [false, false]); Map<String, bool> get filterOptions => _filterOptions; void toggleFilter(String label, value) { filterOptions[label] = value; notifyListeners(); } void resetFilter() { filterOptions.forEach((x, y) => filterOptions[x] = false); notifyListeners(); } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/widgets/text_hero.dart
import 'package:flutter/material.dart'; class TextHero extends StatelessWidget { final String text; final TextStyle style; final TextOverflow overflow; TextHero(this.text, {this.style, this.overflow}); @override Widget build(BuildContext context) { return Hero( tag: text, child: new Material( color: Colors.transparent, child: Text( text, style: style, overflow: overflow, ), ), ); } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/widgets/speed_dial_fab.dart
import 'dart:math' as math; import 'package:flutter/material.dart'; class SpeedDialFab extends StatelessWidget { final List<SpeedDialFabData> childFabs; final VoidCallback mainFabAction; final IconData mainFabIcon; final AnimationController controller; SpeedDialFab( this.mainFabIcon, { this.mainFabAction, this.controller, this.childFabs, }); @override Widget build(BuildContext context) { return childFabs != null ? buildFabs(context) : null; } Widget buildFabs(BuildContext context) { var bgColor = Theme.of(context).cardColor; var fgColor = Theme.of(context).accentColor; return Column( mainAxisSize: MainAxisSize.min, children: List.generate(childFabs.length, (int index) { Widget child = Container( height: 70.0, width: 56.0, alignment: FractionalOffset.topCenter, child: ScaleTransition( scale: CurvedAnimation( parent: controller, curve: Interval(0.0, 1.0 - index / childFabs.length / 2.0, curve: Curves.easeOut), ), child: FloatingActionButton( heroTag: childFabs[index], backgroundColor: bgColor, mini: true, child: Icon(childFabs[index].iconData, color: fgColor), onPressed: childFabs[index].action, ), ), ); return child; }).toList() ..add( buildMainFab(), ), ); } Widget buildMainFab() { return FloatingActionButton( heroTag: "MainFAB", child: AnimatedBuilder( animation: controller, builder: (BuildContext context, Widget child) { return Transform( transform: Matrix4.rotationZ(controller.value * 0.5 * math.pi), alignment: FractionalOffset.center, child: Icon(controller.isDismissed ? mainFabIcon : Icons.close), ); }, ), onPressed: mainFabAction ?? () { if (controller.isDismissed) { controller.forward(); } else { controller.reverse(); } }, ); } } class SpeedDialFabData { IconData iconData; VoidCallback action; String tooltipText; SpeedDialFabData({this.iconData, this.action, this.tooltipText}); }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/pages/opening_detail_page.dart
import 'package:flutter/material.dart'; import 'package:video_player/video_player.dart'; import '../models/opening.dart'; import '../services/openings_service.dart'; import '../widgets/text_hero.dart'; class OpeningDetailPage extends StatefulWidget { final String title; final Opening openingData; OpeningDetailPage({this.title, this.openingData}); @override _OpeningDetailPageState createState() => new _OpeningDetailPageState(); } class _OpeningDetailPageState extends State<OpeningDetailPage> { VideoPlayerController _videoPlayerController; VoidCallback _controllerListener; bool _initialized = false; @override void initState() { super.initState(); _controllerListener = () { _initialized = _videoPlayerController.value.initialized; if (_videoPlayerController.value.hasError) { debugPrint(_videoPlayerController.value.errorDescription); } setState(() {}); }; _videoPlayerController = VideoPlayerController .network("${OpeningsService.videoUrl}/${widget.openingData.file}") ..addListener(_controllerListener) ..initialize() ..play(); } @override void dispose() { super.dispose(); _videoPlayerController.removeListener(_controllerListener); if (_videoPlayerController.value.isPlaying) { _videoPlayerController.pause(); } _videoPlayerController.dispose(); } @override Widget build(BuildContext context) { return new Scaffold( appBar: AppBar( title: new TextHero( widget.title, style: TextStyle( fontFamily: "Roboto", decoration: TextDecoration.none, color: Colors.white, fontSize: 16.0, fontWeight: FontWeight.normal, ), overflow: TextOverflow.fade, ), ), body: buildContent(), floatingActionButton: _initialized ? FloatingActionButton( heroTag: "MainFAB", onPressed: _videoPlayerController.value.isPlaying ? _videoPlayerController.pause : _videoPlayerController.play, child: (_videoPlayerController?.value?.isPlaying ?? false) ? Icon(Icons.pause) : Icon(Icons.play_arrow), ) : null, floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, ); } Widget buildContent() { return Center( child: _initialized ? AspectRatio( aspectRatio: 1280 / 720, child: new Stack( fit: StackFit.passthrough, children: <Widget>[ VideoPlayer( _videoPlayerController, ), Align( alignment: Alignment.bottomCenter, child: _initialized ? VideoProgressIndicator( _videoPlayerController, allowScrubbing: true, ) : null, ) ], ), ) : CircularProgressIndicator(), ); } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/pages/opening_list_page.dart
import 'package:flutter/material.dart'; import 'package:scoped_model/scoped_model.dart'; import '../models/opening.dart'; import '../models/opening_filter_type.dart'; import '../services/openings_service.dart'; import '../viewModels/opening_list_viewmodel.dart'; import '../widgets/speed_dial_fab.dart'; import '../widgets/text_hero.dart'; import 'opening_detail_page.dart'; class OpeningListPage extends StatefulWidget { OpeningListPage({Key key, this.title}) : super(key: key); final String title; @override _OpeningListPageState createState() => _OpeningListPageState(); } class _OpeningListPageState extends State<OpeningListPage> with SingleTickerProviderStateMixin { GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>(); OpeningListViewModel _viewModel; AnimationController _fabAnimationController; List<SpeedDialFabData> childFabs; @override void initState() { // TODO: implement initState super.initState(); _viewModel = OpeningListViewModel(); _fabAnimationController = AnimationController( vsync: this, duration: Duration(milliseconds: 500), ); childFabs = <SpeedDialFabData>[ SpeedDialFabData( iconData: Icons.filter_list, action: openFilterMenu, tooltipText: "Filter", ), SpeedDialFabData( iconData: Icons.sort, action: () => _scaffoldKey.currentState.showSnackBar(SnackBar( content: Text("Coming Soon"), )), tooltipText: "Sort", ), SpeedDialFabData( iconData: Icons.search, action: () => _scaffoldKey.currentState.showSnackBar(SnackBar( content: Text("Coming Soon"), )), tooltipText: "Search", ), ]; } @override Widget build(BuildContext context) { return ScopedModel<OpeningListViewModel>( model: _viewModel, child: Scaffold( key: _scaffoldKey, appBar: AppBar( title: Text(widget.title), ), body: Center( child: buildContent(), ), floatingActionButton: SpeedDialFab( Icons.menu, controller: _fabAnimationController, childFabs: childFabs, ), ), ); } Widget buildError(Object error) { var ex = error as Exception; return Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( "Error: " + ex.toString(), textAlign: TextAlign.center, ), RaisedButton( onPressed: () { setState(() {}); }, child: Text( "Retry", ), ), ], ); } Widget buildList() { return new ScopedModelDescendant<OpeningListViewModel>( builder: (context, child, model) { return ListView.builder( itemBuilder: (context, index) { var openingData = model.openingList[index]; var title = openingData.source + " - " + openingData.title; var song = openingData.song; var subtitle = song != null ? Text( song.title, style: TextStyle( fontSize: 12.0, ), ) : null; return Container( decoration: BoxDecoration( border: Border( bottom: BorderSide(color: Colors.green, width: 0.25)), ), child: ListTile( title: TextHero( title, style: TextStyle( fontFamily: "Roboto", decoration: TextDecoration.none, color: Colors.black, fontSize: 14.0, fontWeight: FontWeight.normal, ), ), subtitle: subtitle, onTap: () => openDetail(title, openingData), ), ); }, itemCount: model.openingList.length, shrinkWrap: true, ); }, ); } Widget buildContent() { return Container( child: _viewModel.openingListSource == null ? FutureBuilder<List<Opening>>( future: OpeningsService.getOpeningList(), builder: (context, snapshot) { switch (snapshot.connectionState) { case ConnectionState.done: if (snapshot.hasError) { return buildError(snapshot.error); } _viewModel.openingListSource = snapshot.data; return buildList(); case ConnectionState.none: case ConnectionState.waiting: return CircularProgressIndicator(); default: } }, ) : buildList(), ); } Widget buildFilterBottomSheet(BuildContext context) { var widgets = _viewModel.filterOptions.keys .map((x) => buildFilterOptionItem(x)) .toList(); var clearButton = buildButton("Clear", clearFilter); var saveButton = buildButton("Filter", saveFilter); var buttonContainer = Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, children: <Widget>[ clearButton, saveButton, ], ); widgets.add(buttonContainer); return ScopedModel<OpeningListViewModel>( model: _viewModel, child: Padding( padding: const EdgeInsets.all(8.0), child: Container( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: widgets, ), ), ), ); } Widget buildButton(String label, VoidCallback action) { return RaisedButton( color: Theme.of(context).primaryColor, onPressed: action, child: Text( label, style: Theme.of(context).accentTextTheme.button, ), ); } Widget buildFilterOptionItem(String label) { return ScopedModelDescendant<OpeningListViewModel>( builder: (context, child, model) { return Material( child: InkWell( onTap: () => model.toggleFilter(label, !model.filterOptions[label]), child: Row( children: <Widget>[ Checkbox( value: model.filterOptions[label], onChanged: (value) { model.toggleFilter(label, value); }, ), Text(label), ], ), ), ); }, ); } void openDetail(String title, Opening openingData) { Navigator.of(context).push( MaterialPageRoute( builder: (context) { return OpeningDetailPage( title: title, openingData: openingData, ); }, ), ); } void openFilterMenu() async { var filterVal = await showModalBottomSheet( context: context, builder: (context) => buildFilterBottomSheet(context), ); if (filterVal == null) { _viewModel.resetFilter(); } _viewModel.currentFilter = filterVal; _viewModel.filterOpenings(); } void clearFilter() { _viewModel.resetFilter(); Navigator.of(context).pop(OpeningFilterType.None); } void saveFilter() { var filter = _viewModel.filterOptions; var result = OpeningFilterType.None; if (filter["Opening"] && filter["Ending"]) { result = OpeningFilterType.None; } else if (filter["Opening"]) { result = OpeningFilterType.Opening; } else if (filter["Ending"]) { result = OpeningFilterType.Ending; } Navigator.of(context).pop(result); } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/models/opening_filter_type.dart
enum OpeningFilterType { Opening, Ending, None, }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/models/opening.dart
import 'song.dart'; class Opening { String title; String source; String file; Song song; Opening({this.title, this.source, this.file, this.song}); Opening.fromJson(Map<String, dynamic> json) { this.title = json["title"]; this.source = json["source"]; this.file = json["file"]; this.song = json["song"] != null ? Song.fromJson(json["song"]) : null; } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/models/opening_detail.dart
import 'opening.dart'; class OpeningDetail extends Opening { String success; String comment; String subtitles; OpeningDetail.fromJson(Map<String, dynamic> json) : super.fromJson(json) { this.success = json["success"]; this.comment = json["comment"]; this.subtitles = json["subtitles"]; } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/models/song.dart
class Song { String title; String artist; Song.fromJson(Map<String, dynamic> json) { this.title = json["title"]; this.artist = json[artist]; } }
0
mirrored_repositories/openings-moe/lib
mirrored_repositories/openings-moe/lib/services/openings_service.dart
import 'dart:async'; import 'dart:convert'; import 'package:http/http.dart' as http; import '../models/opening.dart'; class OpeningsService { static const String baseUrl = "http://openings.moe"; static const String apiUrl = "$baseUrl/api"; static const String videoUrl = "$baseUrl/video"; static Future<List<Opening>> getOpeningList( {bool shouldShuffle = false}) async { await Future.delayed(Duration(milliseconds: 1000)); final api = "$apiUrl/list.php"; final response = await http.get(api); final List jsonArr = json.decode(response.body); return jsonArr.map((openingJson) => Opening.fromJson(openingJson)).toList(); } }
0
mirrored_repositories/openings-moe
mirrored_repositories/openings-moe/test/widget_test.dart
// This is a basic Flutter widget test. // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to // find child widgets in the widget tree, read text, and verify that the values of widget properties // are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:openings_moe/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(new MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/flutter_real_estate_app
mirrored_repositories/flutter_real_estate_app/lib/main.dart
import 'package:flutter/material.dart'; import 'package:flutter_real_estate_app_ui/screens/home_page_screen.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Real Estate App', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: HomePageScreen(), ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/models/data_model.dart
class House { House({ this.id, this.amount, this.address, this.bedrooms, this.bathrooms, this.squarefoot, this.garages, this.kitchen, }); int amount; int bedrooms; int bathrooms; int garages; int kitchen; String address; double squarefoot; int id; }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/custom_widgets/house_widget.dart
import 'package:flutter/material.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; import 'package:google_fonts/google_fonts.dart'; class HouseWidget extends StatelessWidget { final String number; final String type; HouseWidget({ this.number, this.type, }); @override Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container( height: 70, width: 70, decoration: BoxDecoration( borderRadius: BorderRadius.circular( 18.0, ), color: ColorConstant.kWhiteColor, border: Border.all(color: Colors.grey[300]), ), child: Center( child: Text( number, style: GoogleFonts.notoSans( fontSize: 20, color: Colors.black, fontWeight: FontWeight.w600, ), ), ), ), SizedBox( height: 10, ), Text( type, style: GoogleFonts.notoSans( fontSize: 16, color: Colors.black, ), ), ], ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/custom_widgets/floating_widget.dart
import 'package:flutter/material.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; class FloatingWidget extends StatelessWidget { final IconData leadingIcon; final String txt; FloatingWidget({ Key key, this.leadingIcon, this.txt, }) : super(key: key); @override Widget build(BuildContext context) { return Container( height: 55, width: 150, child: FloatingActionButton( elevation: 5, onPressed: () {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(75.0), ), heroTag: null, child: Ink( decoration: BoxDecoration( color: ColorConstant.kFABBackColor, borderRadius: BorderRadius.circular(75.0), ), child: Container( constraints: BoxConstraints( maxWidth: 300.0, minHeight: 50.0, ), alignment: Alignment.center, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( leadingIcon, color: Colors.white, ), SizedBox( width: 80, child: Text( txt, textAlign: TextAlign.center, style: TextStyle( color: Colors.white, fontSize: 15, ), ), ), ], ), ), ), ), ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/custom_widgets/filter_widget.dart
import 'package:flutter/material.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; import 'package:google_fonts/google_fonts.dart'; class FilterWidget extends StatelessWidget { final String filterTxt; const FilterWidget({ Key key, this.filterTxt, }) : super(key: key); @override Widget build(BuildContext context) { return Card( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(40.0), ), child: Container( height: 45, decoration: BoxDecoration( color: ColorConstant.kFilterBackColor, borderRadius: BorderRadius.circular(40.0), ), child: Center( child: Padding( padding: const EdgeInsets.only( left: 15, right: 15, ), child: Text( filterTxt, style: GoogleFonts.notoSans( fontSize: 18, fontWeight: FontWeight.w500, color: ColorConstant.kBlackColor, ), ), ), ), ), ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/custom_widgets/menu_widget.dart
import 'package:flutter/material.dart'; class MenuWidget extends StatelessWidget { final IconData iconImg; final Color iconColor; final Color conBackColor; final Function() onbtnTap; MenuWidget({ Key key, @required this.iconImg, @required this.iconColor, this.conBackColor, this.onbtnTap, }) : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { onbtnTap(); }, child: Container( height: 50, width: 50, decoration: BoxDecoration( color: conBackColor, border: Border.all( color: Colors.grey[200], ), borderRadius: BorderRadius.circular(20.0), ), child: Icon( iconImg, color: iconColor, ), ), ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/custom_widgets/image_widget.dart
import 'package:flutter/material.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; import 'package:flutter_real_estate_app_ui/models/data_model.dart'; import 'package:flutter_real_estate_app_ui/screens/item_detail_screen.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:intl/intl.dart'; class ImageWidget extends StatelessWidget { House house; int imgpath_index; List<String> imageList; ImageWidget( this.house, this.imgpath_index, this.imageList, ); @override Widget build(BuildContext context) { final oCcy = new NumberFormat("##,##,###", "en_INR"); var screenWidth = MediaQuery.of(context).size.width; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ GestureDetector( onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ItemDetailScreen( this.house, this.imgpath_index, this.imageList, ), ), ); }, child: Container( height: 160, width: screenWidth, padding: EdgeInsets.only(left: 12, right: 12), decoration: BoxDecoration( borderRadius: BorderRadius.circular(20.0), image: DecorationImage( fit: BoxFit.fill, image: AssetImage( imageList[imgpath_index], ), ), ), child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: <Widget>[ Padding( padding: const EdgeInsets.only( top: 10, ), child: Container( height: 50.0, width: 50.0, decoration: BoxDecoration( color: ColorConstant.kWhiteColor, borderRadius: BorderRadius.circular(18), ), child: Icon( Icons.favorite_border, ), ), ), ], ), ), ), Padding( padding: const EdgeInsets.only( left: 10, top: 15, bottom: 10, ), child: Row( children: <Widget>[ Text( "\$" + "${oCcy.format(house.amount)}", style: GoogleFonts.notoSans( fontSize: 22, fontWeight: FontWeight.w600, ), ), SizedBox( width: 10, ), Text( house.address, style: GoogleFonts.notoSans( fontSize: 15, color: ColorConstant.kGreyColor, ), ), ], ), ), Padding( padding: const EdgeInsets.only( left: 10, top: 0, bottom: 10, ), child: Text( house.bedrooms.toString() + " bedrooms / " + house.bathrooms.toString() + " bathrooms / " + house.squarefoot.toString() + " ft\u00B2", style: TextStyle( fontSize: 15, ), ), ), ], ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/common/color_constants.dart
import 'package:flutter/material.dart'; class ColorConstant { static const kFABBackColor = Color(0xFF12192b); static const kFilterBackColor = Color(0xfff5f7fa); static const kWhiteColor = Colors.white; static const kBlackColor = Colors.black; static const kGreyColor = Colors.grey; static const kGreenColor = Colors.green; }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/common/constants.dart
import 'package:flutter_real_estate_app_ui/models/data_model.dart'; class Constants { static List<House> houseList = [ House( id: 1, amount: 1000000, address: 'Jenison, MI 49428, SF', bedrooms: 3, bathrooms: 2, squarefoot: 1.416, garages: 2, kitchen: 1, ), House( id: 2, amount: 2000000, address: 'Delhi, MI 55555, SF', bedrooms: 4, bathrooms: 4, squarefoot: 2.416, garages: 3, kitchen: 2, ), House( id: 3, amount: 3000000, address: 'Mumbai, MI 49428, SF', bedrooms: 5, bathrooms: 2, squarefoot: 3.416, garages: 2, kitchen: 1, ), House( id: 4, amount: 4000000, address: 'Pune, MI 55555, SF', bedrooms: 3, bathrooms: 4, squarefoot: 4.416, garages: 3, kitchen: 2, ), House( id: 5, amount: 5000000, address: 'Rajkot, MI 49428, SF', bedrooms: 4, bathrooms: 2, squarefoot: 5.416, garages: 2, kitchen: 1, ), House( id: 6, amount: 6000000, address: 'Bhuj, MI 55555, SF', bedrooms: 5, bathrooms: 4, squarefoot: 6.416, garages: 3, kitchen: 2, ), ]; static List<String> imageList = [ "assets/images/house_1.png", "assets/images/house_2.png", "assets/images/house_3.png", "assets/images/house_4.png", "assets/images/house_5.png", "assets/images/house_6.png", "assets/images/house_7.png", ]; }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/screens/item_detail_screen.dart
import 'package:carousel_pro/carousel_pro.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/floating_widget.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/house_widget.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/menu_widget.dart'; import 'package:flutter_real_estate_app_ui/models/data_model.dart'; import 'package:intl/intl.dart'; import 'package:google_fonts/google_fonts.dart'; class ItemDetailScreen extends StatelessWidget { House house; List<String> imageList; int imgpath_index; ItemDetailScreen( this.house, this.imgpath_index, this.imageList, ); final houseArray = [ "1.416", "4", "2", "2", "3", ]; final typeArray = [ "Square foot", "Bedrooms", "Bedrooms", "Garage", "Kitchen", ]; @override Widget build(BuildContext context) { var screenWidth = MediaQuery.of(context).size.width; final oCcy = new NumberFormat("##,##,###", "en_INR"); SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: ColorConstant.kWhiteColor, ), ); return Scaffold( backgroundColor: ColorConstant.kWhiteColor, floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: Container( padding: EdgeInsets.symmetric( vertical: 10, horizontal: 0, ), width: screenWidth, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ FloatingWidget( leadingIcon: Icons.mail, txt: "Message", ), FloatingWidget( leadingIcon: Icons.phone, txt: "Call", ), ], ), ), body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 25, bottom: 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Stack( children: <Widget>[ Container( padding: EdgeInsets.only(top: 0, bottom: 10), child: SizedBox( height: 200.0, width: screenWidth, child: Carousel( images: [ ExactAssetImage(imageList[imgpath_index]), ExactAssetImage(imageList[0]), ExactAssetImage(imageList[1]), ExactAssetImage(imageList[2]), ExactAssetImage(imageList[3]), ExactAssetImage(imageList[4]), ExactAssetImage(imageList[5]), ], showIndicator: true, borderRadius: false, moveIndicatorFromBottom: 180.0, noRadiusForIndicator: true, overlayShadow: false, overlayShadowColors: Colors.white, overlayShadowSize: 0.7, ), ), ), Padding( padding: const EdgeInsets.only( top: 15, right: 15, left: 15, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ MenuWidget( iconImg: Icons.arrow_back, iconColor: ColorConstant.kWhiteColor, conBackColor: Colors.transparent, onbtnTap: () { Navigator.of(context).pop(false); }), MenuWidget( iconImg: Icons.favorite_border, iconColor: ColorConstant.kWhiteColor, conBackColor: Colors.transparent, ), ], ), ) ], ), Container( padding: EdgeInsets.only(left: 15, top: 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '\$' + "${oCcy.format(house.amount)}", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 25, ), ), Padding( padding: EdgeInsets.only(top: 5), child: Text( house.address, style: TextStyle( fontSize: 13, color: Colors.grey, ), ), ), ], ), Padding( padding: const EdgeInsets.only(right: 15), child: Container( height: 45, width: 120, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12.0), border: Border.all( color: Colors.grey[200], ), ), child: Center( child: Text( "20 hours ago", style: Theme.of(context).textTheme.caption.copyWith( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16, ), ), ), ), ), ], ), ), Padding( padding: const EdgeInsets.only( top: 15, bottom: 15, left: 15, ), child: Text( "House Information", style: GoogleFonts.notoSans( fontSize: 20, color: ColorConstant.kBlackColor, fontWeight: FontWeight.w600, ), ), ), Container( height: 110, child: ListView.builder( shrinkWrap: false, scrollDirection: Axis.horizontal, itemCount: houseArray.length, itemBuilder: (context, index) { return Padding( padding: const EdgeInsets.only(left: 10), child: HouseWidget( type: typeArray[index], number: houseArray[index].toString(), ), ); }, ), ), Container( child: Padding( padding: const EdgeInsets.only( left: 15, right: 15, top: 20, bottom: 20, ), child: Text( "Flawless 2 story on a family friendly cul-de-sac in the heart of Blue Valley! Walk in to an open floor plan flooded w daylightm, formal dining private office, screened-in lanai w fireplace, TV hookup & custom heaters that overlooks the lit basketball court.", textAlign: TextAlign.justify, style: GoogleFonts.notoSans( fontSize: 15, color: ColorConstant.kGreyColor, ), ), )) ], ), ), ), ); } }
0
mirrored_repositories/flutter_real_estate_app/lib
mirrored_repositories/flutter_real_estate_app/lib/screens/home_page_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_real_estate_app_ui/common/color_constants.dart'; import 'package:flutter_real_estate_app_ui/common/constants.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/filter_widget.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/floating_widget.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/image_widget.dart'; import 'package:flutter_real_estate_app_ui/custom_widgets/menu_widget.dart'; import 'package:google_fonts/google_fonts.dart'; class HomePageScreen extends StatelessWidget { final filterArray = [ "<\$220.000", "For sale", "3-4 beds", "Kitchen", ]; @override Widget build(BuildContext context) { var screenWidth = MediaQuery.of(context).size.width; SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: ColorConstant.kWhiteColor, ), ); return Scaffold( backgroundColor: ColorConstant.kWhiteColor, floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: FloatingWidget( leadingIcon: Icons.explore, txt: "Map view", ), body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.only( left: 15, right: 15, top: 35, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ MenuWidget( iconImg: Icons.subject, iconColor: ColorConstant.kBlackColor, ), MenuWidget( iconImg: Icons.repeat, iconColor: ColorConstant.kBlackColor, ), ], ), SizedBox( height: 30, ), Text( "City", style: GoogleFonts.notoSans( fontSize: 12, color: ColorConstant.kGreyColor, ), ), SizedBox( height: 10, ), Text( "San Francisco", style: GoogleFonts.notoSans( fontSize: 36, color: ColorConstant.kBlackColor, fontWeight: FontWeight.w500, ), ), Divider( color: ColorConstant.kGreyColor, thickness: .2, ), Container( height: 50, child: ListView.builder( shrinkWrap: false, scrollDirection: Axis.horizontal, itemCount: filterArray.length, itemBuilder: (context, index) { return FilterWidget( filterTxt: filterArray[index], ); }, ), ), SizedBox( height: 10, ), Column( children: List.generate( Constants.houseList.length, (index) { return Padding( padding: const EdgeInsets.only(top: 10), child: ImageWidget( Constants.houseList[index], index, Constants.imageList, ), ); }, ), ), ], ), ), ), ); } }
0
mirrored_repositories/flutter_real_estate_app
mirrored_repositories/flutter_real_estate_app/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_real_estate_app_ui/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/Fooddeca
mirrored_repositories/Fooddeca/lib/MainPage.dart
import 'package:flutter/material.dart'; import 'homepage.dart'; class MainPage extends StatelessWidget { const MainPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: SafeArea( child: Column( children: [ SizedBox( height: 50, ), Text( 'FOODECA', style: TextStyle(fontSize: 30,fontWeight: FontWeight.bold,color: Colors.black), ), Image(image: AssetImage('assets/intro.png')), SizedBox( height: 5, ), Text( 'Choose your preference', style: TextStyle(color: Colors.grey), ), SizedBox( height: 5, ), Text( "What's your", style: TextStyle(fontSize: 35,fontWeight: FontWeight.bold,color: Colors.black), ), SizedBox( height: 5, ), Text( "Favorite Food?", style: TextStyle(fontSize: 35,fontWeight: FontWeight.bold,color: Colors.grey), ), SizedBox( height: 50, ), InkWell( onTap: (){ Navigator.push(context, MaterialPageRoute(builder: (index) =>HomePage())); }, child: Container( height: 60, width: 350, decoration: BoxDecoration( color: Colors.black, borderRadius: BorderRadius.circular(30) ), child: Center( child: Text('Get Started',style: TextStyle(color: Colors.white),), ), ), ) ], ), ), ); } }
0
mirrored_repositories/Fooddeca
mirrored_repositories/Fooddeca/lib/home1.dart
import 'package:flutter/material.dart'; class home1 extends StatelessWidget { const home1({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Home'), ), body: Text('This is home page') ); } }
0
mirrored_repositories/Fooddeca
mirrored_repositories/Fooddeca/lib/homepage.dart
import 'package:flutter/material.dart'; import 'package:fooddeca/home1.dart'; class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @override State<HomePage> createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: BottomAppBar( color: Colors.white, child: Padding( padding: const EdgeInsets.all(18.0), child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(35), color: Colors.black), height: 50, width: 200, child: Padding( padding: const EdgeInsets.only(left: 18.0, right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( onTap: (){ Navigator.push(context, MaterialPageRoute(builder: (index)=>home1())); }, child: Icon( Icons.home_outlined, color: Colors.white, size: 28, ), ), Icon( Icons.shopping_bag_outlined, color: Colors.white, size: 25, ), Icon( Icons.notifications_none_sharp, color: Colors.white, size: 28, ), Image( color: Colors.white, height: 25, width: 25, image: AssetImage('assets/icon/setting.png')), ], ), ), ), ), ), backgroundColor: Colors.white, body: SafeArea( child: Padding( padding: const EdgeInsets.only( left: 18.0, right: 15.0, ), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image( height: 50, width: 50, image: AssetImage('assets/icon/menu.png')), Container( height: 45, width: 45, decoration: BoxDecoration( color: Colors.black, borderRadius: BorderRadius.circular(12)), child: Icon( Icons.person, color: Colors.white, ), ) ], ), const SizedBox( height: 10, ), const Text( 'What would', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), ), Row( children: [ Text( 'you ', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30), ), Text( 'Like to Order?', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 30, color: Colors.grey), ) ], ), const SizedBox( height: 10, ), TextField( decoration: InputDecoration( border: OutlineInputBorder( borderRadius: BorderRadius.circular(15)), suffixIcon: Icon(Icons.search), hintText: 'Search food', fillColor: Colors.grey.shade300, filled: true, ), ), const SizedBox( height: 30, ), Padding( padding: const EdgeInsets.only(left: 20.0, right: 20.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( height: 200, width: 150, decoration: BoxDecoration( //color: Color(0xff6345FE), border: Border.all( color: Colors.black, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.circular(25), image: DecorationImage( image: AssetImage('assets/sushi.jpg'), ), ), child: Align( alignment: Alignment.bottomCenter, child: Container( padding: EdgeInsets.only(bottom: 10), height: 30, width: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( ' Sushi ', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), ), Text( ' ₹50', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold), ) ], ), ), ), ), Container( height: 200, width: 150, decoration: BoxDecoration( //color: Color(0xff6345FE), border: Border.all( color: Colors.black, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.circular(25), image: DecorationImage( image: AssetImage('assets/food.png'), ), ), child: Align( alignment: Alignment.bottomCenter, child: Container( padding: EdgeInsets.only(bottom: 10), height: 30, width: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( 'Meat', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), ), Text( '₹150', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold), ) ], ), ), ), ), ], ), ), SizedBox(height: 30,), Padding( padding: const EdgeInsets.only(left: 20.0,right: 20.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( height: 200, width: 150, decoration: BoxDecoration( //color: Color(0xff6345FE), border: Border.all( color: Colors.black, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.circular(25), image: DecorationImage( image: AssetImage('assets/burger.png'), ), ), child: Align( alignment: Alignment.bottomCenter, child: Container( padding: EdgeInsets.only(bottom: 10), height: 40, width: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( 'Burger', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), ), Text( ' ₹90', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold), ) ], ), ), ), ), Container( height: 200, width: 150, decoration: BoxDecoration( //color: Color(0xff6345FE), border: Border.all( color: Colors.black, width: 2.0, style: BorderStyle.solid), borderRadius: BorderRadius.circular(25), image: DecorationImage( image: AssetImage('assets/pizza.png'), ), ), child: Align( alignment: Alignment.bottomCenter, child: Container( padding: EdgeInsets.only(bottom: 10), height: 30, width: 100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( ' Pizza ', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), ), Text( ' ₹50', style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold), ) ], ), ), ), ), ], ), ) ], )), ), ); } }
0
mirrored_repositories/Fooddeca
mirrored_repositories/Fooddeca/lib/main.dart
import 'package:flutter/material.dart'; import 'MainPage.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: MainPage(), ); } }
0
mirrored_repositories/Fooddeca
mirrored_repositories/Fooddeca/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility in the flutter_test package. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:fooddeca/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(const MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/Flutter-apps/ishow
mirrored_repositories/Flutter-apps/ishow/lib/InputCustomizado.dart
import 'package:flutter/material.dart'; class InputCustomizado extends StatelessWidget { final String hint; final bool obscure; final Icon icon; InputCustomizado( {@required this.hint, this.obscure=false, this.icon = const Icon(Icons.person)} ); @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.all(0), child: TextField( obscureText: this.obscure, decoration: InputDecoration( icon: this.icon, border: InputBorder.none, hintText: this.hint, hintStyle: TextStyle( color: Colors.grey[600], fontSize: 18 ), focusColor: Color.fromRGBO(255, 100, 127, 1), hoverColor: Color.fromRGBO(255, 100, 127, 1), fillColor: Color.fromRGBO(255, 100, 127, 1), ), ), ); } }
0
mirrored_repositories/Flutter-apps/ishow
mirrored_repositories/Flutter-apps/ishow/lib/BotaoAnimado.dart
import 'package:flutter/material.dart'; class BotaoAnimado extends StatelessWidget { AnimationController controller; Animation<double> largura; Animation<double> altura; Animation<double> opacidade; Animation<double> radius; BotaoAnimado({@required this.controller}) : largura = Tween<double>(begin: 0, end: 500).animate( CurvedAnimation(parent: controller, curve: Interval(0.5, 1))), altura = Tween<double>(begin: 0, end: 50).animate( CurvedAnimation(parent: controller, curve: Interval(0.5, 0.7))), radius = Tween<double>(begin: 0, end: 20).animate( CurvedAnimation(parent: controller, curve: Interval(0.6, 1))), opacidade = Tween<double>(begin: 0, end: 1).animate( CurvedAnimation(parent: controller, curve: Interval(0.6, 0.8))); Widget _buildAnimation(BuildContext context, Widget widget) { return InkWell( onTap: () {}, child: Container( height: altura.value, width: largura.value, child: Center( child: FadeTransition( opacity: opacidade, child: Text( "Entrar", style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold), ), ), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(radius.value), gradient: LinearGradient(colors: [ Color.fromRGBO(255, 100, 127, 1), Color.fromRGBO(255, 123, 145, 1), ])), ), ); } @override Widget build(BuildContext context) { return AnimatedBuilder( animation: this.controller, builder: _buildAnimation); } }
0
mirrored_repositories/Flutter-apps/ishow
mirrored_repositories/Flutter-apps/ishow/lib/Login.dart
import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:ishow/BotaoAnimado.dart'; import 'package:ishow/InputCustomizado.dart'; import 'package:flutter/scheduler.dart' show timeDilation; class Login extends StatefulWidget { @override _LoginState createState() => _LoginState(); } class _LoginState extends State<Login> with SingleTickerProviderStateMixin { AnimationController _controller; Animation<double> _animacaoBluer; Animation<double> _animacaoFade; Animation<double> _animacaoSize; @override void initState() { super.initState(); _controller = AnimationController(duration: Duration(milliseconds: 500), vsync: this); _animacaoBluer = Tween<double>(begin: 5, end: 0) .animate(CurvedAnimation(parent: _controller, curve: Curves.ease)); _animacaoFade = Tween<double>(begin: 0, end: 1).animate( CurvedAnimation(parent: _controller, curve: Curves.easeInOutQuint)); _animacaoSize = Tween<double>(begin: 0, end: 500).animate( CurvedAnimation(parent: _controller, curve: Curves.decelerate)); _controller.forward(); } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { // timeDilation = 20; return Scaffold( backgroundColor: Colors.white, body: Container( child: SingleChildScrollView( child: Column( children: [ AnimatedBuilder( animation: _animacaoBluer, builder: (context, widget) { return Container( height: 400, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("imagens/fundo.png"), fit: BoxFit.fill)), child: BackdropFilter( filter: ImageFilter.blur( sigmaX: _animacaoBluer.value, sigmaY: _animacaoBluer.value), child: Stack( children: [ Positioned( left: 10, child: FadeTransition( opacity: _animacaoFade, child: Image.asset("imagens/detalhe1.png"), ), ), Positioned( left: 50, child: FadeTransition( opacity: _animacaoFade, child: Image.asset("imagens/detalhe2.png"), ), ) ], ), )); }, ), Padding( padding: EdgeInsets.only(left: 30, right: 30), child: Column( children: [ AnimatedBuilder( animation: _animacaoSize, builder: (context, widget) { return Container( width: _animacaoSize.value, padding: EdgeInsets.all(8), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(20), boxShadow: [ BoxShadow( color: Colors.grey[200], blurRadius: 15, spreadRadius: 4) ]), child: Column( children: [ InputCustomizado( hint: "Email", obscure: false, icon: Icon(Icons.person), ), InputCustomizado( hint: "Senha", obscure: true, icon: Icon(Icons.lock), ), ], ), ); }, ), SizedBox( height: 20, ), BotaoAnimado( controller: _controller, ), SizedBox( height: 10, ), FadeTransition( opacity: _animacaoFade, child: Text( "Esqueci a minha senha", style: TextStyle( color: Color.fromRGBO(255, 100, 127, 1), fontWeight: FontWeight.bold), ), ), ], ), ) ], ), ), ), ); } }
0
mirrored_repositories/Flutter-apps/ishow
mirrored_repositories/Flutter-apps/ishow/lib/main.dart
import 'package:flutter/material.dart'; import 'package:ishow/Login.dart'; void main() { runApp( MaterialApp( home: Login(), debugShowCheckedModeBanner: false, ) ); }
0
mirrored_repositories/Flutter-apps/maps
mirrored_repositories/Flutter-apps/maps/lib/Home.dart
import 'package:flutter/material.dart'; import 'dart:async'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:geolocator/geolocator.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState extends State<Home> { Completer<GoogleMapController> _controller = Completer(); CameraPosition _posicaoCamera = CameraPosition( target: LatLng(-23.565160, -46.651797), zoom: 19 ); Set<Marker> _marcadores = {}; Set<Polygon> _polygons = {}; Set<Polyline> _polylines = {}; _onMapCreated(GoogleMapController googleMapController) { _controller.complete(googleMapController); } _movimentarCamera() async { GoogleMapController googleMapController = await _controller.future; googleMapController.animateCamera(CameraUpdate.newCameraPosition( _posicaoCamera )); } _carregarMarcadores() { // Set<Marker> _marcadorLocal = {}; // Marker marcadorShop = Marker( // markerId: MarkerId("marcador shopping"), // position: LatLng(-23.563370, -46.652923), // infoWindow: InfoWindow( // title: "Shopping" // ), // icon: BitmapDescriptor.defaultMarkerWithHue( // BitmapDescriptor.hueMagenta // ), // ); // Marker marcadorCartorio = Marker( // markerId: MarkerId("marcador cartorio"), // position: LatLng(-23.562868, -46.655874), // infoWindow: InfoWindow( // title: "Cartorio" // ), // icon: BitmapDescriptor.defaultMarkerWithHue( // BitmapDescriptor.hueYellow // ), // // rotation: 45 // onTap: (){ // print("cartorio"); // } // ); // _marcadorLocal.add((marcadorShop)); // _marcadorLocal.add((marcadorCartorio)); // setState(() { // _marcadores = _marcadorLocal; // }); //POLYGON // Set<Polygon> listaPolygons ={}; // Polygon polygon1 = Polygon( // polygonId: PolygonId("polygon1"), // fillColor: Colors.transparent, // strokeColor: Colors.green, // strokeWidth: 10, // points: [ // LatLng(-23.561816, -46.652044), // LatLng(-23.563625, -46.653642), // LatLng(-23.564786, -46.652226), // LatLng(-23.563085, -46.650531), // ], // consumeTapEvents: true, // onTap: (){ // print("aqui !"); // }, // ); // listaPolygons.add(polygon1); // setState(() { // _polygons = listaPolygons; // }); //POLYLINES Set<Polyline> listaPolylines = {}; Polyline polyline1 = Polyline( polylineId: PolylineId("polygon1"), color: Colors.red, width: 15, startCap: Cap.roundCap, points: [ LatLng(-23.561816, -46.652044), LatLng(-23.563625, -46.653642), LatLng(-23.564786, -46.652226), LatLng(-23.563085, -46.650531), ], consumeTapEvents: true, onTap: () { print("aqui !"); }, ); listaPolylines.add(polyline1); setState(() { _polylines = listaPolylines; }); } _recuperarLocalizacaoAtual() async{ Position position = await Geolocator().getCurrentPosition( desiredAccuracy: LocationAccuracy.high ); print("localizacao atual: " + position.toString() ); setState(() { _posicaoCamera = CameraPosition( target: LatLng(position.latitude, position.longitude), zoom: 17 ); _movimentarCamera(); }); _adicionarListenerLocalizacao(); } _adicionarListenerLocalizacao(){ print("entrou"); var geolocator = Geolocator(); var locationOptions = LocationOptions( accuracy: LocationAccuracy.high, distanceFilter: 10 ); geolocator.getPositionStream( locationOptions ) .listen((Position position){ print("localizacao atual: " + position.toString() ); Marker marcadorUsuario = Marker( markerId: MarkerId("marcador-usuario"), position: LatLng(position.latitude, position.longitude), infoWindow: InfoWindow( title: "Meu local" ), icon: BitmapDescriptor.defaultMarkerWithHue( BitmapDescriptor.hueMagenta ), onTap: (){ print("Meu local clicado!!"); } //rotation: 45 ); setState(() { //-23.566989, -46.649598 //-23.568395, -46.648353 _marcadores.add( marcadorUsuario ); _posicaoCamera = CameraPosition( target: LatLng(position.latitude, position.longitude), zoom: 17 ); print("localizacao atual: " + position.toString() ); _movimentarCamera(); }); }); } _recuperarLocalParaEndereco() async{ List<Placemark> listaEndereco = await Geolocator(). placemarkFromAddress("Av paulista, 1700"); print("total: " + listaEndereco.length.toString()); if(listaEndereco != null && listaEndereco.length >0){ Placemark endereco = listaEndereco[0]; String resultado = "\n administrativeArea: "+ endereco.administrativeArea; resultado += "\n subAdministrativeArea: "+ endereco.subAdministrativeArea; resultado += "\n subAdministrativeArea: "+ endereco.locality; resultado += "\n subAdministrativeArea: "+ endereco.subLocality; resultado += "\n subAdministrativeArea: "+ endereco.thoroughfare; resultado += "\n subAdministrativeArea: "+ endereco.subThoroughfare; resultado += "\n subAdministrativeArea: "+ endereco.postalCode; resultado += "\n subAdministrativeArea: "+ endereco.country; resultado += "\n subAdministrativeArea: "+ endereco.isoCountryCode; resultado += "\n subAdministrativeArea: "+ endereco.position.toString(); print(resultado); } } _recuperarLocalParalatlong() async{ List<Placemark> listaEndereco = await Geolocator(). placemarkFromCoordinates(-23.560859, -46.6570211); print("total: " + listaEndereco.length.toString()); if(listaEndereco != null && listaEndereco.length >0){ Placemark endereco = listaEndereco[0]; String resultado = "\n administrativeArea: "+ endereco.administrativeArea; resultado += "\n subAdministrativeArea: "+ endereco.subAdministrativeArea; resultado += "\n subAdministrativeArea: "+ endereco.locality; resultado += "\n subAdministrativeArea: "+ endereco.subLocality; resultado += "\n subAdministrativeArea: "+ endereco.thoroughfare; resultado += "\n subAdministrativeArea: "+ endereco.subThoroughfare; resultado += "\n subAdministrativeArea: "+ endereco.postalCode; resultado += "\n subAdministrativeArea: "+ endereco.country; resultado += "\n subAdministrativeArea: "+ endereco.isoCountryCode; resultado += "\n subAdministrativeArea: "+ endereco.position.toString(); print(resultado); } } @override void initState() { // _recuperarLocalizacaoAtual(); _recuperarLocalParaEndereco(); // _recuperarLocalParalatlong(); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Mapas"), ), floatingActionButtonLocation: FloatingActionButtonLocation.startDocked, floatingActionButton: FloatingActionButton( onPressed: _movimentarCamera, child: Icon(Icons.done), ), body: Container( child: GoogleMap( mapType: MapType.satellite, initialCameraPosition: _posicaoCamera, onMapCreated: _onMapCreated, markers: _marcadores, myLocationEnabled: true, ), ), ); } }
0
mirrored_repositories/Flutter-apps/maps
mirrored_repositories/Flutter-apps/maps/lib/main.dart
import 'package:flutter/material.dart'; import 'Home.dart'; void main() { runApp(MaterialApp( title: "Mapas e geo", home: Home(), )); }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/AnimacoesExplicitasContruidas.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AnimacoesExplicitasConstruidas extends StatefulWidget { @override _AnimacoesExplicitasConstruidasState createState() => _AnimacoesExplicitasConstruidasState(); } class _AnimacoesExplicitasConstruidasState extends State<AnimacoesExplicitasConstruidas> with SingleTickerProviderStateMixin{ AnimationController _animationController; AnimationStatus _animationStatus; @override void initState() { // TODO: implement initState super.initState(); _animationController = AnimationController( duration: Duration(seconds: 5), vsync: this )..repeat()..addStatusListener((status) {_animationStatus = status;}); } @override void dispose() { _animationController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Container( color: Colors.white, child: Column( children: [ Container( width: 300, height: 400, child: RotationTransition( alignment: Alignment.center, child: Image.asset("imagens/logo.png"), turns: _animationController, ), ), RaisedButton( child: Text("Pressione"), onPressed: (){ if(_animationStatus == AnimationStatus.dismissed){ // _animationController.forward(); _animationController.repeat(); }else{ _animationController.reverse(); } // if(_animationController.isAnimating){ // _animationController.stop(); // }else{ // _animationController.repeat(); // } }, ) ], ), ); } }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/CriandoAnimacoesBasicas.dart
import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; class CriandoAnimacoesBasicas extends StatefulWidget { @override _CriandoAnimacoesBasicasState createState() => _CriandoAnimacoesBasicasState(); } class _CriandoAnimacoesBasicasState extends State<CriandoAnimacoesBasicas> { bool _status = true; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("meu app"), ), // body: AnimatedContainer( // duration: Duration(seconds: 1), // color: Colors.green, // padding: EdgeInsets.all(10), // height: _status?0 : 100, // ), // body: AnimatedContainer( // duration: Duration(seconds: 1), // color: Colors.green, // padding: EdgeInsets.only(bottom: 100, top: 20), // alignment:_status ? Alignment.bottomCenter : Alignment.topCenter, // child: AnimatedOpacity( // duration: Duration(seconds: 1), // opacity: _status?1:0, // child: Container( // height: 50, // child: Icon( // Icons.airplanemode_active, // size: 50, // color: Colors.white, // ), // ), // ) // ), body: GestureDetector( onTap: (){ setState(() { _status = !_status; }); }, child: AnimatedContainer( duration: Duration(milliseconds: 300), curve: Curves.linear, alignment: Alignment.center, width: _status ? 60 : 160, height: 60, decoration: BoxDecoration( color: Colors.blue, borderRadius: BorderRadius.circular(30) ), child: Stack( children: [ Align( alignment: Alignment.center, child: AnimatedOpacity( duration: Duration(milliseconds: 100), opacity: _status ? 1 : 0, child: Icon(Icons.person_add, color: Colors.white,), ), ), Align( alignment: Alignment.center, child: AnimatedOpacity( duration: Duration(milliseconds: 300), opacity: _status ? 0 : 1, child: Text("Mensagem", style: TextStyle(color: Colors.white, fontSize: 20),), ), ) ], ), ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: FloatingActionButton( backgroundColor: Colors.orange, foregroundColor: Colors.white, elevation: 6, child: Icon(Icons.add_box), onPressed: (){ setState(() { _status = !_status; }); }, ), ); } }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/MaisSobreAnimacoes.dart
import 'package:flutter/material.dart'; class MaisSobreAnimacoes extends StatefulWidget { @override _MaisSobreAnimacoesState createState() => _MaisSobreAnimacoesState(); } class _MaisSobreAnimacoesState extends State<MaisSobreAnimacoes> with SingleTickerProviderStateMixin { AnimationController _animationController; Animation _animation; @override void initState() { super.initState(); _animationController = AnimationController( duration: Duration(seconds: 2), vsync: this ); // _animation = Tween<double>( // begin: 0, // end: 1 // ).animate(_animationController); _animation = Tween<Offset>( begin: Offset(0,0), end: Offset(60,60) ).animate(_animationController); } @override Widget build(BuildContext context) { _animationController.forward(); return Container( padding: EdgeInsets.all(20), color: Colors.white, child: AnimatedBuilder( animation: _animation, child: Stack( children: [ Positioned( width: 180, height: 180, left: 0, top: 0, child: Image.asset("imagens/logo.png"), ) ], ), builder: (contex, widget){ // return Transform.rotate( // angle: _animation.value, // child: widget, // ); // return Transform.scale( // scale: _animation.value, // child: widget, // ); return Transform.translate( offset: _animation.value, child: widget, ); }, ), ); } @override void dispose() { _animationController.dispose(); super.dispose(); } }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/AnimacaoImplicita.dart
import 'package:flutter/material.dart'; class AnimacaoImplicita extends StatefulWidget { @override _AnimacaoImplicitaState createState() => _AnimacaoImplicitaState(); } class _AnimacaoImplicitaState extends State<AnimacaoImplicita> { bool _status = true; @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AnimatedContainer( padding: EdgeInsets.all(20), width: _status ? 200 : 300, height: _status ? 300 : 200, color: _status ?Colors.white :Colors.purpleAccent, child: Image.asset("imagens/logo.png"), duration: Duration(seconds: 2), curve: Curves.elasticInOut, ), RaisedButton( child: Text("Alterar"), onPressed: (){ setState(() { _status = !_status; }); }, ) ], ); } }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/main.dart
import 'package:flutter/material.dart'; import 'AnimacaoImplicita.dart'; import 'AnimacaoTween.dart'; import 'AnimacoesExplicitasContruidas.dart'; import 'CriandoAnimacoesBasicas.dart'; import 'MaisSobreAnimacoes.dart'; void main() { runApp( MaterialApp( home: MaisSobreAnimacoes(), debugShowCheckedModeBanner: false, )); }
0
mirrored_repositories/Flutter-apps/animacoes
mirrored_repositories/Flutter-apps/animacoes/lib/AnimacaoTween.dart
import 'package:flutter/material.dart'; class AnimacaoTween extends StatefulWidget { @override _AnimacaoTweenState createState() => _AnimacaoTweenState(); } class _AnimacaoTweenState extends State<AnimacaoTween> { static final colorTween = ColorTween(begin: Colors.white,end: Colors.orange); @override Widget build(BuildContext context) { return Center( // child: TweenAnimationBuilder( // duration: Duration(seconds: 2), // tween: Tween<double>(begin: 0, end: 6.28), // builder: (BuildContext context, double angulo, Widget widget){ // return Transform.rotate( // angle: angulo, // child: Image.asset("imagens/logo.png"), // ); // }, // ), // child: TweenAnimationBuilder( // duration: Duration(seconds: 1), // tween: Tween<double>(begin: 50, end: 180), // builder: (BuildContext context, double largura, Widget widget){ // return Container( // color: Colors.green, // width: largura, // height: 60, // ); // }, // ), child: TweenAnimationBuilder( duration: Duration(seconds: 2), tween: colorTween, child: Image.asset("imagens/estrelas.jpg"), builder: (BuildContext context, Color cor, Widget widget){ return ColorFiltered( colorFilter: ColorFilter.mode(cor, BlendMode.overlay), child: widget, ); }, ), ); } }
0
mirrored_repositories/Flutter-apps/first_app
mirrored_repositories/Flutter-apps/first_app/lib/main.dart
import 'package:flutter/material.dart'; void main(){ runApp(new HelloWorldScreen()); } class HelloWorldScreen extends StatelessWidget{ @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text("Hello World") ), body: Center(child: Text("Hello World - center")) ) ); } }
0
mirrored_repositories/Flutter-apps/first_app
mirrored_repositories/Flutter-apps/first_app/test/widget_test.dart
// This is a basic Flutter widget test. // // To perform an interaction with a widget in your test, use the WidgetTester // utility that Flutter provides. For example, you can send tap and scroll // gestures. You can also use WidgetTester to find child widgets in the widget // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:first_app/main.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(MyApp()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget); expect(find.text('1'), findsNothing); // Tap the '+' icon and trigger a frame. await tester.tap(find.byIcon(Icons.add)); await tester.pump(); // Verify that our counter has incremented. expect(find.text('0'), findsNothing); expect(find.text('1'), findsOneWidget); }); }
0
mirrored_repositories/Flutter-apps/caraoucoroa
mirrored_repositories/Flutter-apps/caraoucoroa/lib/Resultado.dart
import 'package:flutter/material.dart'; class Resultado extends StatefulWidget { String valor; Resultado(this.valor); @override _ResultadoState createState() => _ResultadoState(); } class _ResultadoState extends State<Resultado> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xff61bd86), // backgroundColor: Color.fromRGBO(255, 204, 128, 0.9), body: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Image.asset("imagens/moeda_${widget.valor}.png"), GestureDetector( onTap: (){ Navigator.pop(context); }, child: Image.asset("imagens/botao_voltar.png"), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-apps/caraoucoroa
mirrored_repositories/Flutter-apps/caraoucoroa/lib/main.dart
import 'package:caraoucoroa/Jogar.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; void main() { runApp(MaterialApp( home: Jogar(), debugShowCheckedModeBanner: false, )); }
0
mirrored_repositories/Flutter-apps/caraoucoroa
mirrored_repositories/Flutter-apps/caraoucoroa/lib/Jogar.dart
import 'dart:math'; import 'package:caraoucoroa/Resultado.dart'; import 'package:flutter/material.dart'; import 'dart:math'; class Jogar extends StatefulWidget { @override _JogarState createState() => _JogarState(); } class _JogarState extends State<Jogar> { void jogar(){ var itens = ["cara", "coroa"]; var numero = Random().nextInt(itens.length); Navigator.push( context, MaterialPageRoute( builder: (context) => Resultado(itens[numero]))); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xff61bd86), // backgroundColor: Color.fromRGBO(255, 204, 128, 0.9), body: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Image.asset("imagens/logo.png"), GestureDetector( onTap: (){jogar();}, child: Image.asset("imagens/botao_jogar.png"), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/TelaServico.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class TelaServico extends StatefulWidget { @override _TelaServicoState createState() => _TelaServicoState(); } class _TelaServicoState extends State<TelaServico> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("Servicos"), ), body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Row( children: <Widget>[ Image.asset("imagens/detalhe_servico.png"), Padding( padding: EdgeInsets.only(left: 10), child: Text( "Nossos servicos", style: TextStyle( fontSize: 20, color: Colors.deepOrange, ), ), ) ], ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "Consultoria" ), ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "asasa" ), ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "asasssssss" ), ), ], ), ), ), ); } }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/Home.dart
import 'package:atmconsultoria/TelaCliente.dart'; import 'package:atmconsultoria/TelaContato.dart'; import 'package:atmconsultoria/TelaEmpresa.dart'; import 'package:atmconsultoria/TelaServico.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState extends State<Home> { void _abrirEmpresa(){ Navigator.push(context, MaterialPageRoute(builder: (context)=> TelaEmpresa())); } void _abrirServico(){ Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaServico())); } void _abrirCliente(){ Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaCliente())); } void _abrirContato(){ Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaContato())); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("ATM Consultoria"), backgroundColor: Colors.green, ), body: Container( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Image.asset("imagens/logo.png"), Padding( padding: EdgeInsets.only(top:32), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ GestureDetector( onTap: _abrirEmpresa, child: Image.asset("imagens/menu_empresa.png"), ), GestureDetector( onTap: _abrirServico, child: Image.asset("imagens/menu_servico.png"), ), ], ), ), Padding( padding: EdgeInsets.only(top:32), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ GestureDetector( onTap: _abrirCliente, child: Image.asset("imagens/menu_cliente.png"), ), GestureDetector( onTap: _abrirContato, child: Image.asset("imagens/menu_contato.png"), ), ], ), ), ], ), ), ); } }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/TelaContato.dart
import 'package:flutter/material.dart'; class TelaContato extends StatefulWidget { @override _TelaContatoState createState() => _TelaContatoState(); } class _TelaContatoState extends State<TelaContato> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("Contato"), ), body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Row( children: <Widget>[ Image.asset("imagens/detalhe_contato.png"), Padding( padding: EdgeInsets.only(left: 10), child: Text( "Contato", style: TextStyle( fontSize: 20, color: Colors.deepOrange, ), ), ) ], ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "Contato" ), ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "asassaaaaa" ), ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "asasssssssssssssss" ), ), ], ), ), ), ); } }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/TelaCliente.dart
import 'package:flutter/material.dart'; class TelaCliente extends StatefulWidget { @override _TelaClienteState createState() => _TelaClienteState(); } class _TelaClienteState extends State<TelaCliente> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("Clientes"), ), body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Row( children: <Widget>[ Image.asset("imagens/detalhe_cliente.png"), Padding( padding: EdgeInsets.only(left: 10), child: Text( "Nossos Clientes", style: TextStyle( fontSize: 20, color: Colors.deepOrange, ), ), ) ], ), Padding( padding: EdgeInsets.only(top: 16), child: Image.asset("imagens/cliente1.png"), ), Text("Empresa de software"), Padding( padding: EdgeInsets.only(top: 16), child: Image.asset("imagens/cliente2.png"), ), Text("Empresa de consultoria"), ], ), ), ), ); } }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/main.dart
import 'package:flutter/material.dart'; import 'Home.dart'; void main(){ runApp(MaterialApp( home: Home(), debugShowCheckedModeBanner: false, ) ); }
0
mirrored_repositories/Flutter-apps/atmconsultoria
mirrored_repositories/Flutter-apps/atmconsultoria/lib/TelaEmpresa.dart
import 'package:flutter/material.dart'; class TelaEmpresa extends StatefulWidget { @override _TelaEmpresaState createState() => _TelaEmpresaState(); } class _TelaEmpresaState extends State<TelaEmpresa> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( title: Text("Empresa"), ), body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(16), child: Column( children: <Widget>[ Row( children: <Widget>[ Image.asset("imagens/detalhe_empresa.png"), Padding( padding: EdgeInsets.only(left: 10), child: Text( "Sobre a empresa", style: TextStyle( fontSize: 20, color: Colors.deepOrange, ), ), ) ], ), Padding( padding: EdgeInsets.only(top: 16), child: Text( "Blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "Blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "Blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "Blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ), ), ], ), ), ), ); } }
0
mirrored_repositories/Flutter-apps/listas
mirrored_repositories/Flutter-apps/listas/lib/Home.dart
import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState extends State<Home> { List _itens = []; void _carregarItens(){ _itens = []; for(int i =0; i <= 10; i++){ Map<String, dynamic> item = Map(); item["titulo"] = "Titulo ${i} a"; item["descricao"]= "descricao ${i} b"; _itens.add(item); } } @override Widget build(BuildContext context) { _carregarItens(); return Scaffold( appBar: AppBar( title: Text("Lista"), ), body: Container( padding: EdgeInsets.all(20), child: ListView.builder( itemCount: _itens.length, itemBuilder: (context, indice){ return ListTile( onTap: (){ print(""); showDialog( context: context, builder: (context){ return AlertDialog( title: Text("${_itens[indice]["titulo"]}"), titlePadding: EdgeInsets.all(20), titleTextStyle: TextStyle( fontSize: 20, color: Colors.deepOrange, ), content: Text("conteudo"), actions: <Widget>[ FlatButton( onPressed: (){ print("sim"); setState(() { _itens.removeAt(indice); }); Navigator.pop(context); }, child: Text("SIM") ), FlatButton( onPressed: (){ print("nao"); Navigator.pop(context); }, child: Text("NAO") ), ], ); } ); }, title: Text(_itens[indice]["titulo"]), subtitle: Text(_itens[indice]["descricao"]), ); } ), ), ); } }
0
mirrored_repositories/Flutter-apps/listas
mirrored_repositories/Flutter-apps/listas/lib/main.dart
import 'package:flutter/material.dart'; import 'Home.dart'; void main(){ runApp(MaterialApp( home: Home(), ) ); }
0