repo_id
stringlengths
21
168
file_path
stringlengths
36
210
content
stringlengths
1
9.98M
__index_level_0__
int64
0
0
mirrored_repositories/biscoito_sorte_app
mirrored_repositories/biscoito_sorte_app/lib/main.dart
import 'package:flutter/material.dart'; import 'pages/home_page.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Biscoito da Sorte', theme: ThemeData( primarySwatch: Colors.amber, ), home: const HomePage(), ); } }
0
mirrored_repositories/biscoito_sorte_app/lib
mirrored_repositories/biscoito_sorte_app/lib/pages/home_page.dart
import 'dart:math'; import 'package:flutter/material.dart'; class HomePage extends StatefulWidget { const HomePage({super.key}); @override State<HomePage> createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { var listaFrases = [ "A vida trará coisas boas se tiver paciência.", "Demonstre amor e alegria em todas as oportunidades e verá que a paz nasce dentro de si.", "Não compense na ira o que lhe falta na razão.", "Defeitos e virtudes são apenas dois lados da mesma moeda.", "A maior de todas as torres começa no solo.", "Não há que ser forte. Há que ser flexível.", "Todos os dias organiza os seus cabelos, por que não faz o mesmo com o coração?", "Há três coisas que jamais voltam; a flecha lançada, a palavra dita e a oportunidade perdida.", "A juventude não é uma época da vida, é um estado de espírito.", "Podemos escolher o que semear, mas somos obrigados a colher o que plantamos.", "Dê toda a atenção á formação dos seus filhos, sobretudo com bons exemplos da sua própria vida.", "Siga os bons e aprenda com eles.", "Não importa o tamanho da montanha, ela não pode tapar o sol.", "O bom-senso vale mais do que muito conhecimento.", "Quem quer colher rosas tem de estar preparado para suportar os espinhos.", "São os nossos amigos que nos ensinam as mais valiosas lições.", "Aquele que se importa com o sentimento dos outros, não é um tolo.", "A adversidade é um espelho que reflete o verdadeiro eu.", "Lamentar aquilo que não temos é desperdiçar aquilo que já possuímos.", "Uma bela flor é incompleta sem as suas folhas.", "Sem o fogo do entusiasmo, não há o calor da vitória.", "O riso é a menor distância entre duas pessoas.", "Os defeitos são mais fortes quando o amor é fraco.", "Amizade e Amor são coisas que se unem num piscar de olhos.", "Surpreender e ser surpreendido é o segredo do amor.", ]; var imgBiscoito = 'assets/images/fortune_cookie.png'; var fraseDaSorte = 'Clique no botão para quebrar o biscoito'; void quebrarBiscoito() { var num = Random().nextInt(listaFrases.length); setState(() { fraseDaSorte = listaFrases[num]; imgBiscoito = 'assets/images/cracked_fortune_cookie.png'; }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( toolbarHeight: 80, title: Text( 'Biscoito da sorte', style: TextStyle(color: Colors.amber[800], fontFamily: 'Montserrat'), ), elevation: 0, centerTitle: true, backgroundColor: Colors.white, ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ CircleAvatar( radius: 100, backgroundColor: Colors.white, child: Image.asset( imgBiscoito, fit: BoxFit.fill, alignment: Alignment.center, ), ), Padding( padding: const EdgeInsets.only( top: 50.0, left: 100.0, right: 100.0, bottom: 50.0), child: Text( fraseDaSorte, textAlign: TextAlign.center, style: TextStyle( color: Colors.amber[800], fontSize: 20, fontFamily: 'Montserrat'), ), ), ElevatedButton( onPressed: () => quebrarBiscoito(), style: ElevatedButton.styleFrom( elevation: 0, padding: const EdgeInsets.all(15.0), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0), )), child: const Text( 'Quebrar Biscoito', style: TextStyle( color: Colors.white, fontSize: 20, fontFamily: 'Montserrat', ), ), ), ], ), ), ); } }
0
mirrored_repositories/playlist_flutter
mirrored_repositories/playlist_flutter/lib/main.dart
import 'package:flutter/material.dart'; import 'package:playlist_flutter/page/homeSongs.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: HomeSongs(), ); } }
0
mirrored_repositories/playlist_flutter/lib
mirrored_repositories/playlist_flutter/lib/page/homeSongs.dart
import 'package:flutter/material.dart'; import 'package:playlist_flutter/model/songs_model.dart'; import 'package:playlist_flutter/page/playMusic.dart'; class HomeSongs extends StatefulWidget { @override _HomeSongsState createState() => _HomeSongsState(); } class _HomeSongsState extends State<HomeSongs> { @override Widget build(BuildContext context) { final mq = MediaQuery.of(context).size; return SafeArea( child: Scaffold( body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8.0), child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ buildTextTop(name: "thom yorke - playlist"), SizedBox( height: 10, ), buildRowBars(mq), SizedBox( height: mq.height * 0.06, ), buildListPlaySongs(mq, context), ]), ), ), ), ); } Widget buildTextTop({String name}) { return Center( child: Text(name.toUpperCase(), style: TextStyle( color: Colors.grey, )), ); } Widget buildRowBars(Size mq) { return Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ buildStylishIcon( icons: Icon(Icons.favorite), ), Container( clipBehavior: Clip.antiAlias, height: mq.height * 0.28, width: mq.width * 0.6, decoration: BoxDecoration( image: DecorationImage( image: NetworkImage( "https://images.unsplash.com/photo-1586348943529-beaae6c28db9?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=358&q=80"), fit: BoxFit.cover), color: Colors.grey[300], borderRadius: BorderRadius.circular(130), boxShadow: [ BoxShadow( color: Colors.black54, offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), ), buildStylishIcon(icons: Icon(Icons.more_horiz)), ], ); } Widget buildListPlaySongs(Size mq, BuildContext context) { return Container( height: mq.height * 0.6, width: mq.width, child: ListView.builder( physics: BouncingScrollPhysics(), itemCount: getSongs.length, itemBuilder: (_, index) { return GestureDetector( onTap: () { if (getSongs[index] == getSongs[2]) { Navigator.push( context, MaterialPageRoute( builder: (_) => PlayMusic( name: getSongs[index].name, author: getSongs[index].author, ))); } return null; }, child: getSongs[index].isDesignl ? Padding( padding: const EdgeInsets.only(left: 2, right: 2), child: Container( alignment: Alignment.center, height: 80, decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.all(Radius.circular(20)), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: ListTile( title: Text(getSongs[index].name), subtitle: Text( getSongs[index].author, style: TextStyle(color: Colors.grey), ), trailing: buildStylishIconPlay( icons: Icon( Icons.pause, color: Colors.white, ), )), ), ) : ListTile( title: Text(getSongs[index].name), subtitle: Text( getSongs[index].author, style: TextStyle(color: Colors.grey), ), trailing: buildStylishIcon( icons: Icon(Icons.play_arrow), )), ); }), ); } Widget buildStylishIconPlay({Icon icons}) { return Container( height: 50, width: 50, decoration: BoxDecoration( // color: Colors.blue[800], shape: BoxShape.circle, gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ Colors.blue[200], Colors.blue[300], Colors.blue[400], Colors.blue[500], ], ), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: IconButton(icon: icons, color: Colors.grey, onPressed: () {})); } Widget buildStylishIcon({Icon icons}) { return Container( height: 50, width: 50, decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.all(Radius.circular(40)), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: IconButton(icon: icons, color: Colors.grey, onPressed: () {})); } }
0
mirrored_repositories/playlist_flutter/lib
mirrored_repositories/playlist_flutter/lib/page/playMusic.dart
import 'package:flutter/material.dart'; // ignore: must_be_immutable class PlayMusic extends StatefulWidget { String name; String author; PlayMusic({this.author, this.name}); @override _PlayMusicState createState() => _PlayMusicState(); } class _PlayMusicState extends State<PlayMusic> { double _value = 0.0; void setValues(double values) { setState(() { _value = values; }); } @override Widget build(BuildContext context) { final mq = MediaQuery.of(context).size; return SafeArea( child: Scaffold( body: Column( children: [ buildAppBar(context), SizedBox( height: mq.height * 0.03, ), buildImage(mq), SizedBox( height: 20, ), Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ buildStylishText( name: widget.name, ), buildStylishText( name: widget.author, textStyle: TextStyle( color: Colors.grey[400], ), ), ], ), SizedBox( height: mq.height * 0.05, ), buildThreeIconRow(mq), ], ), ), ); } Widget buildThreeIconRow(Size mq) { return Container( child: Column( children: [ Padding( padding: const EdgeInsets.only(left: 20, right: 20), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ buildStylishText( name: "${(_value * 3.45).roundToDouble()}", textStyle: TextStyle( color: Colors.grey, ), ), buildStylishText( name: "3.45", textStyle: TextStyle( color: Colors.grey, ), ), ], ), ), Slider(value: _value, onChanged: setValues), SizedBox( height: mq.height * 0.06, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ buildStylishIcon( icon: Icon(Icons.fast_rewind), color: Colors.grey[300], icons: Colors.grey), SizedBox(width: 15), buildStylishIcon( icon: Icon(Icons.pause), color: Colors.blue[400], icons: Colors.white), SizedBox(width: 15), buildStylishIcon( icon: Icon(Icons.fast_forward), color: Colors.grey[300], icons: Colors.grey), ], ), ], ), ); } Widget buildImage(Size mq) { return Container( clipBehavior: Clip.antiAlias, height: mq.height * 0.28, width: mq.width * 0.6, decoration: BoxDecoration( image: DecorationImage( image: NetworkImage( "https://images.unsplash.com/photo-1586348943529-beaae6c28db9?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=358&q=80"), fit: BoxFit.cover), color: Colors.grey[300], borderRadius: BorderRadius.circular(130), boxShadow: [ BoxShadow( color: Colors.black54, offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), ); } Widget buildAppBar(BuildContext context) { return Padding( padding: const EdgeInsets.only(left: 8, right: 8, top: 8), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( height: 50, width: 50, decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.all(Radius.circular(40)), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: IconButton( icon: Icon(Icons.arrow_back), color: Colors.grey, onPressed: () { Navigator.pop(context); })), Text( "playing now".toUpperCase(), style: TextStyle( color: Colors.grey, ), ), Container( height: 50, width: 50, decoration: BoxDecoration( color: Colors.grey[300], borderRadius: BorderRadius.all(Radius.circular(40)), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: IconButton( icon: Icon(Icons.menu), color: Colors.grey, onPressed: () {})), ], ), ); } Widget buildStylishText({String name, TextStyle textStyle}) { return Text(name, style: textStyle); } Widget buildStylishIcon({Icon icon, Color color, Color icons}) { return Container( height: 70, width: 70, decoration: BoxDecoration( color: color, borderRadius: BorderRadius.all(Radius.circular(40)), boxShadow: [ BoxShadow( color: Colors.grey[500], offset: Offset(5.0, 5.0), blurRadius: 15.0, spreadRadius: 1.0), BoxShadow( color: Colors.white, offset: Offset(-5.0, -5.0), blurRadius: 15.0, spreadRadius: 1.0), ], ), child: IconButton(icon: icon, color: icons, onPressed: () {})); } }
0
mirrored_repositories/playlist_flutter/lib
mirrored_repositories/playlist_flutter/lib/model/songs_model.dart
class Songs { String name; String author; bool isDesignl; Songs({this.author, this.name, this.isDesignl}); } List<Songs> getSongs = [ Songs(name: "Ingenue", author: "Atoms for Peace", isDesignl: false), Songs( name: "Before Your Very Eyes", author: "Atoms for Peace", isDesignl: false), Songs(name: "Default", author: "Atoms for Peace", isDesignl: true), Songs(name: "Anima", author: "Thom York", isDesignl: false), Songs(name: "Harrowdown Hill", author: "Thom York", isDesignl: false), Songs(name: "Black Swan", author: "Thom York", isDesignl: false), Songs(name: "Decks Black", author: "T-Habit Band", isDesignl: false), Songs(name: "Rocks Belts", author: "T-Habit Band", isDesignl: false), ];
0
mirrored_repositories/World-Time-Flutter-App-
mirrored_repositories/World-Time-Flutter-App-/lib/main.dart
import 'package:flutter/material.dart'; import 'package:world_time/pages/choose_location.dart'; import 'package:world_time/pages/home.dart'; import 'package:world_time/pages/loading_screen.dart'; void main() => runApp(MaterialApp( initialRoute: ('/'), routes: { '/': (context) => LoadingScreen(), '/home': (context) => Home(), '/location': (context) => ChooseLocation(), }, ));
0
mirrored_repositories/World-Time-Flutter-App-/lib
mirrored_repositories/World-Time-Flutter-App-/lib/pages/loading_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; import 'package:world_time/services/world_time.dart'; class LoadingScreen extends StatefulWidget { @override _LoadingScreenState createState() => _LoadingScreenState(); } class _LoadingScreenState extends State<LoadingScreen> { void setupWorldTime() async{ WorldTime instance = WorldTime(location: 'Dhaka', flag: 'dhaka.png', url: 'Asia/Dhaka'); await instance.getData(); Navigator.pushReplacementNamed(context, '/home',arguments: { 'location': instance.location, 'flag': instance.flag, 'time': instance.time, 'isDayTime': instance.isDayTime, }); } @override void initState() { super.initState(); setupWorldTime(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.blueAccent, body: Center( child: SpinKitWave( color: Colors.white, size: 60.0, ), ), ); } }
0
mirrored_repositories/World-Time-Flutter-App-/lib
mirrored_repositories/World-Time-Flutter-App-/lib/pages/choose_location.dart
import 'package:flutter/material.dart'; import 'package:world_time/services/world_time.dart'; class ChooseLocation extends StatefulWidget { @override _ChooseLocationState createState() => _ChooseLocationState(); } class _ChooseLocationState extends State<ChooseLocation> { List<WorldTime> locations = [ WorldTime(url: 'Europe/London', location: 'London', flag: 'uk.png'), WorldTime(url: 'Europe/Berlin', location: 'Athens', flag: 'greece.png'), WorldTime(url: 'Africa/Cairo', location: 'Cairo', flag: 'egypt.png'), WorldTime(url: 'Africa/Nairobi', location: 'Nairobi', flag: 'kenya.png'), WorldTime(url: 'America/Chicago', location: 'Chicago', flag: 'usa.png'), WorldTime(url: 'America/New_York', location: 'New York', flag: 'usa.png'), WorldTime(url: 'Asia/Seoul', location: 'Seoul', flag: 'south_korea.png'), WorldTime(url: 'Asia/Jakarta', location: 'Jakarta', flag: 'indonesia.png'), WorldTime(url: 'Europe/London', location: 'London', flag: 'uk.png'), WorldTime(url: 'Europe/Berlin', location: 'Athens', flag: 'greece.png'), WorldTime(url: 'Africa/Cairo', location: 'Cairo', flag: 'egypt.png'), WorldTime(url: 'Africa/Nairobi', location: 'Nairobi', flag: 'kenya.png'), WorldTime(url: 'America/Chicago', location: 'Chicago', flag: 'usa.png'), WorldTime(url: 'America/New_York', location: 'New York', flag: 'usa.png'), WorldTime(url: 'Asia/Seoul', location: 'Seoul', flag: 'south_korea.png'), WorldTime(url: 'Asia/Jakarta', location: 'Jakarta', flag: 'indonesia.png'), ]; void updateTime(index) async { WorldTime instance = locations[index]; await instance.getData(); Navigator.pop(context, { 'location': instance.location, 'flag': instance.flag, 'time': instance.time, 'isDayTime': instance.isDayTime, }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.grey[200], appBar: AppBar( backgroundColor: Colors.lightBlueAccent, title: Text('Choose a location'), centerTitle: true, elevation: 0.0, ), body: ListView.builder( itemCount: locations.length, itemBuilder: (context,index){ return Padding( padding: const EdgeInsets.symmetric(vertical: 1.0,horizontal: 4.0), child: Card( elevation: 1.0, child: ListTile( onTap: () { updateTime(index); }, title: Text( locations[index].location, ), leading: CircleAvatar( backgroundImage: AssetImage('assets/${locations[index].flag}'), ), ), ), ); }, ), ); } }
0
mirrored_repositories/World-Time-Flutter-App-/lib
mirrored_repositories/World-Time-Flutter-App-/lib/pages/home.dart
import 'package:flutter/material.dart'; class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); } class _HomeState extends State<Home> { Map data = {}; @override Widget build(BuildContext context) { data = data.isNotEmpty ? data : ModalRoute.of(context).settings.arguments; print(data); String backgroundImage = data['isDayTime'] ? 'day.jpg' : 'night.jpg'; return Scaffold( body: Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage('assets/$backgroundImage'), fit: BoxFit.cover, ) ), child: Padding( padding: const EdgeInsets.fromLTRB(0.0,160.0,0.0,0.0), child: Column( children: [ FlatButton.icon( onPressed: () async { dynamic result = await Navigator.pushNamed(context, '/location'); setState(() { data = { 'location': result['location'], 'flag': result['flag'], 'time': result['time'], 'isDayTime': result['isDayTime'], }; }); }, icon: Icon( Icons.edit_location, color: Colors.grey[200], ), label: Text( 'Choose Location', style: TextStyle( color: Colors.grey[200], ), ), ), SizedBox(height: 10.0,), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(data['location'], style: TextStyle( fontSize: 28.0, letterSpacing: 2, color: Colors.grey[200], ), ) ], ), SizedBox(height: 10.0,), Text(data['time'], style: TextStyle( fontSize: 68.0, letterSpacing: 2, color: Colors.grey[200], ),) ], ), ), ), ); } }
0
mirrored_repositories/World-Time-Flutter-App-/lib
mirrored_repositories/World-Time-Flutter-App-/lib/services/world_time.dart
import 'package:http/http.dart'; import 'dart:convert'; import 'package:intl/intl.dart'; class WorldTime { String location; String time; String flag; String url; bool isDayTime; WorldTime({this.location, this.flag, this.url}); Future<void> getData() async { try{ Response response = await get(Uri.parse('https://www.worldtimeapi.org/api/timezone/$url')); Map data = jsonDecode(response.body); String datetime = data['datetime']; String offset = data['utc_offset'].substring(1,3); DateTime now = DateTime.parse(datetime); now = now.add(Duration(hours: int.parse(offset))); isDayTime = now.hour >= 5 && now.hour <= 19 ? true : false; time = DateFormat.jm().format(now); } catch (e){ print("Error: $e"); time = 'something went wrong...'; } } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/regras_layout.dart
import 'package:flutter/material.dart'; class RegrasLayout extends StatefulWidget { const RegrasLayout({Key? key}) : super(key: key); @override State<RegrasLayout> createState() => _RegrasLayoutState(); } class _RegrasLayoutState extends State<RegrasLayout> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Layout Builder"), ), body: Container( width: MediaQuery.of(context).size.width, //width: 300, height: MediaQuery.of(context).size.height, color: Colors.orange, child: LayoutBuilder( builder: (context, constraint){ var largura = constraint.maxWidth; print("Largura: ${largura}"); if( largura < 600 ){//celular "break points" return Text("Celulares"); }else if(largura < 960){// celular maiores e tablets "break points" return Text("Celulares & Tablets"); }else{ return Text("Telas maiores"); } }, ), ), ); } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/orientation_builder.dart
import 'package:flutter/material.dart'; class Orientacao extends StatefulWidget { const Orientacao({Key? key}) : super(key: key); @override State<Orientacao> createState() => _OrientacaoState(); } class _OrientacaoState extends State<Orientacao> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Orientação") ), body: OrientationBuilder( builder: (context, orientacao){ /*return Container( child: orientacao == Orientation.portrait ? Text("Portrait") : Text("Landscape") );*/ return GridView.count( //crossAxisCount: 3, crossAxisCount: orientacao == Orientation.portrait ? 2 :4, children: [ Container(color: Colors.pinkAccent,), Container(color: Colors.yellow,), Container(color: Colors.green,), Container(color: Colors.red,), Container(color: Colors.blue,), Container(color: Colors.orange,) ], ); }, ), ); } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/reponsividade_media_query.dart
import 'package:flutter/material.dart'; class ResponsividadeMediaQuery extends StatefulWidget { const ResponsividadeMediaQuery({Key? key}) : super(key: key); @override State<ResponsividadeMediaQuery> createState() => _ResponsividadeMediaQueryState(); } class _ResponsividadeMediaQueryState extends State<ResponsividadeMediaQuery> { @override Widget build(BuildContext context) { var largura = MediaQuery.of(context).size.width; var altura = MediaQuery.of(context).size.height; var alturaBarraStatus = MediaQuery.of(context).padding.top; var alturaAppbar = AppBar().preferredSize.height; //var larguraItem = largura * 0.25; // 25% //var larguraItem = largura / 2; // 50% var larguraItem = largura / 3; // 1/3 return Scaffold( appBar: AppBar( title: Text("Responsividade"), ), body: Row(children: [ Container( width: larguraItem, height: altura - alturaAppbar - alturaBarraStatus, color: Colors.blueAccent ), Container( width: larguraItem, height: altura - alturaAppbar - alturaBarraStatus, color: Colors.yellow ), Container( width: larguraItem, height: altura - alturaAppbar - alturaBarraStatus, color: Colors.green ) ],), ); } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/responsividade_warp.dart
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ResponsividadeWarp extends StatefulWidget { const ResponsividadeWarp({Key? key}) : super(key: key); @override State<ResponsividadeWarp> createState() => _ResponsividadeWarpState(); } class _ResponsividadeWarpState extends State<ResponsividadeWarp> { @override Widget build(BuildContext context) { double altura = 100; double largura = 100; return Scaffold( appBar: AppBar( title: Text("Warp"), ), body: Container( color: Colors.black, width: MediaQuery.of(context).size.width, child: Wrap( //alignment: WrapAlignment.spaceAround, //alignment: WrapAlignment.start, alignment: WrapAlignment.center, //alignment: WrapAlignment.spaceBetween, //alignment: WrapAlignment.spaceEvenly, //alignment: WrapAlignment.end, //Espaço fixo entre os objetos NA HORIZONTAL spacing: 10, //Espaço fixo entre os objetos NA VERTICAL runSpacing: 10, children: [ Container( width: largura, height: altura, color: Colors.orange, ), Container( width: largura, height: altura, color: Colors.green, ), Container( width: largura, height: altura, color: Colors.purple, ), Container( width: largura, height: altura, color: Colors.yellow, ), Container( width: largura, height: altura, color: Colors.pinkAccent, ), ],), ), ); } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/responsividade_row_col.dart
import 'package:flutter/material.dart'; class ResponsividadeRowCol extends StatefulWidget { const ResponsividadeRowCol({Key? key}) : super(key: key); @override State<ResponsividadeRowCol> createState() => _ResponsividadeRowColState(); } class _ResponsividadeRowColState extends State<ResponsividadeRowCol> { late var largura = MediaQuery.of(context).size.width; late var altura = MediaQuery.of(context).size.height; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Responsividade"), ), body: Column(children: [ /*Container( color: Colors.red, height: 200, ),*/ Expanded( flex: 2, child: Container( color: Colors.orange, )), Expanded( flex: 6, child: Row(children: [ Expanded( flex: 1, child: Container( color: Colors.pink, )), Expanded( flex: 1, child: Container( color: Colors.deepPurple, )), Expanded( flex: 1, child: Container( color: Colors.green, )), ], )), Expanded( flex: 1, child: Container( color: Colors.yellow, )) ], ), ); } }
0
mirrored_repositories/flutter_web_aula
mirrored_repositories/flutter_web_aula/lib/main.dart
import 'package:flutter/material.dart'; import 'package:flutter_web_aula/orientation_builder.dart'; import 'package:flutter_web_aula/regras_layout.dart'; import 'package:flutter_web_aula/reponsividade_media_query.dart'; import 'package:flutter_web_aula/responsividade_row_col.dart'; import 'package:flutter_web_aula/responsividade_warp.dart'; void main() { runApp( (const MaterialApp( title: "Flutter Web Resposible", //home: ResponsividadeMediaQuery(), //home: ResponsividadeRowCol(), //home: ResponsividadeWarp(), //home: Orientacao(), home: RegrasLayout(), debugShowCheckedModeBanner: false, ) ) ); }
0
mirrored_repositories/Events_App
mirrored_repositories/Events_App/lib/main.dart
import 'package:events_app/screens/login_screen.dart'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( primaryColor: Colors.blue, accentColor: Colors.grey, ), home: LoginScreen(), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/widgets/details_widget.dart
import 'package:flutter/material.dart'; class DetailsWidget extends StatefulWidget { @override _DetailsWidgetState createState() => _DetailsWidgetState(); } class _DetailsWidgetState extends State<DetailsWidget> { @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.symmetric( horizontal: 10.0, vertical: 20.0, ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ Text( 'Email', style: TextStyle( color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold, ), ), Text( 'pratiktemkarofficial@gmail.com', style: TextStyle( color: Colors.black, fontSize: 18.0, ), ), SizedBox( height: 20.0, ), Text( 'Phone', style: TextStyle( color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold, ), ), Text( '9325674212', style: TextStyle( color: Colors.black, fontSize: 18.0, ), ), SizedBox( height: 20.0, ), Text( 'College/Organisation', style: TextStyle( color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold, ), ), Text( 'Modern Education Society\'s College of Engineering, Pune', style: TextStyle( color: Colors.black, fontSize: 18.0, ), ), ], ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/widgets/profileimg_widget.dart
import 'package:flutter/material.dart'; class ProfileImgWidget extends StatefulWidget { @override _ProfileImgWidgetState createState() => _ProfileImgWidgetState(); } class _ProfileImgWidgetState extends State<ProfileImgWidget> { @override Widget build(BuildContext context) { return Material( elevation: 4.0, shape: CircleBorder(), clipBehavior: Clip.hardEdge, color: Colors.transparent, child: Ink.image( image: AssetImage('assets/images/6.jpg'), fit: BoxFit.cover, width: 150.0, height: 150.0, child: InkWell( onTap: () {}, ), ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/widgets/event_widget.dart
import 'package:events_app/screens/event_screen.dart'; import 'package:events_app/models/event_model.dart'; import 'package:flutter/material.dart'; class EventWidget extends StatefulWidget { @override _EventWidgetState createState() => _EventWidgetState(); } class _EventWidgetState extends State<EventWidget> { @override Widget build(BuildContext context) { return Container( height: 200.0, child: Column( children: <Widget>[ Padding( padding: const EdgeInsets.all(10.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text( 'Top Events', style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.w600, color: Colors.black, ), ), GestureDetector( onTap: () {}, child: Text( 'See All', style: TextStyle( color: Colors.blue, fontSize: 15.0, fontWeight: FontWeight.w600, ), ), ), ], ), ), Container( height: 155.0, child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: 7, itemBuilder: (BuildContext context, int index) { Event event = events[index]; return GestureDetector( onTap: () => Navigator.push( context, MaterialPageRoute( builder: (_) => EventScreen( event: event, ), ), ), child: Container( margin: EdgeInsets.all(10.0), height: 80.0, width: 120.0, decoration: BoxDecoration( color: Colors.grey, borderRadius: BorderRadius.circular(10.0), boxShadow: [ BoxShadow( offset: Offset(2.0, 4.0), blurRadius: 6.0, color: Colors.black26, ), ]), child: Stack( alignment: Alignment.topCenter, children: <Widget>[ Hero( tag: events[index].imageUrl, child: ClipRRect( borderRadius: BorderRadius.circular(10.0), child: Image( image: AssetImage(events[index].imageUrl), height: 180.0, width: 180.0, fit: BoxFit.cover, )), ), Positioned( left: 10.0, bottom: 10.0, child: Text( 'Event $index', style: TextStyle( color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.w600, ), ), ), ], ), ), ); }, ), ), ], ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/widgets/date_widget.dart
import 'package:flutter/material.dart'; class DateWidget extends StatefulWidget { @override _DateWidgetState createState() => _DateWidgetState(); } class _DateWidgetState extends State<DateWidget> { String getDate(int day) { switch (day) { case 1: return 'Monday'; break; case 2: return 'Tuesday'; break; case 3: return 'Wednesday'; break; case 4: return 'Thursday'; break; case 5: return 'Friday'; break; case 6: return 'Saturday'; break; case 7: return 'Sunday'; break; } } @override Widget build(BuildContext context) { return Container( height: 100.0, child: Padding( padding: const EdgeInsets.all(10.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ Text( getDate(DateTime.now().toLocal().weekday.toInt()), style: TextStyle( fontSize: 30.0, fontWeight: FontWeight.w600, letterSpacing: 1.2, color: Colors.white, ), ), Text( DateTime.now().toString(), style: TextStyle( color: Colors.white, fontSize: 20.0, ), ), ], ), ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/widgets/attend_widget.dart
import 'package:events_app/models/attend_model.dart'; import 'package:events_app/models/event_model.dart'; import 'package:events_app/screens/ticket_screen.dart'; import 'package:flutter/material.dart'; class AttendWidget extends StatefulWidget { @override _AttendWidgetState createState() => _AttendWidgetState(); } class _AttendWidgetState extends State<AttendWidget> { @override Widget build(BuildContext context) { return ListView.builder( itemCount: 4, itemBuilder: (BuildContext context, int index) { return Container( padding: EdgeInsets.only( top: 10.0, left: 10.0, right: 10.0, bottom: 10.0, ), child: Card( color: Colors.blue, child: Stack( children: <Widget>[ Opacity( opacity: 0.3, child: Image( image: AssetImage(attends[index].imageUrl), fit: BoxFit.cover, height: 150.0, width: MediaQuery.of(context).size.width - 20.0, ), ), Padding( padding: EdgeInsets.symmetric( horizontal: 15.0, vertical: 25.0, ), child: Column( children: <Widget>[ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text( attends[index].name, style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.bold, ), ), Text( attends[index].city, style: TextStyle( color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.w600, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text( events[index].description, style: TextStyle( color: Colors.white, fontSize: 15.0, ), ), Text( '\$ 200', style: TextStyle( color: Colors.white, fontSize: 15.0, fontWeight: FontWeight.w500, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ Tooltip( message: 'Show Event Ticket', child: FlatButton( onPressed: () => Navigator.push( context, MaterialPageRoute( builder: (_) => TicketScreen())), child: Text( 'Show Ticket', style: TextStyle( color: Colors.white, fontSize: 15.0, ), ), ), ), ], ), ], ), ), ], ), ), ); }, ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/models/event_model.dart
class Event { String name; String imageUrl; String city; String country; String description; Event({ this.name, this.imageUrl, this.city, this.country, this.description, }); } List<Event> events = [ Event( name: 'Event 0', imageUrl: 'assets/images/0.jpg', city: 'Pune', country: 'India', description: 'Very good event.'), Event( name: 'Event 1', imageUrl: 'assets/images/1.jpg', city: 'Delhi', country: 'India', description: 'Very good event.'), Event( name: 'Event 2', imageUrl: 'assets/images/2.jpg', city: 'Hyderabad', country: 'India', description: 'Very good event.'), Event( name: 'Event 3', imageUrl: 'assets/images/3.jpg', city: 'Bangalore', country: 'India', description: 'Very good event.'), Event( name: 'Event 4', imageUrl: 'assets/images/4.jpg', city: 'Bangalore', country: 'India', description: 'Very good event.'), Event( name: 'Event 5', imageUrl: 'assets/images/5.jpg', city: 'Bangalore', country: 'India', description: 'Very good event.'), Event( name: 'Event 6', imageUrl: 'assets/images/6.jpg', city: 'Bangalore', country: 'India', description: 'Very good event.'), ];
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/models/attend_model.dart
class Attend { String name; DateTime date; String imageUrl; String city; String country; String description; Attend({ this.name, this.date, this.imageUrl, this.city, this.country, this.description, }); } List<Attend> attends = [ Attend( name: 'Event 1', imageUrl: 'assets/images/1.jpg', city: 'Pune', country: 'India', description: 'This is a good event.'), Attend( name: 'Event 3', imageUrl: 'assets/images/3.jpg', city: 'Bangalore', country: 'India', description: 'This is a good event.'), Attend( name: 'Event 5', imageUrl: 'assets/images/5.jpg', city: 'Delhi', country: 'India', description: 'This is a good event.'), Attend( name: 'Event 6', imageUrl: 'assets/images/6.jpg', city: 'Chennai', country: 'India', description: 'This is a good event.'), ];
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/profile_screen.dart
import 'package:events_app/widgets/details_widget.dart'; import 'package:events_app/widgets/profileimg_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class ProfileScreen extends StatefulWidget { @override _ProfileScreenState createState() => _ProfileScreenState(); } class _ProfileScreenState extends State<ProfileScreen> { @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Column( children: <Widget>[ Container( alignment: Alignment.center, height: 200.0, // color: Theme.of(context).primaryColor, child: ProfileImgWidget(), ), Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( 'Jennifer', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 20.0, ), ), IconButton( icon: Icon(Icons.edit), color: Colors.black, onPressed: () {}, tooltip: 'Edit Profile', ), ], ), Container( child: DetailsWidget(), ), SizedBox( height: 10.0, ), SizedBox.fromSize( child: SvgPicture.asset('assets/svg_img/profile_girl.svg'), size: Size(150.0, 150.0), ), ], ), ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/home_screen.dart
import 'package:events_app/screens/attend_screen.dart'; import 'package:events_app/screens/profile_screen.dart'; import 'package:events_app/screens/start_screen.dart'; import 'package:flutter/material.dart'; class HomeScreen extends StatefulWidget { @override _HomeScreenState createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateMixin { int _currentTab = 0; List<Widget> _screenList = [ StartScreen(), AttendScreen(), ProfileScreen(), ]; TabController _tabController; @override void initState() { super.initState(); _tabController = TabController( length: _screenList.length, vsync: this, ); } @override void dispose() { _tabController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Events'), centerTitle: true, elevation: 0.0, ), body: TabBarView( physics: NeverScrollableScrollPhysics(), controller: _tabController, children: _screenList, ), bottomNavigationBar: BottomNavigationBar( currentIndex: _currentTab, onTap: (int value) { setState(() { _currentTab = value; _tabController.animateTo(value); }); }, items: [ BottomNavigationBarItem( icon: Tooltip( child: Icon(Icons.home), message: 'Home', ), title: SizedBox.shrink(), ), BottomNavigationBarItem( icon: Tooltip( child: Icon(Icons.event_seat), message: 'Attend Event', ), title: SizedBox.shrink(), ), BottomNavigationBarItem( icon: Tooltip( child: Icon(Icons.account_circle), message: 'Profile', ), title: SizedBox.shrink(), ), ], ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/ticket_screen.dart
import 'package:flutter/material.dart'; class TicketScreen extends StatefulWidget { @override _TicketScreenState createState() => _TicketScreenState(); } class _TicketScreenState extends State<TicketScreen> { @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Container( margin: EdgeInsets.all(20.0), decoration: BoxDecoration( color: Colors.blue, borderRadius: BorderRadius.all(Radius.circular(30.0)), ), child: Padding( padding: const EdgeInsets.all(20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ Align( alignment: Alignment.center, child: Text( 'Event 1', style: TextStyle( color: Colors.black, fontSize: 30.0, fontWeight: FontWeight.bold, ), ), ), SizedBox( height: 20.0, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Row( children: <Widget>[ Icon( Icons.local_airport, color: Colors.white, size: 20.0, ), SizedBox( width: 10.0, ), Text( 'Pune, India', style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w600, ), ), ], ), Text( '20th Oct', style: TextStyle( color: Colors.white, fontSize: 15.0, ), ) ], ), SizedBox( height: 20.0, ), Row( children: <Widget>[ Icon( Icons.access_time, color: Colors.white, size: 20.0, ), SizedBox( width: 10.0, ), Text( '9 AM', style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w600, ), ), ], ), SizedBox( height: 20.0, ), Row( children: <Widget>[ Icon( Icons.remove_circle_outline, size: 20.0, color: Colors.white, ), SizedBox( width: 10.0, ), Text( 'Instructions to attend :', style: TextStyle( color: Colors.white, fontSize: 18.0, fontWeight: FontWeight.w300, ), ), ], ), SizedBox( height: 10.0, ), Container( height: 200.0, color: Colors.red, ), SizedBox( height: 20.0, ), Row( children: <Widget>[ Icon( Icons.screen_lock_landscape, size: 20.0, color: Colors.white, ), SizedBox( width: 10.0, ), Text( 'QR Code', style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w600, ), ), ], ), SizedBox( height: 10.0, ), Align( alignment: Alignment.center, child: Container( height: 200.0, width: 200.0, color: Colors.black, ), ), ], ), ), ), ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/event_screen.dart
import 'package:events_app/models/event_model.dart'; import 'package:events_app/screens/registerevent_screen.dart'; import 'package:flutter/material.dart'; class EventScreen extends StatefulWidget { final Event event; EventScreen({this.event}); @override _EventScreenState createState() => _EventScreenState(); } class _EventScreenState extends State<EventScreen> { @override Widget build(BuildContext context) { return Scaffold( body: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Stack( children: <Widget>[ Container( height: MediaQuery.of(context).size.width, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), boxShadow: [ BoxShadow( color: Colors.black26, offset: Offset(0.0, 2.0), blurRadius: 6.0), ], ), child: Hero( tag: widget.event.imageUrl, child: ClipRRect( borderRadius: BorderRadius.only( bottomLeft: Radius.circular(30.0), bottomRight: Radius.circular(30.0)), child: Image( image: AssetImage(widget.event.imageUrl), fit: BoxFit.cover, ), ), ), ), Padding( padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 40.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ IconButton( icon: Icon(Icons.arrow_back), iconSize: 30.0, color: Colors.white, onPressed: () => Navigator.pop(context), ), Row( children: <Widget>[ IconButton( icon: Icon(Icons.search), iconSize: 30.0, color: Colors.white, onPressed: () {}, ), IconButton( icon: Icon(Icons.collections), iconSize: 30.0, color: Colors.white, onPressed: () {}, ), ], ), ], ), ), Positioned( left: 20.0, bottom: 20.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( widget.event.city, style: TextStyle( color: Colors.white, fontSize: 25.0, fontWeight: FontWeight.w600, letterSpacing: 1.2, ), ), Row( children: <Widget>[ Icon( Icons.local_airport, size: 15.0, color: Colors.white70, ), SizedBox( width: 5.0, ), Text( widget.event.country, style: TextStyle( color: Colors.white70, fontSize: 20.0, ), ), ], ), ], ), ), Positioned( right: 20.0, bottom: 20.0, child: Icon( Icons.location_on, color: Colors.white70, size: 25.0, ), ), ], ), Padding( padding: EdgeInsets.only( top: 20.0, left: 20.0, ), child: Text( widget.event.description, style: TextStyle( color: Colors.black, fontSize: 20.0, letterSpacing: 1.2, ), ), ), Expanded( child: Padding( padding: EdgeInsets.only( bottom: 10.0, ), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ Center( child: FlatButton( padding: EdgeInsets.all(20.0), onPressed: () => Navigator.push( context, MaterialPageRoute( builder: (_) => RegisterEventScreen())), color: Colors.blue, splashColor: Colors.blueGrey, child: Text( 'Register', style: TextStyle( color: Colors.white, fontSize: 20.0, fontWeight: FontWeight.w600, ), ), ), ), ], ), ), ), ], ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/attend_screen.dart
import 'package:events_app/widgets/attend_widget.dart'; import 'package:flutter/material.dart'; class AttendScreen extends StatefulWidget { @override _AttendScreenState createState() => _AttendScreenState(); } class _AttendScreenState extends State<AttendScreen> { @override Widget build(BuildContext context) { return Container( // color: Colors.red, child: AttendWidget(), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/registerevent_screen.dart
import 'package:flutter/material.dart'; class RegisterEventScreen extends StatefulWidget { @override _RegisterEventScreenState createState() => _RegisterEventScreenState(); } class _RegisterEventScreenState extends State<RegisterEventScreen> { @override Widget build(BuildContext context) { return Scaffold( body: SafeArea( child: Container( color: Colors.red, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ SizedBox( height: 20.0, ), Align( alignment: Alignment.center, child: Text( 'Register', style: TextStyle( color: Colors.black, fontSize: 30.0, fontWeight: FontWeight.bold, ), ), ), Text( 'aedad', ), ], ), ), ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/start_screen.dart
import 'package:events_app/widgets/date_widget.dart'; import 'package:events_app/widgets/event_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; class StartScreen extends StatefulWidget { @override _StartScreenState createState() => _StartScreenState(); } class _StartScreenState extends State<StartScreen> { @override Widget build(BuildContext context) { return SafeArea( child: Column( children: <Widget>[ Container( height: 200.0, decoration: BoxDecoration( color: Colors.blue, borderRadius: BorderRadius.only( bottomRight: Radius.circular(50.0), ), ), child: Column( children: <Widget>[ SizedBox( height: 50.0, ), DateWidget(), ], ), ), Expanded( child: Container( child: Stack( alignment: Alignment.topCenter, children: <Widget>[ Container( color: Colors.blue, ), Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), ), ), child: Column( children: <Widget>[ SizedBox( height: 20.0, ), EventWidget(), SizedBox.fromSize( child: SvgPicture.asset( 'assets/svg_img/waiting_tree.svg', ), size: Size(200.0, 200.0), ), ], ), ), ], ), ), ), ], ), ); } }
0
mirrored_repositories/Events_App/lib
mirrored_repositories/Events_App/lib/screens/login_screen.dart
0
mirrored_repositories/Events_App
mirrored_repositories/Events_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:events_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/Simulador_Tipo_OLX
mirrored_repositories/Simulador_Tipo_OLX/lib/main.dart
import 'package:flutter/material.dart'; import 'package:olx_app/RouteGenerator.dart'; import 'package:olx_app/views/Anuncios.dart'; import 'package:firebase_core/firebase_core.dart'; final ThemeData temaPadrao = ThemeData( primaryColor: const Color(0xff9c27b0), appBarTheme:const AppBarTheme ( backgroundColor: Color(0xff7b1fa2), )); void main() async { //Iniciar o Firebase WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); runApp( MaterialApp( title: "Aula OLX Ûdemy", home: Anuncios(), theme: temaPadrao, initialRoute: "/", onGenerateRoute: RouteGenerator.generateRoute, debugShowCheckedModeBanner: false, )) ; }
0
mirrored_repositories/Simulador_Tipo_OLX
mirrored_repositories/Simulador_Tipo_OLX/lib/RouteGenerator.dart
import 'package:flutter/material.dart'; import 'package:olx_app/views/Anuncios.dart'; import 'package:olx_app/views/DetalhesAnuncio.dart'; import 'package:olx_app/views/Login.dart'; import 'package:olx_app/views/MeusAnuncios.dart'; import 'package:olx_app/views/NovoAnuncio.dart'; class RouteGenerator { static Route<dynamic>? generateRoute(RouteSettings settings){ dynamic args = settings.arguments; switch( settings.name ){ case "/" : return MaterialPageRoute( builder:(_) => Anuncios(), ); case "/login" : return MaterialPageRoute( builder:(_) => Login(), ); case "/meus-anuncios" : return MaterialPageRoute( builder:(_) => MeusAnuncios(), ); case "/novo-anuncio" : return MaterialPageRoute( builder:(_) => NovoAnuncio(), ); case "/detalhes-anuncio" : return MaterialPageRoute( builder:(_) => DetalhesAnuncio(args), ); default: _erroRota(); } } static Route<dynamic> _erroRota(){ return MaterialPageRoute( builder: (_){ return Scaffold( appBar: AppBar( title: const Text("Tela não encontrada!"), ), body: const Center( child: Text("Tela não encontrada!"), ), ); } ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/views/Anuncios.dart
import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'dart:async'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:olx_app/main.dart'; import 'package:olx_app/models/Anuncio.dart'; import 'package:olx_app/util/Configuracoes.dart'; import 'package:olx_app/views/widgets/ItemAnuncio.dart'; class Anuncios extends StatefulWidget { const Anuncios({Key? key}) : super(key: key); @override State<Anuncios> createState() => _AnunciosState(); } class _AnunciosState extends State<Anuncios> { List<String> itensMenu = []; late List<DropdownMenuItem<String>> _listaItensDropCategorias; late List<DropdownMenuItem<String>> _listaItensDropEstados; final _controler = StreamController<QuerySnapshot>.broadcast(); String? _itemSelecionadoEstado; String? _itemSelecionadoCategoria; _deslogarUsuario() async { FirebaseAuth auth = FirebaseAuth.instance; await auth.signOut(); Navigator.pushNamed(context, "/login"); } _escolhaMenuItem( String itemEscolhido ){ switch( itemEscolhido ){ case "Meus Anúncios" : Navigator.pushNamed(context, "/meus-anuncios"); break; case "Entrar / Cadastrar" : Navigator.pushNamed(context, "/login"); break; case "Deslogar" : _deslogarUsuario(); break; } } Future<dynamic> _verificaUsuarioLogado() async{ FirebaseAuth auth = FirebaseAuth.instance; User? usuarioLogado = await auth.currentUser; if( usuarioLogado == null ){ itensMenu = [ "Entrar / Cadastrar" ]; }else{ itensMenu = [ "Meus Anúncios", "Deslogar" ]; } } _carregarItensDropdown(){ //Categorias _listaItensDropCategorias = Configuracoes().getCategorias(); //Estados _listaItensDropEstados = Configuracoes().getEstados(); } Future<Stream<QuerySnapshot>?> _adicionarListenerAnuncios() async{ FirebaseFirestore db = FirebaseFirestore.instance; Stream<QuerySnapshot> stream = db .collection("anuncios") .snapshots(); stream.listen((dados) { _controler.add(dados); }); } Future<Stream<QuerySnapshot>?> _filtrarAnuncios() async{ FirebaseFirestore db = FirebaseFirestore.instance; Query query = db.collection("anuncios"); if( _itemSelecionadoEstado != null){ query = query.where("estado", isEqualTo: _itemSelecionadoEstado); } if( _itemSelecionadoCategoria != null){ query = query.where("categoria", isEqualTo: _itemSelecionadoCategoria); } Stream<QuerySnapshot> stream = query.snapshots(); stream.listen((dados) { _controler.add(dados); }); } @override void initState() { super.initState(); _carregarItensDropdown(); _verificaUsuarioLogado(); _adicionarListenerAnuncios(); } @override Widget build(BuildContext context) { var carregandoDados = Center( child: Column(children: const [ Text("Carregando Anúncios"), CircularProgressIndicator() ], ),); return Scaffold( appBar: AppBar( title: const Text("OLX"), elevation: 0, actions: [ PopupMenuButton<String>( onSelected: _escolhaMenuItem, itemBuilder: (context){ return itensMenu.map(( String item ){ return PopupMenuItem<String>( value: item, child: Text(item), ); }).toList(); } ) ], ), body: Column( children: [ Row(children: [ Expanded( child: DropdownButtonHideUnderline( child: Center( child: DropdownButton( iconEnabledColor: temaPadrao.primaryColor, value: _itemSelecionadoEstado, items: _listaItensDropEstados, style: const TextStyle( fontSize: 22, color: Colors.black ), onChanged: (estado){ setState(() { _itemSelecionadoEstado = estado as String?; _filtrarAnuncios(); }); }, ), ), )), Container( color: Colors.grey[200], width: 2, height: 60, ), Expanded( child: DropdownButtonHideUnderline( child: Center( child: DropdownButton( iconEnabledColor: temaPadrao.primaryColor, value: _itemSelecionadoCategoria, items: _listaItensDropCategorias, style: const TextStyle( fontSize: 22, color: Colors.black ), onChanged: (categoria){ setState(() { _itemSelecionadoCategoria = categoria as String?; _filtrarAnuncios(); }); }, ), ), )), ],), StreamBuilder( stream: _controler.stream, builder: (context, AsyncSnapshot){ switch ( AsyncSnapshot.connectionState ){ case ConnectionState.none : case ConnectionState.waiting: return carregandoDados; case ConnectionState.active: case ConnectionState.done: QuerySnapshot? querySnapshot = AsyncSnapshot.data as QuerySnapshot<Object?>?; if( querySnapshot!.docs.isEmpty ){ return Container( padding: EdgeInsets.all(25), child: const Text("Nenhum anúncio :( ", style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold ),), ); } return Expanded( child: ListView.builder( itemCount: querySnapshot.docs.length, itemBuilder: (_, indice){ List<DocumentSnapshot> anuncios = querySnapshot.docs.toList(); DocumentSnapshot documentSnapshot = anuncios[indice]; Anuncio anuncio = Anuncio.fromDocumentSnapshot(documentSnapshot); return ItemAnuncio( anuncio: anuncio, onTapItem: (){ Navigator.pushNamed( context, "/detalhes-anuncio", arguments: anuncio ); }, ); }) ); } } ), ],) ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/views/Login.dart
import 'package:flutter/material.dart'; import 'package:olx_app/models/Usuario.dart'; import 'package:olx_app/views/widgets/BotaoCustomizado.dart'; import 'package:olx_app/views/widgets/InputCustomizado.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class Login extends StatefulWidget { const Login({Key? key}) : super(key: key); @override State<Login> createState() => _LoginState(); } class _LoginState extends State<Login> { TextEditingController _controllerEmail = TextEditingController(); TextEditingController _controllerSenha = TextEditingController(); bool _cadastrar = false; String _mensagemErro = ""; String _textoBotao = "Entrar"; _validarCampos(){ //Recupera dados dos campos String _email = _controllerEmail.text; String _senha = _controllerSenha.text; if( _email.isNotEmpty && _email.contains("@")) { if ( _senha.isNotEmpty && _senha.length > 6 ) { //Configurar Usuario Usuario usuario = Usuario(); usuario.email = _email; usuario.senha = _senha; //Cadastrar ou Logar if( _cadastrar ){ //Cadastrar _cadastrarUsuario(usuario); }else{ //Logar _logarUsuario(usuario); } }else{ setState(() { _mensagemErro = "Preencha a senha! digite mais de 6 caracteres"; }); } }else{ setState(() { _mensagemErro = "Preencha com um e-mail válido"; }); } } _cadastrarUsuario( Usuario usuario ) { FirebaseAuth auth = FirebaseAuth.instance; FirebaseFirestore db = FirebaseFirestore.instance; auth.createUserWithEmailAndPassword( email: usuario.email, password: usuario.senha ).then(( dynamic firebaseUser) { dynamic uid = auth.currentUser!.uid; db.collection("usuarios") .doc( uid.toString()) .set( usuario.toMap()); //redirecionar para tela principal Navigator.pushReplacementNamed(context, "/"); }).catchError((error){ _mensagemErro = "Erro ao autenticar o usuário, \n " "verifique os campos e tente novamente";}); } _logarUsuario( Usuario usuario ) async { FirebaseAuth auth = FirebaseAuth.instance; auth.signInWithEmailAndPassword( email: usuario.email, password: usuario.senha ).then(( dynamic firebaseUser) { //redirecionar para tela principal Navigator.pushReplacementNamed(context, "/"); }).catchError((error){ _mensagemErro = "Usuário não existe, \n " "verifique os campos e tente novamente";}); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text(""), ), body: Container( padding: const EdgeInsets.all(16), color: Colors.white, child: Center( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Padding( padding:const EdgeInsets.only(bottom: 32), child: Image.asset( "imagens/logo.png", width: 200, height: 150, ), ), InputCustomizado( controllerLog1: _controllerEmail, hint: "E-mail", label: "E-mail", autofocus: true, type: TextInputType.emailAddress, ), const Padding( padding: EdgeInsets.only(top: 12)), InputCustomizado( controllerLog1: _controllerSenha, hint: "Senha", label: "Senha", obscure: true, type: TextInputType.text, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text("logar"), Switch( value: _cadastrar, onChanged: (bool valor){ setState(() { _cadastrar = valor; _textoBotao = "Entrar"; if ( _cadastrar ){ _textoBotao = "Cadastrar"; }else{ _textoBotao = "logar"; } }); } ), const Text("Cadastrar") ], ), BotaoCustomizado( texto: _textoBotao, onPressed: (){ _validarCampos();} ), BotaoCustomizado( texto: "Ir para anúncios", corBotao: Colors.transparent, corTexto: Colors.black, onPressed: (){ Navigator.pushReplacementNamed(context, "/"); }, ), Padding(padding: const EdgeInsets.only(top: 20), child: Text( _mensagemErro, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold, color: Colors.red ), ), ) ], ), ), ), ), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/views/NovoAnuncio.dart
import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:olx_app/models/Anuncio.dart'; import 'package:olx_app/util/Configuracoes.dart'; import 'package:olx_app/views/widgets/BotaoCustomizado.dart'; import 'package:image_picker/image_picker.dart'; import 'package:firebase_storage/firebase_storage.dart'; import 'package:brasil_fields/brasil_fields.dart'; import 'package:olx_app/views/widgets/InputCustomizado.dart'; import 'package:validadores/validadores.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'dart:async'; class NovoAnuncio extends StatefulWidget { const NovoAnuncio({Key? key}) : super(key: key); @override State<NovoAnuncio> createState() => _NovoAnuncioState(); } class _NovoAnuncioState extends State<NovoAnuncio> { final List<File> _listaImagens = []; List<DropdownMenuItem<String>> _listaItensDropEstados = []; List<DropdownMenuItem<String>> _listaItensDropCategorias = []; final _formKey = GlobalKey<FormState>(); Anuncio? _anuncio; BuildContext? _dialogContext; String? _itemSelecionadoEstado; String? _itemSelecionadoCategoria; Future<dynamic> _selecionarImagemGaleria( ) async { String origemImagem = ""; showDialog( context: context, builder: (context){ return AlertDialog( title: const Text("Selecionar imagem"), content: const Text("Escolha o local de onde \n quer inserir a foto"), contentPadding: const EdgeInsets.all(16), actions: <Widget> [ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ BotaoCustomizado( corBotao: Colors.white, corTexto: Colors.blue, corShadow: Colors.black, elevation: 9, texto: "Galeria", onPressed: () { setState(() { origemImagem = "galeria"; }); Navigator.pop(context); }), BotaoCustomizado( corBotao: Colors.white, corTexto: Colors.deepPurpleAccent, corShadow: Colors.black, elevation: 9, texto: "Câmera", onPressed: () { setState(() { origemImagem = "camera"; }); Navigator.pop(context); }), ]) ], ); } ).whenComplete(() async { ImagePicker Piker = ImagePicker(); XFile? imagemSelecionada; if( origemImagem == "camera" ) { imagemSelecionada = await Piker.pickImage(source: ImageSource.camera); }else if( origemImagem == "galeria") { imagemSelecionada = await Piker.pickImage(source: ImageSource.gallery); } dynamic imagem = File(imagemSelecionada!.path); setState(() { _listaImagens.add( imagem ); }); }); } _abrirDialog (BuildContext context){ showDialog( context: context, barrierDismissible: false, builder: ( BuildContext context){ return AlertDialog( content: Column( mainAxisSize: MainAxisSize.min, children: const [ CircularProgressIndicator(), SizedBox(height: 20,width: 20,), Text("Salvando anúncio...") ],), );} ); } Future<dynamic> _salvaAnuncio() async{ _abrirDialog( _dialogContext! ); //Upload Imagem no Storage await _uploadImagem(); //Salvar anuncio no Firebase FirebaseAuth auth = FirebaseAuth.instance; User? usuarioLogado = auth.currentUser; dynamic idUsuarioLogado = usuarioLogado!.uid; FirebaseFirestore db = FirebaseFirestore.instance; db.collection( "meus_anuncios" ) .doc( idUsuarioLogado ) .collection( "anuncios" ) .doc( _anuncio!.id ) .set( _anuncio!.toMap()).then((_) { //Salvar anúncio público db.collection("anuncios") .doc( _anuncio!.id) .set( _anuncio!.toMap() ).then((_) { Navigator.pop(_dialogContext!); Navigator.pop(context); }); }); } Future<dynamic> _uploadImagem( ) async { FirebaseStorage storage = FirebaseStorage.instance; Reference pastaRaiz = storage.ref(); for( dynamic imagem in _listaImagens ) { dynamic nomeImagem = DateTime.now().microsecondsSinceEpoch.toString(); Reference arquivo = pastaRaiz .child('meus_anuncios') .child(_anuncio!.id) .child( nomeImagem); //upload da imagem UploadTask uploadTask = arquivo.putFile(imagem); TaskSnapshot taskSnapshot = await uploadTask; dynamic url = await taskSnapshot.ref.getDownloadURL(); _anuncio?.fotos.add(url); } } @override void initState() { super.initState(); _carregarItensDropdown(); _anuncio = Anuncio.gerarId(); } _carregarItensDropdown(){ //Categorias _listaItensDropCategorias = Configuracoes().getCategorias(); //Estados _listaItensDropEstados = Configuracoes().getEstados(); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Novo anúncio"), ), body: SingleChildScrollView( child: Container( padding: const EdgeInsets.all(16), child: Form( key: _formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ //Àrea de imagens FormField<List>( initialValue: _listaImagens, validator: ( imagens ){ if( imagens?.length == 0 ){ return "Necessário selecionar uma imagem!"; } return null; }, builder: ( state ){ return Column(children: [ SizedBox( height: 100, child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: _listaImagens.length + 1, itemBuilder: (context, indice){ if( indice == _listaImagens.length ){ return Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: GestureDetector( onTap: (){ _selecionarImagemGaleria(); }, child: CircleAvatar( backgroundColor: Colors.grey[400], radius: 50, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( Icons.add_a_photo, size: 40, color: Colors.grey[100], ), Text( "Adicionar", style: TextStyle( color: Colors.grey[100] ), ) ],), ), ), ); } if( _listaImagens.length > 0 ){ return Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: GestureDetector( onTap: (){ showDialog( context: context, builder: (context) => Dialog( child: Column( mainAxisSize: MainAxisSize.min, children: [ Image.file(_listaImagens[indice] ), BotaoCustomizado( texto: "Excluir", corTexto: Colors.red, corBotao: Colors.white, elevation: 0, onPressed: (){ setState(() { _listaImagens.removeAt(indice); Navigator.pop(context); }); }, ) ],), ) ); }, child: CircleAvatar( radius: 50, backgroundImage: FileImage(_listaImagens[indice]), child: Container( color: const Color.fromRGBO(255, 255, 255, 0.4), alignment: Alignment.center, child: const Icon( Icons.delete, color: Colors.red,), ), ) ), ); } return Container(); }), ), if( state.hasError ) Text( "[${state.errorText}]", style: const TextStyle( color: Colors.red, fontSize: 16 ), ), ],); }, ), //Menus Dropdown Row( children: [ Expanded( child: Padding( padding: const EdgeInsets.all(8), child: DropdownButtonFormField<String>( value: _itemSelecionadoEstado, hint: const Text("Estados"), onSaved: (estado){ _anuncio?.estado = estado!; }, style: const TextStyle( color: Colors.black, fontSize: 20 ), items: _listaItensDropEstados, validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .valido(valor); }, onChanged: (valor){ setState(() { _itemSelecionadoEstado = valor.toString(); }); }, ), ), ), Expanded( child: Padding( padding: const EdgeInsets.all(8), child: DropdownButtonFormField<String>( value: _itemSelecionadoCategoria, hint: const Text("Categorias"), onSaved: (categoria){ _anuncio?.categoria = categoria!; }, style: const TextStyle( color: Colors.black, fontSize: 20 ), items: _listaItensDropCategorias, validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .valido(valor); }, onChanged: (valor){ setState(() { _itemSelecionadoCategoria = valor.toString(); }); }, ), ), ), ], ), //Caixa de textos e botoes Padding( padding: const EdgeInsets.only(bottom: 15, top: 15), child: InputCustomizado( controllerLog1: null, hint: "Título", label: "Título", onSaved: (titulo){ _anuncio?.titulo = titulo!; }, validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .valido(valor); }), ), Padding( padding: const EdgeInsets.only(bottom: 15), child: InputCustomizado( controllerLog1: null, hint:"Preço", label: "Preço", onSaved: (preco){ _anuncio?.preco = preco!; }, type: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.digitsOnly, CentavosInputFormatter(casasDecimais: 2), ], validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .valido(valor); }), ), Padding( padding: const EdgeInsets.only(bottom: 15), child: InputCustomizado( controllerLog1: null, hint: "Telefone", label: "Telefone", onSaved: (telefone){ _anuncio?.telefone = telefone!; }, type: TextInputType.phone, inputFormatters: [ FilteringTextInputFormatter.digitsOnly, TelefoneInputFormatter(), ], validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .valido(valor); },), ), Padding( padding: const EdgeInsets.only(bottom: 15), child: InputCustomizado( controllerLog1: null, hint: "Descrição (200 caracteres)", label: "Descrição (200 caracteres)", onSaved: (descricao){ _anuncio?.descricao = descricao!; }, maxLines: null, validator: (valor){ return Validador() .add(Validar.OBRIGATORIO, msg: "Campo obrigatóirio") .maxLength(200, msg: "Máximo de 200 caracteres") .valido(valor); },), ), BotaoCustomizado( texto: "Cadastrar anúncio", onPressed: (){ if( _formKey.currentState!.validate() ){ //Salvar Campos _formKey.currentState!.save(); //Configura dialog context _dialogContext = context; //salvar anúncios _salvaAnuncio(); } }, ), ], ), ), ), ), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/views/DetalhesAnuncio.dart
import 'package:flutter/material.dart'; import 'package:olx_app/main.dart'; import 'package:olx_app/models/Anuncio.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'dart:core'; import 'package:oa_fone/oa_fone.dart'; class DetalhesAnuncio extends StatefulWidget { Anuncio anuncio; DetalhesAnuncio(this.anuncio); @override State<DetalhesAnuncio> createState() => _DetalhesAnuncioState(); } class _DetalhesAnuncioState extends State<DetalhesAnuncio> { late Anuncio _anuncio; List<Widget> _getListaImagens (){ List<String> listaUrlImagens = _anuncio.fotos; return listaUrlImagens.map((url) { return Container( height: 250, decoration: BoxDecoration( image: DecorationImage( image: NetworkImage(url), fit: BoxFit.fitWidth, ) ), ); }).toList(); } Future<dynamic> _ligarTelefone( String telefone, BuildContext context) async { ligarPaciente( 'tel:${telefone.toString()}', context); } @override void initState() { super.initState(); _anuncio = widget.anuncio; } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Anuncio"), ), body: Stack(children: [ ListView(children: [ SizedBox( height: 250, child: CarouselSlider( items: _getListaImagens(), options: CarouselOptions( padEnds: true, height: 400, aspectRatio: 16/9, initialPage: 0, enableInfiniteScroll: false, autoPlayCurve: Curves.bounceIn, enlargeCenterPage: true, clipBehavior: Clip.antiAlias, //onPageChanged: callbackFunction, scrollDirection: Axis.horizontal, ) ), ), Container( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "R\$ ${_anuncio.preco}", style: TextStyle( fontSize: 32, fontWeight: FontWeight.bold, color: temaPadrao.primaryColor ),), Text( "${_anuncio.titulo}", style: const TextStyle( fontSize: 25, fontWeight: FontWeight.w400 ),), const Padding( padding: EdgeInsets.symmetric(vertical: 16), child: Divider(), ), const Text( "Descrição", style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold ),), Text( "${_anuncio.descricao}", style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold ),), const Padding( padding: EdgeInsets.symmetric(vertical: 25), child: Divider(), ), const Text( "Contato", style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold ),), Padding( padding: EdgeInsets.only(bottom: 66), child: Text( "${_anuncio.telefone}", style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold ),), ) ],), ) ],), Positioned( left: 16, right: 16, bottom: 38, child: GestureDetector( child: Container( child: const Text( "Ligar", style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, color: Colors.white ), ), padding: EdgeInsets.all(16), alignment: Alignment.center, decoration: BoxDecoration( color: temaPadrao.primaryColor, borderRadius: BorderRadius.circular(30) ), ), onTap: (){ _ligarTelefone( _anuncio.telefone, context); }, ), ) ],), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/views/MeusAnuncios.dart
import 'dart:async'; import 'package:flutter/material.dart'; import 'package:olx_app/models/Anuncio.dart'; import 'package:olx_app/views/widgets/BotaoCustomizado.dart'; import 'package:olx_app/views/widgets/ItemAnuncio.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; class MeusAnuncios extends StatefulWidget { const MeusAnuncios({Key? key}) : super(key: key); @override State<MeusAnuncios> createState() => _MeusAnunciosState(); } class _MeusAnunciosState extends State<MeusAnuncios> { final _controller = StreamController<QuerySnapshot>.broadcast(); dynamic _idUsuarioLogado; Future<dynamic> _recuperarDadosUsuarioLogado() async { FirebaseAuth auth = FirebaseAuth.instance; User? usuarioLogado = await auth.currentUser; _idUsuarioLogado = usuarioLogado!.uid; } Future<Stream<QuerySnapshot<Object?>>?> _adicionarListenerAnuncios() async{ await _recuperarDadosUsuarioLogado(); FirebaseFirestore db = FirebaseFirestore.instance; Stream<QuerySnapshot> stream = db .collection("meus_anuncios") .doc( _idUsuarioLogado ) .collection("anuncios") .snapshots(); stream.listen((dados) { _controller.add( dados ); }); } _removerAnuncio( String idAnuncio ){ FirebaseFirestore db = FirebaseFirestore.instance; db.collection("meus_anuncios") .doc( _idUsuarioLogado ) .collection("anuncios") .doc( idAnuncio) .delete().then((_) { db.collection("anuncios") .doc( idAnuncio) .delete(); }); } @override void initState() { super.initState(); _adicionarListenerAnuncios(); } @override Widget build(BuildContext context) { var carregandoDados = Center( child: Column(children: const [ Text("Carregando anúncios..."), CircularProgressIndicator() ],), ); return Scaffold( appBar: AppBar( title: const Text("Meus anúncios"), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: FloatingActionButton.extended( backgroundColor: Colors.purple, foregroundColor: Colors.white, icon: Icon(Icons.add), label: Text("Adicionar"), onPressed: (){ Navigator.pushNamed(context, "/novo-anuncio"); }, ), body: StreamBuilder( stream: _controller.stream, builder: (context, snapshot){ switch(snapshot.connectionState){ case ConnectionState.none: case ConnectionState.waiting: return carregandoDados; break; case ConnectionState.active: case ConnectionState.done: //Exibir mensagens de erro if( snapshot.hasError) { return const Text("Erro ao carregar os dados!!"); } QuerySnapshot? querySnapshot = snapshot.data as QuerySnapshot<Object?>?; return ListView.builder( itemCount: querySnapshot!.docs.length, itemBuilder: (_, indice){ List<DocumentSnapshot> anuncios = querySnapshot.docs.toList(); DocumentSnapshot documentSnapshot = anuncios[indice]; Anuncio anuncio = Anuncio.fromDocumentSnapshot(documentSnapshot); return ItemAnuncio( anuncio: anuncio, onPressedRemover: (){ showDialog( context: context, builder: (context){ return AlertDialog( title: const Text("Confirmar"), content: const Text("Deseja realmente Excluir o anúncio?"), actions: [ BotaoCustomizado( texto: "Cancelar", corBotao: Colors.white, corTexto: Colors.grey, onPressed: (){ Navigator.of(context).pop(); }, ), BotaoCustomizado( texto: "Remover", corBotao: Colors.red, corTexto: Colors.white, onPressed: (){ _removerAnuncio( anuncio.id); Navigator.of(context).pop(); }, ) ], ); } ); }, ); }, padding: EdgeInsets.only(bottom: 63) ); } } ), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib/views
mirrored_repositories/Simulador_Tipo_OLX/lib/views/widgets/InputCustomizado.dart
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class InputCustomizado extends StatelessWidget { TextEditingController? controllerLog1 = TextEditingController(); TextEditingController? controllerLog2 = TextEditingController(); final String hint = ""; final String label; final bool obscure; final bool autofocus; final TextInputType type; final dynamic maxLines; final List<TextInputFormatter>? inputFormatters; final String? Function(String?)? validator; final String? Function(String?)? onSaved; InputCustomizado({ this.controllerLog1, this.controllerLog2, required hint, this.label = "", this.obscure = false, this.autofocus = false, this.type = TextInputType.text, this.inputFormatters = const [], this.validator, this.maxLines = 1, this.onSaved } ); @override Widget build(BuildContext context) { return TextFormField( controller: controllerLog1, obscureText: this.obscure, autofocus: this.autofocus, keyboardType: this.type, inputFormatters: this.inputFormatters, maxLines: this.maxLines, validator: this.validator, onSaved: this.onSaved, style: const TextStyle( fontSize: 20, fontWeight: FontWeight.normal ), decoration: InputDecoration( contentPadding: EdgeInsets.fromLTRB( 32, 16, 32, 16), hintText: this.hint, labelText: this.label, filled: true, fillColor: Colors.white, border: OutlineInputBorder( borderRadius: BorderRadius.circular(6) ) ), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib/views
mirrored_repositories/Simulador_Tipo_OLX/lib/views/widgets/BotaoCustomizado.dart
import 'package:flutter/material.dart'; class BotaoCustomizado extends StatelessWidget { final dynamic texto; final Color corTexto; final Color corBotao; final Color corShadow; final VoidCallback? onPressed; final double fontSize; final double elevation; BotaoCustomizado({ @required this.texto, this.onPressed, this.corTexto = Colors.white, this.corBotao = Colors.purple, this.corShadow = Colors.white24, this.fontSize = 20, this.elevation = 08 }); @override Widget build(BuildContext context) { return ElevatedButton( onPressed: this.onPressed, child: Text( this.texto, style: TextStyle( color: this.corTexto, fontSize: this.fontSize ), ), style: ElevatedButton.styleFrom( primary: this.corBotao, shadowColor: this.corShadow, elevation: this.elevation, padding: const EdgeInsets.fromLTRB(32, 16, 32, 16), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10) )) ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib/views
mirrored_repositories/Simulador_Tipo_OLX/lib/views/widgets/ItemAnuncio.dart
import 'package:flutter/material.dart'; import 'package:olx_app/models/Anuncio.dart'; class ItemAnuncio extends StatelessWidget { Anuncio? anuncio; VoidCallback? onTapItem; VoidCallback? onPressedRemover; ItemAnuncio( {Key? key, @required this.anuncio, this.onTapItem, this.onPressedRemover }) : super(key: key); @override Widget build(BuildContext context) { return GestureDetector( onTap: onTapItem, child: Card( child: Padding( padding: const EdgeInsets.all(12), child: Row(children: [ SizedBox( width: 120, height: 120, child: Image.network( anuncio!.fotos[0], fit: BoxFit.cover, ), ), Expanded( flex: 3, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( anuncio!.titulo, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold, ), ), Text("R\$ ${anuncio!.preco}"), ],), ), ), if( onPressedRemover != null) Expanded( flex: 1, child: FloatingActionButton( backgroundColor: Colors.red, elevation: 0, mini: true, child: const Icon(Icons.delete, color: Colors.white), onPressed: onPressedRemover, ), ), ], ), ), ), ); } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/models/Anuncio.dart
import 'dart:core'; import 'package:cloud_firestore/cloud_firestore.dart'; class Anuncio{ String? _id; String? _estado; String? _categoria; String? _titulo; String? _preco; String? _telefone; String? _descricao; List<String>? _fotos; Anuncio(); Anuncio.fromDocumentSnapshot( DocumentSnapshot documentSnapshot){ this.id = documentSnapshot.id; this.estado = documentSnapshot["estado"]; this.categoria = documentSnapshot["categoria"]; this.titulo = documentSnapshot["titulo"]; this.preco = documentSnapshot["preco"]; this.telefone = documentSnapshot["telefone"]; this.descricao = documentSnapshot["descricao"]; this.fotos = List<String>.from(documentSnapshot["fotos"]); } Anuncio.gerarId() { FirebaseFirestore db = FirebaseFirestore.instance; CollectionReference anuncios = db.collection("meus_anuncios"); this.id = anuncios.doc().id; this.fotos = []; } toMap (){ Map<String, dynamic> map = { "id" : this.id, "estado" : this.estado, "categoria" : this.categoria, "titulo" : this.titulo, "preco" : this.preco, "telefone" : this.telefone, "descricao" : this.descricao, "fotos" : this.fotos, }; return map; } List<String> get fotos => _fotos!; set fotos(List<String> value) { _fotos = value; } String get descricao => _descricao!; set descricao(String value) { _descricao = value; } String get telefone => _telefone!; set telefone(String value) { _telefone = value; } String get preco => _preco!; set preco(String value) { _preco = value; } String get titulo => _titulo!; set titulo(String value) { _titulo = value; } String get categoria => _categoria!; set categoria(String value) { _categoria = value; } String get estado => _estado!; set estado(String value) { _estado = value; } String get id => _id!; set id(String value) { _id = value; } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/models/Usuario.dart
class Usuario { dynamic _idUsuario; dynamic _nome; dynamic _email; dynamic _senha; Usuario(); toMap(){ Map<String, dynamic> map = { "idUsuario" : this.idUsuario, "nome" : this.email, "email" : this.email, }; return map; } dynamic get senha => _senha; set senha(dynamic value) { _senha = value; } dynamic get email => _email; set email(dynamic value) { _email = value; } dynamic get nome => _nome; set nome(dynamic value) { _nome = value; } dynamic get idUsuario => _idUsuario; set idUsuario(dynamic value) { _idUsuario = value; } }
0
mirrored_repositories/Simulador_Tipo_OLX/lib
mirrored_repositories/Simulador_Tipo_OLX/lib/util/Configuracoes.dart
import 'package:flutter/material.dart'; import 'package:brasil_fields/brasil_fields.dart'; class Configuracoes { List<DropdownMenuItem<String>> getEstados (){ List<DropdownMenuItem<String>> listaItensDropEstados = []; //Regiões listaItensDropEstados.add( const DropdownMenuItem(child:Text( "Região", style: TextStyle( color: Color(0xff9c27b0) ), ), value: null,)); for( var estado in Estados.listaEstadosSigla){ listaItensDropEstados.add( DropdownMenuItem(child: Text(estado), value: estado,) ); } return listaItensDropEstados; } List<DropdownMenuItem<String>> getCategorias (){ List<DropdownMenuItem<String>> itensDropCategorias = []; //Categorias /* OBS: (Melhor iserir as categorias direto no firebase caso precise modificar um campo ou inserir outro, não precisa republicar o APP desta forma só atualizar o Firebase e não tem que publicar uma nova versão do APP só para isso) */ itensDropCategorias.add( const DropdownMenuItem(child:Text( "Categoria", style: TextStyle( color: Color(0xff9c27b0) ), ), value: null,)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Automóvel"), value: "auto",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Imóvel"), value: "imovel",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Móveis"), value: "movel",)); itensDropCategorias.add( const DropdownMenuItem(child: Text("Eletrônicos"), value: "eletro",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Moda"), value: "moda",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Esportes"), value: "esportes",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Aluguel"), value: "aluguel",)); itensDropCategorias.add( const DropdownMenuItem(child:Text("Negócios"), value: "negocios",)); return itensDropCategorias; } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/payment_page.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:grocery_app/constants/color_list.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'dart:math' as math; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:form_field_validator/form_field_validator.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:mpesa_flutter_plugin/mpesa_flutter_plugin.dart'; class PaymentPage extends StatefulWidget { @override _PaymentPageState createState() => _PaymentPageState(); } class _PaymentPageState extends State<PaymentPage> { final requiredValidator = RequiredValidator(errorText: 'This field is required'); final formkey = GlobalKey<FormState>(); late String _amount; Color active = Colors.red; TextEditingController cardNumber = TextEditingController(); TextEditingController year = TextEditingController(); TextEditingController month = TextEditingController(); TextEditingController cvc = TextEditingController(); TextEditingController cardHolder = TextEditingController(); ScrollController scrollController = ScrollController(); User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); bool isLoading = true; @override void initState() { super.initState(); scrollController.addListener(() { if (scrollController.position.userScrollDirection.index == 1) { FocusScope.of(context).requestFocus(FocusNode()); } }); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if(loggedInUser.email != null){ setState(() { isLoading = false; }); } }); } String convertCardNumber(String src, String divider) { String newStr = ''; int step = 4; for (int i = 0; i < src.length; i += step) { newStr += src.substring(i, math.min(i + step, src.length)); if (i + step < src.length) newStr += divider; } return newStr; } String convertMonthYear(String month, String year) { if (month.isNotEmpty) return month + '/' + year; else return ''; } checkFields() { final form = formkey.currentState; if (form!.validate()) { form.save(); return true; } return false; } Future<dynamic> startTransaction() async { if (checkFields()) { Fluttertoast.showToast(msg: "${loggedInUser.phone}"); Fluttertoast.showToast(msg: "${_amount}"); dynamic transactionInitialization; //Wrap it with a try-catch try { //Run it transactionInitialization = await MpesaFlutterPlugin.initializeMpesaSTKPush( businessShortCode: "174379", //use your store number if the transaction type is CustomerBuyGoodsOnline transactionType: TransactionType .CustomerPayBillOnline, //or CustomerBuyGoodsOnline for till numbers amount: 1.0, partyA: "${loggedInUser.phone}", partyB: "174379", callBackURL: Uri( scheme: "https", host: "1234.1234.co.ke", path: "/1234.php"), accountReference: "DAV_EE", phoneNumber: "${loggedInUser.phone}", baseUri: Uri(scheme: "https", host: "sandbox.safaricom.co.ke"), transactionDesc: "MIRAALINK 254", passKey: "bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919"); var result = transactionInitialization as Map<String, dynamic>; if (result.keys.contains("ResponseCode")) { String mResponseCode = result["ResponseCode"]; print("Resulting Code: " + mResponseCode); // if (mResponseCode == '0') { // updateAccount(result["CheckoutRequestID"]); // } } print("RESULT: " + transactionInitialization.toString()); } catch (e) { //you can implement your exception handling here. //Network Reachability is a sure exception. print("Err"); print("Exception Caught: " + e.toString()); } } } @override Widget build(BuildContext context) { TextEditingController phone = TextEditingController()..text = "${loggedInUser.phone}"; Widget addThisCard = InkWell( onTap: () { MpesaFlutterPlugin.setConsumerKey('2guyy9F7n0qxFGcx3yx7qriOy6a0fzhP'); MpesaFlutterPlugin.setConsumerSecret('CUimti3is5ZXwHft'); startTransaction(); }, child: Container( height: 80, width: MediaQuery.of(context).size.width / 1.5, decoration: BoxDecoration( gradient: mainButton, boxShadow: [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.16), offset: Offset(0, 5), blurRadius: 10.0, ) ], borderRadius: BorderRadius.circular(9.0)), child: Center( child: Text("DEPOSIT FUNDS", style: const TextStyle( color: const Color(0xfffefefe), fontWeight: FontWeight.w600, fontStyle: FontStyle.normal, fontSize: 20.0)), ), ), ); return Scaffold( backgroundColor: Colors.white, body: LayoutBuilder( builder: (_, constraints) => GestureDetector( onPanDown: (val) {}, behavior: HitTestBehavior.opaque, child: (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) :SingleChildScrollView( controller: scrollController, child: ConstrainedBox( constraints: BoxConstraints( minHeight: constraints.maxHeight, ), child: Container( margin: const EdgeInsets.only(top: kToolbarHeight), padding: EdgeInsets.symmetric(horizontal: 16.0), child: Column( children: <Widget>[ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text( 'MY E-WALLET', style: TextStyle( color: darkGrey, fontSize: 22, fontWeight: FontWeight.bold, ), ), CloseButton() ], ), Container( height: 200, width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(32.0), decoration: BoxDecoration( color: active, borderRadius: BorderRadius.all(Radius.circular(10))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text( 'M-PESA GATEWAY', style: TextStyle(color: Colors.white), ), SizedBox(height: 16.0), Text( 'AVAILABLE FUNDS : KES 20,003', style: TextStyle(color: Colors.white), ), Row( children: <Widget>[ Container( height: 5, width: 150, color: Colors.yellow, ), Flexible( child: Center( child: Text( convertCardNumber( cardNumber.text, '-'), style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 18.0)))), ], ), Spacer(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text(convertMonthYear(month.text, year.text), style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold)), Text(cvc.text, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold)) ], ), Spacer(), Text(cardHolder.text, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 18.0)) ], ), ), Padding( padding: const EdgeInsets.all(16.0), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Colors.red, Colors.blue, Colors.purple[700], Colors.green[700], Colors.lightBlueAccent ] .map((c) => InkWell( onTap: () { setState(() { active = c ?? Colors.red; }); }, child: Transform.scale( child: Padding( padding: const EdgeInsets.all(8.0), child: ColorOption(c ?? Colors.red), ), scale: active == c ? 1.2 : 1), )) .toList(), ), ), Container( padding: EdgeInsets.all(16.0), height: 250, width: MediaQuery.of(context).size.width, decoration: BoxDecoration( color: Colors.white, boxShadow: shadow, borderRadius: BorderRadius.only( bottomRight: Radius.circular(10), bottomLeft: Radius.circular(10))), child: Form( key: formkey, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ Container( padding: EdgeInsets.only(left: 16.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.grey[200], ), child: TextField( controller: phone, onChanged: (val) { }, decoration: InputDecoration( border: InputBorder.none, hintText: 'Mobile Number'), ), ), Row( children: <Widget>[ Flexible( child: Container( padding: EdgeInsets.only(left: 16.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.grey[200], ), child: TextFormField( decoration: InputDecoration( border: InputBorder.none, hintText: 'Amount'), validator: requiredValidator, onChanged: (val) => _amount = val, ), ), ), SizedBox( width: 8.0, ), ], ), ], ), ), ), SizedBox(height: 24.0), Center( child: Padding( padding: EdgeInsets.only(bottom: 20), child: addThisCard, )) ], ), ), ), ), ), ), ); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/profile.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:grocery_app/faq_page.dart'; import 'package:grocery_app/payment_page.dart'; import 'package:grocery_app/OrderHistoryPage.dart'; import 'package:flutter/material.dart'; import 'package:grocery_app/settings/settings_page.dart'; import 'package:grocery_app/settings/legal_about_page.dart'; import 'package:grocery_app/settings/support.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:avatars/avatars.dart'; class ProfilePage extends StatefulWidget { const ProfilePage({Key? key}) : super(key: key); @override State<ProfilePage> createState() => _ProfilePageState(); } class _ProfilePageState extends State<ProfilePage> { User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); bool isLoading = true; @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if(loggedInUser.email != null){ setState(() { isLoading = false; }); } }); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Color(0xffF9F9F9), body: SafeArea( top: true, child: (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) :SingleChildScrollView( child: Padding( padding: EdgeInsets.only(left: 16.0, right: 16.0, top: kToolbarHeight), child: Column( children: <Widget>[ // CircleAvatar( // maxRadius: 48, // backgroundImage: AssetImage('assets/background.jpg'), // ), Avatar( elevation: 3, shape: AvatarShape.rectangle( 100, 100, BorderRadius.all(new Radius.circular(20.0))), name: '${loggedInUser.name}', // Uses name initials (up to two) ), Padding( padding: const EdgeInsets.all(8.0), child: Text( '${loggedInUser.name}', style: TextStyle(fontWeight: FontWeight.bold), ), ), Container( margin: EdgeInsets.symmetric(vertical: 16.0), decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(8), topRight: Radius.circular(8), bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8)), color: Colors.white, boxShadow: [ BoxShadow( color: transparentYellow, blurRadius: 4, spreadRadius: 1, offset: Offset(0, 1)) ]), height: 150, child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ // Column( // mainAxisAlignment: MainAxisAlignment.center, // children: <Widget>[ // IconButton( // icon: Image.asset('assets/icons/wallet.png'), // onPressed:() {} // ), // Text( // 'Wallet', // style: TextStyle(fontWeight: FontWeight.bold), // ) // ], // ), Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ IconButton( icon: Image.asset('assets/icons/truck.png'), onPressed: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => TrackingPage())), ), Text( 'Shipped', style: TextStyle(fontWeight: FontWeight.bold), ) ], ), Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ IconButton( icon: Image.asset('assets/icons/card.png'), onPressed:()=> Navigator.of(context).push( MaterialPageRoute( builder: (_) => PaymentPage())), ), Text( 'E-Wallet', style: TextStyle(fontWeight: FontWeight.bold), ) ], ), Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ IconButton( icon: Image.asset('assets/icons/contact_us.png'), onPressed:()=> Navigator.of(context).push( MaterialPageRoute( builder: (_) => SupportPage())), ), Text( 'Support', style: TextStyle(fontWeight: FontWeight.bold), ) ], ), ], ), ), ), ListTile( title: Text('Settings'), subtitle: Text('Privacy and logout'), leading: Image.asset('assets/icons/settings_icon.png', fit: BoxFit.scaleDown, width: 30, height: 30,), trailing: Icon(Icons.chevron_right, color: yellow), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => SettingsPage())), ), Divider(), ListTile( title: Text('Help & Support'), subtitle: Text('Help center and legal support'), leading: Image.asset('assets/icons/support.png'), trailing: Icon( Icons.chevron_right, color: yellow, ), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => LegalAboutPage())), ), Divider(), ListTile( title: Text('FAQ'), subtitle: Text('Questions and Answer'), leading: Image.asset('assets/icons/faq.png'), trailing: Icon(Icons.chevron_right, color: yellow), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => FaqPage())), ), Divider(), ], ), ), ), ), ); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer6.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer6 extends StatefulWidget { const Farmer6({Key? key}) : super(key: key); @override State<Farmer6> createState() => _Farmer6State(); } class _Farmer6State extends State<Farmer6> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "CAROO FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 10 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT CAROO FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer6", "CAROO FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 736 636 ", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 736 636", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: CAROOVEVE@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer6.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776736636"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/LoginPage.dart
import 'package:flutter/material.dart'; import 'package:form_field_validator/form_field_validator.dart'; import 'package:grocery_app/HomePage.dart'; import 'package:grocery_app/RegisterPage.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/ResetPassword.dart'; import 'package:grocery_app/confirm_otp.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'dart:ui'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:grocery_app/constants/argon_theme.dart'; //widgets import 'package:grocery_app/widgets/argon_input.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class LoginRegisterPage extends StatefulWidget { //const LoginRegisterPage({Key? key}) : super(key: key); @override _LoginRegisterPageState createState() => _LoginRegisterPageState(); } //Enum FormType{ login, register}; class _LoginRegisterPageState extends State<LoginRegisterPage> { User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); @override void initState() { super.initState(); if(user != null){ FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); if (loggedInUser.phone != null) { Navigator.push(context, MaterialPageRoute(builder: (context) => StartUpPage( ))); } }); } } late String _email; late String _password; final formkey = GlobalKey<FormState>(); final emailValidator = MultiValidator([ RequiredValidator(errorText: 'Email is required'), EmailValidator(errorText: 'Enter a valid email address') ]); final requiredValidator = RequiredValidator(errorText: 'This field is required'); final passwordValidator = MultiValidator([ RequiredValidator(errorText: 'Password is required'), MinLengthValidator(8, errorText: 'Password must be at least 8 digits long'), PatternValidator(r'(?=.*?[#?!@$%^&*-])', errorText: 'Passwords must have at least one special character i.e /*&%%(') ]); checkFields() { final form = formkey.currentState; if (form!.validate()) { form.save(); return true; } return false; } loginUser() { if (checkFields()) { Fluttertoast.showToast(msg: "${_email}"); Fluttertoast.showToast(msg: "${_password}"); Fluttertoast.showToast(msg: "AUTHENTICATION TAKING PLACE....."); FirebaseAuth.instance .signInWithEmailAndPassword(email: _email, password: _password) .then((uid) { Fluttertoast.showToast( msg: "Login successfull ${_email}", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0); Navigator.pop(context); // Navigator.push(context, // MaterialPageRoute(builder: (context) => StartUpPage( // ))); Navigator.push( context, MaterialPageRoute(builder: (context) => ConfirmOTP())); }).catchError((e) { Fluttertoast.showToast( msg: e!.message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0); }); } } @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/register-bg.png"), fit: BoxFit.cover)), ), SafeArea( child: ListView(children: [ Padding( padding: const EdgeInsets.only( top: 16, left: 24.0, right: 24.0, bottom: 32), child: Card( elevation: 5, clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Column( children: [ Container( height: MediaQuery.of(context).size.height * 0.15, decoration: BoxDecoration( color: ArgonColors.white, border: Border( bottom: BorderSide( width: 0.5, color: ArgonColors.muted))), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Center( child: Padding( padding: const EdgeInsets.only(top: 8.0), child: Text("Login with", style: TextStyle( color: ArgonColors.text, fontSize: 16.0)), )), Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( // width: 0, height: 36, child: RaisedButton( textColor: ArgonColors.primary, color: ArgonColors.secondary, onPressed: () {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4)), child: Padding( padding: EdgeInsets.only( bottom: 10, top: 10, left: 14, right: 14), child: Row( mainAxisAlignment: MainAxisAlignment .spaceAround, children: [ Icon(FontAwesomeIcons.github, size: 13), SizedBox( width: 5, ), Text("GITHUB", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 13)) ], ))), ), Container( // width: 0, height: 36, child: RaisedButton( textColor: ArgonColors.primary, color: ArgonColors.secondary, onPressed: () {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4)), child: Padding( padding: EdgeInsets.only( bottom: 10, top: 10, left: 8, right: 8), child: Row( mainAxisAlignment: MainAxisAlignment .spaceAround, children: [ Icon( FontAwesomeIcons.facebook, size: 13), SizedBox( width: 5, ), Text("FACEBOOK", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 13)) ], ))), ), ], ), ), // Divider() ], )), Container( height: MediaQuery.of(context).size.height * 0.63, color: Color.fromRGBO(244, 245, 247, 1), child: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Form( key: formkey, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( initialValue: 'DAVIES.LANGATT@GMAIL.COM', cursorColor: ArgonColors.muted, autofocus: false, validator: emailValidator, onChanged: (val) => _email = val, style: TextStyle( height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.email), prefixIcon: Icon(Icons.email), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular( 4.0), borderSide: BorderSide( color: ArgonColors .border, width: 1.0, style: BorderStyle .solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular( 4.0), borderSide: BorderSide( color: ArgonColors .border, width: 1.0, style: BorderStyle .solid)), hintText: "Enter email address")), ), ), Padding( padding: const EdgeInsets.all(8.0), child: Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( initialValue: 'DAVIES.LANGATT@GMAIL.COM', obscureText: true, cursorColor: ArgonColors.muted, autofocus: false, validator: passwordValidator, onChanged: (val) => _password = val, style: TextStyle( height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.password), prefixIcon: Icon(Icons.lock), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular( 4.0), borderSide: BorderSide( color: ArgonColors .border, width: 1.0, style: BorderStyle .solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular( 4.0), borderSide: BorderSide( color: ArgonColors .border, width: 1.0, style: BorderStyle .solid)), hintText: "Enter password")), ), ), Padding( padding: const EdgeInsets.only(top: 10), child: Center( child: FlatButton( textColor: ArgonColors.white, color: ArgonColors.primary, onPressed: () { loginUser(); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Padding( padding: EdgeInsets.only( left: 16.0, right: 16.0, top: 12, bottom: 12), child: Text("LOGIN", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16.0))), ), ), ), ], ), ), Padding( padding: const EdgeInsets.only( left: 8.0, top: 0, bottom: 10), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ // Checkbox( // activeColor: // ArgonColors.primary, // onChanged: onChanged(), value: , // ), Text("Don\'t have an account?", style: TextStyle( color: ArgonColors.muted, fontWeight: FontWeight.w200)), GestureDetector( onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => RegisterPage())); }, child: Container( margin: EdgeInsets.only(left: 5), child: Text("REGISTER NOW", style: TextStyle( color: ArgonColors.primary)), )), ], ), ), Padding( padding: const EdgeInsets.only( left: 8.0, top: 0, bottom: 16), child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ // Checkbox( // activeColor: // ArgonColors.primary, // onChanged: onChanged(), value: , // ), Text("Forgot your password?", style: TextStyle( color: ArgonColors.muted, fontWeight: FontWeight.w200)), GestureDetector( onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ResetPassword())); }, child: Container( margin: EdgeInsets.only(left: 5), child: Text("RESET NOW", style: TextStyle( color: ArgonColors.primary)), )), ], ), ), ], ), ), )) ], )), ), ]), ) ], )); } tap() {} controller() {} }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer2.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer2 extends StatefulWidget { const Farmer2({Key? key}) : super(key: key); @override State<Farmer2> createState() => _Farmer2State(); } class _Farmer2State extends State<Farmer2> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "ALEX MUSIO FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 10 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Verified vendor.", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT ALEX MUSIO FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer2", "ALEX MUSIO FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254733 736 933", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254733 736 933", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: ALEXMUSIO@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer2.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery countrywide.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available from 8:00AM - 10:00 PM", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality Miraa, delivered in less than 24 hrs.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "4. LOCATION: Laare - MERU COUNTY", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ) ], ), ), ], ); } void openCartPage() { launch("tel://254733736933"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer4.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer4 extends StatefulWidget { const Farmer4({Key? key}) : super(key: key); @override State<Farmer4> createState() => _Farmer4State(); } class _Farmer4State extends State<Farmer4> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "ANDREW AND SONS FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 100 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Verified vendor.", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT ANDREW AND SONS FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer1", "ANDREW AND SONS FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254778 367 373", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254778 367 373", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: ANDREWANDSONS@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer4.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality goods, delivered in less than 24 hrs.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "4. FREE LOADING AND OFFLOADING.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "5. LOCATION: Tigania - MERU COUNTY.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254778367373"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/RegisterPage.dart
import 'package:flutter/material.dart'; import 'package:form_field_validator/form_field_validator.dart'; import 'package:grocery_app/HomePage.dart'; import 'package:grocery_app/LoginPage.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'dart:ui'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:grocery_app/constants/argon_theme.dart'; //widgets import 'package:grocery_app/widgets/argon_input.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:grocery_app/HomePage.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:grocery_app/models/farmermodel.dart'; import 'package:grocery_app/confirm_otp.dart'; class RegisterPage extends StatefulWidget { const RegisterPage({Key? key}) : super(key: key); @override _RegisterPageState createState() => _RegisterPageState(); } //Enum FormType{ login, register}; class _RegisterPageState extends State<RegisterPage> { late String _email; late String _password; late String _name; late String _phone; final formkey = GlobalKey<FormState>(); final emailValidator = MultiValidator([ RequiredValidator(errorText: 'Email is required'), EmailValidator(errorText: 'Enter a valid email address') ]); final requiredValidator = RequiredValidator(errorText: 'This field is required'); final passwordValidator = MultiValidator([ RequiredValidator(errorText: 'Password is required'), MinLengthValidator(8, errorText: 'Password must be at least 8 digits long'), PatternValidator(r'(?=.*?[#?!@$%^&*-])', errorText: 'Passwords must have at least one special character i.e /*&%%(') ]); checkFields() { final form = formkey.currentState; if (form!.validate()) { form.save(); return true; } return false; } RegisterUser(){ if(checkFields()){ LinearProgressIndicator(); Fluttertoast.showToast(msg: "${_email}"); Fluttertoast.showToast(msg: "${_password}"); Fluttertoast.showToast(msg: "${_phone}"); Fluttertoast.showToast(msg: "${_name}"); Fluttertoast.showToast(msg: "AUTHENTICATION TAKING PLACE....."); // do this User? user = FirebaseAuth.instance.currentUser; FirebaseAuth.instance.createUserWithEmailAndPassword(email: _email, password: _password) .then((uid) => { postValuesToFirestore()} ).catchError((e){ Fluttertoast.showToast( msg: e!.message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0); }); } } postValuesToFirestore() async { // calling our firestore // calling our user model // sending these values FirebaseFirestore firebaseFirestore = FirebaseFirestore.instance; User? user = FirebaseAuth.instance.currentUser; UserModel userModel = UserModel(); // writing all the values to user db userModel.phone = _phone; userModel.email = _email; userModel.uid = user?.uid; userModel.name = _name; await firebaseFirestore.collection("users").doc(user?.uid).set( userModel.toMap(), ); //writing data to farmers db // FarmerModel farmerModel = FarmerModel(); // farmerModel.uid = user?.uid; // farmerModel.name = _name; // farmerModel.phone = _phone; // await firebaseFirestore.collection("farmers").doc(user?.uid).set( // farmerModel.toMap(), // ); Fluttertoast.showToast(msg: "Account created successfully :) "); Navigator.pop(context); Navigator.push(context, MaterialPageRoute(builder: (context) => ConfirmOTP())); } // postValuesToFirestore(){ // CollectionReference _firebaseFirestore = FirebaseFirestore.instance.collection('users'); // _firebaseFirestore.add({'email': _email , 'password': _password, 'phone': _phone, // 'name': _name }).whenComplete(() { // }).catchError((e){ // Fluttertoast.showToast( // msg: e!.message, // toastLength: Toast.LENGTH_SHORT, // gravity: ToastGravity.CENTER_LEFT, // timeInSecForIosWeb: 4, // backgroundColor: Colors.red, // textColor: Colors.white, // fontSize: 16.0); // }); // Fluttertoast.showToast(msg: "User data registered successfully ${_name}", // toastLength: Toast.LENGTH_SHORT, // gravity: ToastGravity.CENTER_LEFT, // timeInSecForIosWeb: 4, // backgroundColor: Colors.red, // textColor: Colors.white, // fontSize: 16.0 // ); // Navigator.push(context, // MaterialPageRoute(builder: (context) => HomePage())); // // } @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/register-bg.png"), fit: BoxFit.cover)), ), SafeArea( child: ListView(children: [ Padding( padding: const EdgeInsets.only( top: 16, left: 24.0, right: 24.0, bottom: 32), child: Card( elevation: 5, clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Column( children: [ Container( height: MediaQuery.of(context).size.height * 0.15, decoration: BoxDecoration( color: ArgonColors.white, border: Border( bottom: BorderSide( width: 0.5, color: ArgonColors.muted))), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Center( child: Padding( padding: const EdgeInsets.only(top: 8.0), child: Text("Sign up with", style: TextStyle( color: ArgonColors.text, fontSize: 16.0)), )), Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( // width: 0, height: 36, child: ElevatedButton( onPressed: null, child: Padding( padding: EdgeInsets.only( bottom: 10, top: 10, left: 14, right: 14), child: Row( mainAxisAlignment: MainAxisAlignment .spaceAround, children: [ Icon( FontAwesomeIcons .google, size: 13), SizedBox( width: 5, ), Text("GOOGLE", style: TextStyle( fontWeight: FontWeight .w600, fontSize: 13)) ], ))), ), Container( // width: 0, height: 36, child: RaisedButton( textColor: ArgonColors.primary, color: ArgonColors.secondary, onPressed: () {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4)), child: Padding( padding: EdgeInsets.only( bottom: 10, top: 10, left: 8, right: 8), child: Row( mainAxisAlignment: MainAxisAlignment .spaceAround, children: [ Icon( FontAwesomeIcons .facebook, size: 13), SizedBox( width: 5, ), Text("FACEBOOK", style: TextStyle( fontWeight: FontWeight .w600, fontSize: 13)) ], ))), ), ], ), ), // Divider() ], )), Container( height: MediaQuery.of(context).size.height * 0.83, color: Color.fromRGBO(244, 245, 247, 1), child: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Form( key: formkey, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( cursorColor: ArgonColors.muted, autofocus: false, validator: requiredValidator, onChanged: (val) => _name = val, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.person), prefixIcon: Icon(Icons.contact_mail_sharp), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), hintText: "Enter Full Name")), ), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( cursorColor: ArgonColors.muted, autofocus: false, validator: requiredValidator, onChanged: (val) => _phone = val, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.phone), prefixIcon: Icon(Icons.phone), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), hintText: "Enter phone number")), ), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( cursorColor: ArgonColors.muted, autofocus: false, validator: emailValidator, onChanged: (val) => _email = val, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.email), prefixIcon: Icon(Icons.email), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), hintText: "Enter email address")), ), Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( cursorColor: ArgonColors.muted, autofocus: false, validator: passwordValidator, onChanged: (val) => _password = val, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.password), prefixIcon: Icon(Icons.lock), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), hintText: "Enter password")) ), Padding( padding: const EdgeInsets.only( left: 24.0), child: RichText( text: TextSpan( text: "password should be more than 4 characters long: ", style: TextStyle( color: ArgonColors.muted), children: [ TextSpan( text: "strong", style: TextStyle( fontWeight: FontWeight.w600, color: ArgonColors .success)) ])), ), Padding( padding: const EdgeInsets.only(top: 10), child: Center( child: FlatButton( textColor: ArgonColors.white, color: ArgonColors.primary, onPressed: () { RegisterUser(); // Navigator.push(context, // MaterialPageRoute(builder: (context) => StartUpPage())); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Padding( padding: EdgeInsets.only( left: 16.0, right: 16.0, top: 12, bottom: 12), child: Text("REGISTER NOW", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16.0))), ), ), ) ], ), ), Padding( padding: const EdgeInsets.only( left: 8.0, top: 0, bottom: 16), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ // Checkbox( // activeColor: // ArgonColors.primary, // onChanged: onChanged(), value: , // ), Text("Already have an account? ", style: TextStyle( color: ArgonColors.muted, fontWeight: FontWeight.w200)), GestureDetector( onTap: () { Navigator.pop(context); Navigator.push(context, MaterialPageRoute(builder: (context) =>LoginRegisterPage())); } , child: Container( margin: EdgeInsets.only(left: 5), child: Text("LOGIN NOW", style: TextStyle( color: ArgonColors .primary)), )), ], ), ), //removed reg btn here ], ), ), )) ], )), ), ]), ) ], )); } controller() {} tap() {} }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/OrderHistoryPage.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; class TrackingPage extends StatefulWidget { @override _TrackingPageState createState() => _TrackingPageState(); } class _TrackingPageState extends State<TrackingPage> { final List<Location> locations = [ Location('Meru Depot Facility', DateTime(2022, 3, 18, 5, 23, 4), showHour: false, isHere: false, passed: true), Location('Ambigo ~ Embu Facility', DateTime(2022, 3, 18, 5, 23, 4), showHour: false, isHere: false, passed: true), Location( 'Nairobi Depot', DateTime(2022, 3, 19, 5, 23, 4), showHour: false, isHere: true, ), Location( 'Isiolo ~ Buyer\'s Warehouse', DateTime(2022, 3, 19, 5, 23, 4), showHour: true, isHere: false, ), ]; String selectedProduct = 'Miraa Graded'; @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( color: Colors.grey[100], image: DecorationImage( image: AssetImage('assets/road.png'), fit: BoxFit.contain)), child: Container( color: Colors.white54, child: Scaffold( appBar: AppBar( backgroundColor: Colors.transparent, elevation: 0.0, brightness: Brightness.light, iconTheme: IconThemeData(color: Colors.grey), title: Text( 'Product under Shipment', style: TextStyle( color: darkGrey, fontSize: 22, fontWeight: FontWeight.bold, ), ), leading: SizedBox(), actions: <Widget>[CloseButton()], ), body: SafeArea( child: LayoutBuilder( builder: (_, constraints) => Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ Container( margin: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))), child: DropdownButtonHideUnderline( child: DropdownButton( items: <String>[ 'Miraa Graded', 'Miraa Grade 2 bags', 'Miraa Rejects', ].map((val) { return DropdownMenuItem<String>( value: val, child: Container( color: Colors.white, child: Align( alignment: Alignment.centerLeft, child: Text( val, maxLines: 2, semanticsLabel: '...', overflow: TextOverflow.ellipsis, ))), ); }).toList(), onChanged: (newValue) { setState(() { selectedProduct = newValue as String; }); }, value: selectedProduct, isExpanded: true, icon: Icon(Icons.keyboard_arrow_down), elevation: 0, ), ), ), SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints( maxHeight: constraints.maxHeight - 48, ), child: Theme( data: ThemeData( primaryColor: yellow, fontFamily: 'Montserrat'), child: Stepper( // physics: NeverScrollableScrollPhysics(), steps: [ ...locations .map( (location) => Step( isActive: location.isHere || location.passed, title: Text(location.city), subtitle: Text(location.getDate()), content: Align( child: Image.asset( 'assets/truck.png'), alignment: Alignment.centerLeft, ), state: location.passed ? StepState.complete : location.isHere ? StepState.editing : StepState.indexed, ), ) .toList() ], currentStep: locations.indexOf( locations.firstWhere((loc) => loc.isHere)), ), ), ), ), ], ), ), )), ), ); } } class Location { String city; DateTime date; bool showHour; bool isHere; bool passed; Location(this.city, this.date, {this.showHour = false, this.isHere = false, this.passed = false}); String getDate() { if (showHour) { return DateFormat("K:mm aaa, d MMMM y").format(date); } else { return DateFormat('d MMMM y').format(date); } } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer3.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer3 extends StatefulWidget { const Farmer3({Key? key}) : super(key: key); @override State<Farmer3> createState() => _Farmer3State(); } class _Farmer3State extends State<Farmer3> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "FARM DELTA", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 100 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Verified vendor.", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT FARM DELTA", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer3", "FARM DELTA"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 2547 25 363 773", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 2547 25 363 773", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: DELTAKHAT@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer3.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services country wide(inluded in cost).", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality goods, delivered in less than 24 hrs.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality inspections before and after delivery.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "4. Insurance cover(Accidents).", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "5. LOCATION: Igembe - MERU COUNTY.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ) ], ), ), ], ); } void openCartPage() { launch("tel://254725363773 "); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer12.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer12 extends StatefulWidget { const Farmer12({Key? key}) : super(key: key); @override State<Farmer12> createState() => _Farmer12State(); } class _Farmer12State extends State<Farmer12> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "GABU FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 50 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT GABU FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer12", "GABU FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 731 212 ", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 731 212", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: GABU@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer12.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776731212"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/ProductInfo.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class HotelPage extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData(fontFamily: "mont"), home: hotelPage(), ); } } class hotelPage extends StatefulWidget { @override _hotelPageState createState() => _hotelPageState(); } class _hotelPageState extends State<hotelPage> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "KANYE FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 20 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Verified vendor.", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT KANYE FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer1", "KANYE FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254745682815", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254745682815", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: VEVE55@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: GestureDetector( onTap: () => launch("tel://254745682815"), child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700, ), ) ], ), ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage(image: AssetImage("assets/imgs/$img.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality goods, delivered in less than 24 hrs.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ) ], ), ), ], ); } void openCartPage() { launch("tel://254745682815"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer11.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer11 extends StatefulWidget { const Farmer11({Key? key}) : super(key: key); @override State<Farmer11> createState() => _Farmer11State(); } class _Farmer11State extends State<Farmer11> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "HOMEHALLOW FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 80 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT HOMEHALLOW FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer9", "HOMEHALLOW FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 731 111 ", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 731 111", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: HOMEHALLOW@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer11.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776731111"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer7.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer7 extends StatefulWidget { const Farmer7({Key? key}) : super(key: key); @override State<Farmer7> createState() => _Farmer7State(); } class _Farmer7State extends State<Farmer7> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "KIFEE FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 10 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT KIFEE FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer7", "KIFEE FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 736 888", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 736 888", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: KIFEE@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer7.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776736888"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer10.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer10 extends StatefulWidget { const Farmer10({Key? key}) : super(key: key); @override State<Farmer10> createState() => _Farmer10State(); } class _Farmer10State extends State<Farmer10> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "ISAKA FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 19 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT ISAKA FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer10", "ISAKA FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 736 000 ", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 736 000", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: ISAKA@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer10.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776736000"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/StartUpPage.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/HomePage.dart'; import 'OrderHistoryPage.dart'; import 'profile.dart'; import 'package:grocery_app/settings/settings_page.dart'; import 'package:grocery_app/address/add_address_page.dart'; class StartUpPage extends StatefulWidget { // const StartUpPage({Key? key}) : super(key: key); @override _StartUpPageState createState() => _StartUpPageState(); } class _StartUpPageState extends State<StartUpPage> { int _currentIndex = 0; final List<Widget> _children = [ HomePage(), ProfilePage(), TrackingPage(), AddAddressPage(), SettingsPage() ]; int _selectedIndex = 0; static List<Widget> _widgetOptions = <Widget>[ HomePage(), TrackingPage(), AddAddressPage(), ProfilePage(), SettingsPage() ]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( // body: _children[_currentIndex], body: Center( child: _widgetOptions.elementAt(_selectedIndex), ), backgroundColor: Colors.white, bottomNavigationBar: BottomNavigationBar( backgroundColor: Colors.white, showUnselectedLabels: true, unselectedItemColor: Colors.black, selectedItemColor: Colors.orangeAccent, items: const <BottomNavigationBarItem>[ BottomNavigationBarItem( icon: Icon(Icons.home), label: 'Home', ), BottomNavigationBarItem( icon: Icon(Icons.list), label: 'Orders', ), BottomNavigationBarItem( icon: Icon(Icons.newspaper_outlined), label: 'Address', ), BottomNavigationBarItem( icon: Icon(Icons.person), label: 'Profile', ), BottomNavigationBarItem( icon: Icon(Icons.settings), label: 'Settings', ), ], currentIndex: _selectedIndex, onTap: _onItemTapped, ), ); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/HomePage.dart
import 'package:flutter/material.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:carousel_pro/carousel_pro.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:grocery_app/ProductInfo.dart'; import 'package:grocery_app/farmer2.dart'; import 'package:grocery_app/farmer3.dart'; import 'package:grocery_app/farmer4.dart'; import 'package:grocery_app/farmer5.dart'; import 'package:grocery_app/farmer6.dart'; import 'package:grocery_app/farmer7.dart'; import 'package:grocery_app/farmer8.dart'; import 'package:grocery_app/farmer9.dart'; import 'package:grocery_app/farmer10.dart'; import 'package:grocery_app/farmer11.dart'; import 'package:grocery_app/farmer12.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:grocery_app/models/farmermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class HomePage extends StatefulWidget { const HomePage({Key? key}) : super(key: key); @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { CollectionReference _collectionRef = FirebaseFirestore.instance.collection('farmers'); UserModel loggedInUser = UserModel(); FarmerModel getFarmer = FarmerModel(); bool isLoading = true; User? user = FirebaseAuth.instance.currentUser; @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if (loggedInUser.email != null) { setState(() { isLoading = false; }); } }); } List<String> suggestions = [ "Miraa", "Khat", "Veve", "Muguka", "Jaba", ]; List<String> added = []; String currentText = ""; GlobalKey<AutoCompleteTextFieldState<String>> key = new GlobalKey(); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) : NestedScrollView( headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { return <Widget>[ SliverAppBar( automaticallyImplyLeading: false, title: Container( margin: EdgeInsets.symmetric(horizontal: 10, vertical: 7), decoration: BoxDecoration( color: Colors.orangeAccent, borderRadius: BorderRadius.all(Radius.circular(22))), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Expanded( flex: 1, child: Container( padding: EdgeInsets.only(left: 20), child: SimpleAutoCompleteTextField( key: key, decoration: new InputDecoration( border: InputBorder.none, hintText: "Search Item "), suggestions: suggestions, textCapitalization: TextCapitalization.sentences, textChanged: (text) => currentText = text, clearOnSubmit: true, textSubmitted: (text) => setState(() { if (text != "") { added.add(text); } }), ), ), ), Expanded( flex: 0, child: Row( children: <Widget>[ IconButton( onPressed: () {}, color: Colors.black, icon: Icon(Icons.search)) ], )), ], ), ), // backgroundColor: Colors.white, expandedHeight: 100, flexibleSpace: FlexibleSpaceBar( background: new SizedBox( height: 100, width: double.infinity, child: Carousel( images: [ AssetImage("images/banner1.jpg"), AssetImage("images/banner2.jpg"), AssetImage("images/banner3.jpg"), AssetImage("images/banner4.jpg"), ], dotBgColor: Colors.transparent, animationDuration: Duration(milliseconds: 700), ), ), ), ) ]; }, body: SafeArea( child: SingleChildScrollView( child: Container( padding: EdgeInsets.symmetric(horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "${loggedInUser.name}, Welcome to MIRAALINK 254. ", style: TextStyle( fontSize: 19, color: Colors.blueAccent, fontWeight: FontWeight.w700), ), ], ), SizedBox( height: 15, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "+${loggedInUser.phone}", style: TextStyle( fontSize: 19, color: Colors.blueAccent, fontWeight: FontWeight.w700), ), ], ), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "OUR TOP VENDORS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer1.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "KANYE FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: Chepareria - WEST POKOT", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer2.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "ALEX MUSIO FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: Laare - MERU COUNTY", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage2, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer3.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "FARM DELTA", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: Igembe - MERU COUNTY", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage3, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer4.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "ANDREW AND SONS FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: Tigania - MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage4, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer5.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "MUTEMBEI FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MAUA - EMBU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage5, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer9.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "NDANU FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage9, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer10.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "ISAKA FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 16, ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage10, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "OTHER VENDORS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer6.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "CAROO FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: EMBU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage6, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer7.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "KIFEE FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage7, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer8.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "KINUTHIA FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage8, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer11.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "HOMEHALLOW FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage11, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 30, ), Row( children: [ Container( height: 80, width: 80, decoration: BoxDecoration( image: DecorationImage( image: AssetImage( "assets/imgs/farmer12.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "GABU FARM", style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600), ), ], ), Row( children: [ Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), Icon( Icons.star, size: 15, color: Colors.orange, ), ], ), Text( "LOCATION: MERU COUNTY ", style: TextStyle( fontSize: 12, ), ) ], ), ), InkWell( onTap: openHotelPage12, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(40)), color: greenBtn), child: Text( "MORE", style: TextStyle( color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700), ), ), ) ], ), SizedBox( height: 100, ), SingleChildScrollView( padding: EdgeInsets.only(bottom: 20), scrollDirection: Axis.horizontal, child: Row( children: [ Container( width: MediaQuery.of(context).size.width * 0.90, height: MediaQuery.of(context).size.height * 0.80, padding: EdgeInsets.symmetric( vertical: 40, horizontal: 20), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(0)), color: blue, boxShadow: [ BoxShadow( spreadRadius: 0, offset: Offset(0, 10), blurRadius: 0, color: blue.withOpacity(0.4)) ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Text( "ABOUT US", style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.w700, ), ), SizedBox( width: 5, ), Icon( Icons.arrow_back_outlined, color: Colors.white, size: 20, ), ], ), SizedBox( height: 15, ), Text( "MIRAALINK254 is Kenya's no. 1 online retailer established in March 2022 with the aim and vision to become " "the one-stop shop for retail of Miraa in Kenya with implementation of best" " practices both online and offline. The logistics service enables the delivery of" " bulk Miraa through a network of local partners while the payment services facilitate the" " payments of online transactions within MIRAALINK254's ecosystem. It has partnered with" " more than 5 active Miraa bulk sellers/individuals.", style: TextStyle( color: Colors.black, fontSize: 16, height: 1.2, fontWeight: FontWeight.w700), ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), ], ), SizedBox( height: 10, ), Row( children: [ Text( "OUR SERVICES", style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.w700, ), ), SizedBox( width: 5, ), Icon( Icons.miscellaneous_services, color: Colors.white, size: 19, ), ], ), SizedBox( height: 10, ), Text( "MIRAALINK254 is a platform for Miraa buyers to meet Miraa vendors/sellers. " "All services ranging from delivery, packaging in Nairobi and across Kenya are " "offered here. Buyer locate seller of his/her " "likings make contact either offline or through the app", style: TextStyle( color: Colors.black, fontSize: 16, fontWeight: FontWeight.w700), ), SizedBox( height: 5, ), Row( children: [ Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), Icon( Icons.star, color: Colors.black, size: 14, ), ], ), SizedBox( height: 10, ), Row( children: [ Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.white, fontSize: 20, fontWeight: FontWeight.w700, ), ), SizedBox( width: 5, ), Icon( Icons.contact_mail_outlined, color: Colors.white, size: 19, ), ], ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254745682815", style: TextStyle( color: Colors.black, fontSize: 15, fontWeight: FontWeight.w700), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254745682815", style: TextStyle( color: Colors.black, fontSize: 15, fontWeight: FontWeight.w700), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email, color: Colors.orangeAccent, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: MIRAALINK254@GMAIL.COM", style: TextStyle( color: Colors.black, fontSize: 15, fontWeight: FontWeight.w700), ), ], ), ], ), ), ], ), ), ], ), ), ), ), ), ); } // Row placesWidget(String img, String name, String desc ) // { // return Row( // children: [ // Container( // height: 80, // width: 80, // decoration: BoxDecoration( // image: DecorationImage( // image: AssetImage("assets/imgs/$img.jpg") // ) // ), // ), // SizedBox( // width: 20, // ), // Expanded( // child: Column( // crossAxisAlignment: CrossAxisAlignment.start, // children: [ // Row( // children: [ // Text("$name", style: TextStyle( // fontSize: 15, // fontWeight: FontWeight.w600 // ),), // Icon( // Icons.verified_rounded, // color: Colors.blue, // size: 16, // ), // ], // ), // Row( // children: [ // Icon(Icons.star, size: 15, color: Colors.orange,), // Icon(Icons.star, size: 15, color: Colors.orange,), // Icon(Icons.star, size: 15, color: Colors.orange,), // Icon(Icons.star, size: 15, color: Colors.orange,), // Icon(Icons.star, size: 15, color: Colors.orange,), // ], // ), // Text( '$desc', style: TextStyle( // fontSize: 12, // ),) // ], // ), // ), // InkWell( // onTap: openHotelPage, // child: Container( // padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), // decoration: BoxDecoration( // borderRadius: BorderRadius.all(Radius.circular(40)), // color: greenBtn // ), // child: Text("MORE", style: TextStyle( // color: Colors.white, // fontSize: 12, // fontWeight: FontWeight.w700 // ),), // ), // ) // ], // ); // } void openHotelPage() { Navigator.push( context, MaterialPageRoute(builder: (context) => hotelPage())); } void openHotelPage2() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer2())); } void openHotelPage3() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer3())); } void openHotelPage4() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer4())); } void openHotelPage5() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer5())); } void openHotelPage6() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer6())); } void openHotelPage7() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer7())); } void openHotelPage8() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer8())); } void openHotelPage9() { Navigator.push(context, MaterialPageRoute(builder: (context) => Farmer9())); } void openHotelPage10() { Navigator.push( context, MaterialPageRoute(builder: (context) => Farmer10())); } void openHotelPage11() { Navigator.push( context, MaterialPageRoute(builder: (context) => Farmer11())); } void openHotelPage12() { Navigator.push( context, MaterialPageRoute(builder: (context) => Farmer12())); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/faq_page.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class FaqPage extends StatefulWidget { @override _FaqPageState createState() => _FaqPageState(); } class _FaqPageState extends State<FaqPage> { List<Panel> panels = [ Panel( 'HOW CAN I CHANGE MY PASSWORD?', 'Head to Settings page> change password', false), Panel( 'HOW CAN I UPDATE MY PROFILE?', 'Profile page> Touch the avatar icon> then upload', false), Panel( 'HOW CAN I TRACK MY ORDERS & PAYMENT?', 'On the Order page, you will see order progress', false), Panel( 'HOW LONG WILL IT TAKE FOR MY ORDER TO ARRIVE AFTER I MAKE PAYMENT?', 'AT most 1 DAY', false), Panel( 'HOW DO YOU SHIP MY ORDERS?', 'Depends with clients mode of delivery.', false), Panel( 'HOW DO I MAKE PAYMENTS USING MPESA? HOW DOES IT WORK?', 'PROFILE>> WALLET >> THEN DEPOSIT', false) ]; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: Padding( padding: const EdgeInsets.only(top: 24.0), child: ListView( children: <Widget>[ Padding( padding: const EdgeInsets.only(left:24.0,right:24.0,bottom: 16.0), child: Text( 'FAQ', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ),... panels.map((panel)=>ExpansionTile( title: Text( panel.title, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey[600]), ), children: [Container( padding: EdgeInsets.all(16.0), color: Color(0xffFAF1E2), child: Text( panel.content, style: TextStyle(color: Colors.grey, fontSize: 12)))])).toList(), ], ), ), ), ); } } class Panel { String title; String content; bool expanded; Panel(this.title, this.content, this.expanded); }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer8.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer8 extends StatefulWidget { const Farmer8({Key? key}) : super(key: key); @override State<Farmer8> createState() => _Farmer8State(); } class _Farmer8State extends State<Farmer8> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "KINUTHIA FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 5 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT KINUTHIA FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer8", "KINUTHIA FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 736 333", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 736 333", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: KINUTHIA@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer8.png"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776736333"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/confirm_otp.dart
import 'dart:async'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:form_field_validator/form_field_validator.dart'; import 'package:grocery_app/LoginPage.dart'; import 'package:grocery_app/RegisterPage.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'dart:ui'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:grocery_app/constants/argon_theme.dart'; //widgets import 'package:fluttertoast/fluttertoast.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:grocery_app/HomePage.dart'; class ConfirmOTP extends StatefulWidget { const ConfirmOTP({Key? key}) : super(key: key); @override State<ConfirmOTP> createState() => _ConfirmOTPState(); } class _ConfirmOTPState extends State<ConfirmOTP> { User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); late Timer timer; TextEditingController myController = TextEditingController()..text = 'Your initial value'; bool isLoading = true; @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if(loggedInUser.email != null){ setState(() { isLoading = false; }); } }); user?.sendEmailVerification(); timer = Timer.periodic(Duration(seconds: 1), (timer) { checkEmailVerified(); }); } @override void dispose(){ timer.cancel(); super.dispose(); } late String _otp; String verificationIDreceived = ""; final formkey = GlobalKey<FormState>(); final requiredValidator = RequiredValidator(errorText: 'This field is required'); //FormType formType = FormType.login; checkFields() { final form = formkey.currentState; if (form!.validate()) { form.save(); return true; } return false; } @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/register-bg.png"), fit: BoxFit.cover)), ), SafeArea( child: ListView(children: [ Padding( padding: const EdgeInsets.only( top: 16, left: 24.0, right: 24.0, bottom: 32), child: Card( elevation: 5, clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Column( children: [ Container( height: MediaQuery.of(context).size.height * 0.15, decoration: BoxDecoration( color: ArgonColors.white, border: Border( bottom: BorderSide( width: 0.5, color: ArgonColors.muted))), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Center( child: Padding( padding: const EdgeInsets.only(top: 8.0), child: Text("ONE TIME EMAIL VERIFICATION", style: TextStyle( color: ArgonColors.text, fontSize: 16.0)), )), Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ], ), ), // Divider() ], )), Container( height: MediaQuery.of(context).size.height * 0.63, color: Color.fromRGBO(244, 245, 247, 1), child: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) :Padding( padding: const EdgeInsets.only( top: 24.0, bottom: 24.0), child: Center( child: Text( "A verification code has been sent to your email address(${loggedInUser.email})." " Kindly check your email inbox and verify via the link provided.", style: TextStyle( color: ArgonColors.text, fontWeight: FontWeight.w200, fontSize: 16)), ), ), Padding( padding: const EdgeInsets.only(top: 10), child: Center( child: FlatButton( textColor: ArgonColors.white, color: ArgonColors.primary, onPressed: () { }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Padding( padding: EdgeInsets.only( left: 16.0, right: 16.0, top: 12, bottom: 12), child: Text("CONTINUE", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16.0))), ), ), ), ], ), ), )) ], )), ), ]), ) ], )); } Future<void> checkEmailVerified() async { user = FirebaseAuth.instance.currentUser; await user?.reload(); if(user!.emailVerified){ timer.cancel(); Navigator.pop(context); Navigator.push(context, MaterialPageRoute(builder: (context) => StartUpPage( ))); } } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/ResetPassword.dart
import 'package:flutter/material.dart'; import 'package:form_field_validator/form_field_validator.dart'; import 'package:grocery_app/LoginPage.dart'; import 'package:grocery_app/RegisterPage.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'dart:ui'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:grocery_app/constants/argon_theme.dart'; import 'package:firebase_auth/firebase_auth.dart'; //widgets import 'package:grocery_app/widgets/argon_input.dart'; class ResetPassword extends StatefulWidget { //const ResetPassword({Key? key}) : super(key: key); @override State<ResetPassword> createState() => _ResetPasswordState(); } class _ResetPasswordState extends State<ResetPassword> { late String _email; late String _password; final formkey = GlobalKey<FormState>(); final emailValidator = MultiValidator([ RequiredValidator(errorText: 'Email is required'), EmailValidator(errorText: 'Enter a valid email address') ]); checkFields() { final form = formkey.currentState; if (form!.validate()) { form.save(); return true; } return false; } void Resetpassword() async { Fluttertoast.showToast(msg: "${_email}"); if(checkFields()){ await FirebaseAuth.instance.sendPasswordResetEmail(email: _email) .then((uid) => { Navigator.push(context, MaterialPageRoute(builder: (context) => LoginRegisterPage())), Fluttertoast.showToast( msg: "E-mail has been sent successfully", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 ), }) .catchError((e) { Fluttertoast.showToast( msg: e!.message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 ); }); } } @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/register-bg.png"), fit: BoxFit.cover)), ), SafeArea( child: ListView(children: [ Padding( padding: const EdgeInsets.only( top: 16, left: 24.0, right: 24.0, bottom: 32), child: Card( elevation: 5, clipBehavior: Clip.antiAlias, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Column( children: [ Container( height: MediaQuery.of(context).size.height * 0.15, decoration: BoxDecoration( color: ArgonColors.white, border: Border( bottom: BorderSide( width: 0.5, color: ArgonColors.muted))), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Center( child: Padding( padding: const EdgeInsets.only(top: 8.0), child: Text("FORGOT YOUR PASSWORD", style: TextStyle( color: ArgonColors.text, fontSize: 16.0)), )), Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ], ), ), // Divider() ], )), Container( height: MediaQuery.of(context).size.height * 0.63, color: Color.fromRGBO(244, 245, 247, 1), child: Padding( padding: const EdgeInsets.all(8.0), child: Center( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Padding( padding: const EdgeInsets.only( top: 24.0, bottom: 24.0), child: Center( child: Text( "Enter your valid email address and instructions will be sent to you.", style: TextStyle( color: ArgonColors.text, fontWeight: FontWeight.w200, fontSize: 16)), ), ), Form( key: formkey, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Padding( padding: const EdgeInsets.all(8.0), child: TextFormField( cursorColor: ArgonColors.muted, autofocus: false, validator: emailValidator, onChanged: (val) => _email = val, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: Icon(Icons.email), prefixIcon: Icon(Icons.email), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: ArgonColors.border, width: 1.0, style: BorderStyle.solid)), hintText: "Enter your email address")), ), ), Padding( padding: const EdgeInsets.only(top: 10), child: Center( child: FlatButton( textColor: ArgonColors.white, color: ArgonColors.primary, onPressed: () { Resetpassword(); }, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4.0), ), child: Padding( padding: EdgeInsets.only( left: 16.0, right: 16.0, top: 12, bottom: 12), child: Text("RESET PASSWORD", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16.0))), ), ), ) ], ), ), Padding( padding: const EdgeInsets.only( left: 8.0, top: 0, bottom: 16), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ // Checkbox( // activeColor: // ArgonColors.primary, // onChanged: onChanged(), value: , // ), Text("Remember Your password?", style: TextStyle( color: ArgonColors.muted, fontWeight: FontWeight.w200)), GestureDetector( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (context) => LoginRegisterPage())); } , child: Container( margin: EdgeInsets.only(left: 5), child: Text("BACK TO LOGIN", style: TextStyle( color: ArgonColors .primary)), )), ], ), ), ], ), ), )) ], )), ), ]), ) ], )); } tap() {} controller() {} }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/main.dart
// @dart=2.9 import 'dart:async'; import 'package:flutter/material.dart'; import 'package:grocery_app/HomePage.dart'; import 'package:grocery_app/sliderpage.dart'; import 'package:grocery_app/ProductInfo.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/RegisterPage.dart'; import 'package:grocery_app/LoginPage.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; Future<void> main() async { runApp(MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData(primaryColor: Colors.black), home: SplashScreen(), // home: LoginRegisterPage(), )); WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: FirebaseOptions( apiKey: "AIzaSyAf_eQHs89WxlVdERPZs4wHtM9N_6AP02M", appId: "1:1012629664469:android:68a90bda0e577973be685c", messagingSenderId: "1012629664469", projectId: "miraalink-67207", ), ); } class SplashScreen extends StatefulWidget { //const SplashScreen({Key? key}) : super(key: key); @override _SplashScreenState createState() => _SplashScreenState(); } class _SplashScreenState extends State<SplashScreen> { @override Future<void> initState() { super.initState(); Timer( Duration(seconds: 3), () => Navigator.push( context, MaterialPageRoute(builder: (context) => sliderpage()))); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Container( width: double.infinity, child: Container( child: Padding( padding: const EdgeInsets.all(30.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Container( child: new CircleAvatar( backgroundColor: Colors.transparent, radius: 150, child: Image.asset('images/load.gif'), )), ], ), )), ), ); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/sliderpage.dart
import 'dart:async'; import 'package:carousel_pro/carousel_pro.dart'; import 'package:flutter/material.dart'; import 'package:grocery_app/LoginPage.dart'; class sliderpage extends StatefulWidget { const sliderpage({Key? key}) : super(key: key); @override _sliderpageState createState() => _sliderpageState(); } class _sliderpageState extends State<sliderpage> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Carousel( showIndicator: true, animationDuration: Duration(milliseconds: 500), images: [ AssetImage('images/slider1.jpg'), AssetImage('images/slider2.jpg'), AssetImage('images/slider3.jpg'), AssetImage('images/slider4.jpg') ], ), floatingActionButton: FloatingActionButton.extended( onPressed: () { showDialog( context: context, barrierDismissible: false, builder: (BuildContext context) { return Center( child: Opacity( opacity: 1.0, child: CircularProgressIndicator( valueColor: new AlwaysStoppedAnimation<Color>( Colors.orangeAccent), ), ), ); }); Timer( Duration(seconds: 3), () => gotoNextpage()); }, label: Text( 'Start', ), icon: Icon(Icons.arrow_right), backgroundColor: Colors.orangeAccent, elevation: 30, ), ); } gotoNextpage() { Navigator.pop(context); Navigator.pop(context); Navigator.push(context, MaterialPageRoute(builder: (context) => LoginRegisterPage())); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer9.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer9 extends StatefulWidget { const Farmer9({Key? key}) : super(key: key); @override State<Farmer9> createState() => _Farmer9State(); } class _Farmer9State extends State<Farmer9> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "NDANU FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 50 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Awaiting Verification", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT NDANU FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer9", "NDANU FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254776 736 111 ", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254776 736 111", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: NDANU@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer9.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), ], ), ), ], ); } void openCartPage() { launch("tel://254776736636"); } }
0
mirrored_repositories/Android_MIRAALINK254
mirrored_repositories/Android_MIRAALINK254/lib/farmer5.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/StartUpPage.dart'; import 'package:grocery_app/constants/Style.dart'; import 'package:url_launcher/url_launcher.dart'; class Farmer5 extends StatefulWidget { const Farmer5({Key? key}) : super(key: key); @override State<Farmer5> createState() => _Farmer5State(); } class _Farmer5State extends State<Farmer5> { @override Widget build(BuildContext context) { return Scaffold( body: Stack( children: [ SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( padding: EdgeInsets.all(20), decoration: BoxDecoration( color: blue, image: DecorationImage( image: AssetImage("assets/imgs/product_bg.jpg"), fit: BoxFit.cover), borderRadius: BorderRadius.only( bottomLeft: Radius.circular(40), bottomRight: Radius.circular(40))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: Icon( Icons.arrow_back, color: Colors.white, ), onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => StartUpPage())); }, ), ], ), SizedBox( height: 200, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), Row( children: [ Text( "MUTEMBEI FARM", style: TextStyle( color: Colors.white, fontWeight: FontWeight.w700, fontSize: 20), ), Icon( Icons.verified_rounded, color: Colors.blue, size: 20, ), ], ), SizedBox( height: 10, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Icon( Icons.star, color: Colors.white, ), Text( " 100 Reviews", style: TextStyle( color: Colors.white, fontSize: 13), ) ], ) ], ), Container( height: 70, width: 70, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.white), child: Center( child: Icon( Icons.favorite, color: Colors.redAccent, size: 35, ), ), ) ], ), SizedBox( height: 15, ), Text( "Verified vendor.", style: TextStyle(color: Colors.white, fontSize: 18), ), ], ), ), SizedBox( height: 15, ), Container( padding: EdgeInsets.symmetric(horizontal: 10), child: Column( children: [ Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "ABOUT MUTEMBEI FARM", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), placesWidget("farmer5", "MUTEMBEI FARM"), SizedBox( height: 20, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( "VENDORS CONTACTS", style: TextStyle( fontSize: 22, fontWeight: FontWeight.w700), ), SizedBox( width: 10, ), Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 20), height: 0.5, color: Colors.grey, ), ) ], ), SizedBox( height: 20, ), SizedBox( height: 10, ), Row( children: [ Text( "CONTACT US NOW", style: TextStyle( color: Colors.orangeAccent, fontSize: 16, fontWeight: FontWeight.w700, ), ), SizedBox( height: 10, ), Icon( Icons.contact_mail_outlined, color: Colors.yellowAccent, size: 18, ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.phone, color: Colors.blue, size: 18, ), SizedBox( width: 10, ), Text( "PHONE: 254765 736 373", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.whatsapp_rounded, color: Colors.lightGreen, size: 18, ), SizedBox( width: 10, ), Text( "WHATSAPP: 254765 736 373", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 10, ), Row( children: [ Icon( Icons.email_outlined, color: Colors.deepOrange, size: 18, ), SizedBox( width: 10, ), Text( "EMAIL: MUTEMBEIFARM@GMAIL.COM", style: TextStyle(color: Colors.black, fontSize: 13), ), ], ), SizedBox( height: 200, ), ], ), ) ], ), ), ), Positioned( bottom: 30, left: 0, right: 0, child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Column( children: [ InkWell( onTap: openCartPage, child: Container( padding: EdgeInsets.symmetric( horizontal: 20, vertical: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), color: greenBtn), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end, children: [ Icon( Icons.phone_in_talk, color: Colors.white, size: 18, ), Text( " CALL VENDOR", style: TextStyle( color: Colors.white, fontSize: 13, fontWeight: FontWeight.w700), ) ], ), ), ), ), ], ) ], ), ), ) ], ), ); } Row placesWidget(String img, String name) { return Row( children: [ Container( height: 140, width: 180, decoration: BoxDecoration( image: DecorationImage( image: AssetImage("assets/imgs/farmer5.jpg"))), ), SizedBox( width: 20, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "$name", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), Row( children: [ Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), Icon( Icons.star, size: 20, color: Colors.orange, ), ], ), Text( "1. Free delivery services within Meru, Embu.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "2. Available 24/7.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "3. Quality goods, delivered in less than 24 hrs.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ), Text( "4. Aftersales services available.", style: TextStyle( color: Colors.orangeAccent, fontSize: 15, height: 1.5, ), ) ], ), ), ], ); } void openCartPage() { launch("tel://254765736373"); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/Theme.dart
import 'dart:ui' show Color; class NowUIColors { static const Color black = Color(0xFF000000); static const Color white = Color(0xFFFFFFFF); static const Color defaultColor = Color.fromRGBO(136, 136, 136, 1.0); static const Color primary = Color.fromRGBO(249, 99, 50, 1.0); static const Color secondary = Color.fromRGBO(68, 68, 68, 1.0); static const Color label = Color.fromRGBO(254, 36, 114, 1.0); static const Color neutral = Color.fromRGBO(255, 255, 255, 0.2); static const Color tabs = Color.fromRGBO(222, 222, 222, 0.3); static const Color info = Color.fromRGBO(44, 168, 255, 1.0); static const Color error = Color.fromRGBO(255, 54, 54, 1.0); static const Color success = Color.fromRGBO(24, 206, 15, 1.0); static const Color warning = Color.fromRGBO(255, 178, 54, 1.0); static const Color text = Color.fromRGBO(44, 44, 44, 1.0); static const Color bgColorScreen = Color.fromRGBO(255, 255, 255, 1.0); static const Color border = Color.fromRGBO(231, 231, 231, 1.0); static const Color inputSuccess = Color.fromRGBO(27, 230, 17, 1.0); static const Color input = Color.fromRGBO(220, 220, 220, 1.0); static const Color inputError = Color.fromRGBO(255, 54, 54, 1.0); static const Color muted = Color.fromRGBO(136, 152, 170, 1.0); // static const Color text = Color.fromRGBO(50, 50, 93, 1.0); static const Color time = Color.fromRGBO(154, 154, 154, 1.0); static const Color priceColor = Color.fromRGBO(234, 213, 251, 1.0); static const Color active = Color.fromRGBO(249, 99, 50, 1.0); static const Color buttonColor = Color.fromRGBO(156, 38, 176, 1.0); static const Color placeholder = Color.fromRGBO(159, 165, 170, 1.0); static const Color switchON = Color.fromRGBO(249, 99, 50, 1.0); static const Color switchOFF = Color.fromRGBO(137, 137, 137, 1.0); static const Color gradientStart = Color.fromRGBO(107, 36, 170, 1.0); static const Color gradientEnd = Color.fromRGBO(172, 38, 136, 1.0); static const Color socialFacebook = Color.fromRGBO(59, 89, 152, 1.0); static const Color socialTwitter = Color.fromRGBO(91, 192, 222, 1.0); static const Color socialDribbble = Color.fromRGBO(234, 76, 137, 1.0); }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/color_list.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/material.dart'; class ColorList extends StatefulWidget { final List<Color> colorList; ColorList(this.colorList); @override _ColorListState createState() => _ColorListState(); } class _ColorListState extends State<ColorList> { int active = 0; @override Widget build(BuildContext context) { return SizedBox( height: 75, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Text( 'Color', style: TextStyle(color: Colors.white, shadows: shadow), ), ), Flexible( child: ListView.builder( scrollDirection: Axis.horizontal, itemCount: widget.colorList.length, /// list of button colors based on colorList itemBuilder: (_, index) => InkWell( onTap: () { setState(() { active = index; }); }, child: Padding( padding: const EdgeInsets.symmetric( horizontal: 4.0, vertical: 8.0), ///scale based on active color child: Transform.scale( scale: active == index ? 1.2 : 1, child: ColorOption(widget.colorList[index]), ), ), ), ), ), ], ), ); } } class ColorOption extends StatelessWidget { final Color color; const ColorOption(this.color); @override Widget build(BuildContext context) { return Container( width: 32, height: 32, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: color), ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/Style.dart
import 'package:flutter/material.dart'; Color blue = new Color(0xff50c9ff); Color green = new Color(0xff00e582); Color black = new Color(0xff4d4d4d); Color greenBtn = new Color(0xff00d672);
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/custom_background.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/material.dart'; class MainBackground extends CustomPainter { MainBackground(); @override void paint(Canvas canvas, Size size) { double height = size.height; double width = size.width; canvas.drawRect( Rect.fromLTRB(0, 0, width, height), Paint()..color = Colors.white); canvas.drawRect(Rect.fromLTRB(width - (width / 3), 0, width, height), Paint()..color = transparentYellow); } @override bool shouldRepaint(CustomPainter oldDelegate) { return false; } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/app_properties.dart
import 'package:flutter/material.dart'; const Color yellow = Color(0xffFDC054); const Color mediumYellow = Color(0xffFDB846); const Color darkYellow = Color(0xffE99E22); const Color transparentYellow = Color.fromRGBO(253, 184, 70, 0.7); const Color darkGrey = Color(0xff202020); const LinearGradient mainButton = LinearGradient(colors: [ Color.fromRGBO(236, 60, 3, 1), Color.fromRGBO(234, 60, 3, 1), Color.fromRGBO(216, 78, 16, 1), ], begin: FractionalOffset.topCenter, end: FractionalOffset.bottomCenter); const List<BoxShadow> shadow = [ BoxShadow(color: Colors.black12, offset: Offset(0, 3), blurRadius: 6) ]; screenAwareSize(int size, BuildContext context) { double baseHeight = 640.0; return size * MediaQuery.of(context).size.height / baseHeight; }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/constants/argon_theme.dart
import 'dart:ui' show Color; class ArgonColors { static const Color black = Color(0xFF000000); static const Color white = Color(0xFFFFFFFF); static const Color initial = Color.fromRGBO(23, 43, 77, 1.0); static const Color primary = Color.fromRGBO(94, 114, 228, 1.0); static const Color secondary = Color.fromRGBO(247, 250, 252, 1.0); static const Color label = Color.fromRGBO(254, 36, 114, 1.0); static const Color info = Color.fromRGBO(17, 205, 239, 1.0); static const Color error = Color.fromRGBO(245, 54, 92, 1.0); static const Color success = Color.fromRGBO(45, 206, 137, 1.0); static const Color warning = Color.fromRGBO(251, 99, 64, 1.0); static const Color header = Color.fromRGBO(82, 95, 127, 1.0); static const Color bgColorScreen = Color.fromRGBO(248, 249, 254, 1.0); static const Color border = Color.fromRGBO(202, 209, 215, 1.0); static const Color inputSuccess = Color.fromRGBO(123, 222, 177, 1.0); static const Color inputError = Color.fromRGBO(252, 179, 164, 1.0); static const Color muted = Color.fromRGBO(136, 152, 170, 1.0); static const Color text = Color.fromRGBO(50, 50, 93, 1.0); }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/argon_input.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/argon_theme.dart'; import 'package:form_field_validator/form_field_validator.dart'; class Input extends StatelessWidget { final String placeholder; final Widget suffixIcon; final Widget prefixIcon; final Function onChanged; final Function validator; final bool autofocus; final Color borderColor; final requiredValidator = RequiredValidator(errorText: 'This field is required'); Input( {required this.placeholder, required this.suffixIcon, required this.prefixIcon, required this.onChanged, required this.validator, this.autofocus = false, this.borderColor = ArgonColors.border, }); @override Widget build(BuildContext context) { return TextFormField( cursorColor: ArgonColors.muted, autofocus: autofocus, validator: requiredValidator, style: TextStyle(height: 0.85, fontSize: 14.0, color: ArgonColors.initial), textAlignVertical: TextAlignVertical(y: 0.6), decoration: InputDecoration( filled: true, fillColor: ArgonColors.white, hintStyle: TextStyle( color: ArgonColors.muted, ), suffixIcon: suffixIcon, prefixIcon: prefixIcon, enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: borderColor, width: 1.0, style: BorderStyle.solid)), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(4.0), borderSide: BorderSide( color: borderColor, width: 1.0, style: BorderStyle.solid)), hintText: placeholder)); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/card-square.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/argon_theme.dart'; class CardSquare extends StatelessWidget { CardSquare( {this.title = "Placeholder Title", this.cta = "", this.img = "https://via.placeholder.com/200", this.tap = defaultFunc}); final String cta; final String img; final Function tap; final String title; static void defaultFunc() { print("the function works!"); } @override Widget build(BuildContext context) { return Container( height: 250, width: null, child: GestureDetector( onTap: (){}, child: Card( elevation: 0.4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(8.0))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Flexible( flex: 3, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(6.0), topRight: Radius.circular(6.0)), image: DecorationImage( image: NetworkImage(img), fit: BoxFit.cover, )))), Flexible( flex: 1, child: Padding( padding: const EdgeInsets.only( top: 8.0, bottom: 8.0, left: 8.0), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(title, style: TextStyle( color: ArgonColors.header, fontSize: 13)), Text(cta, style: TextStyle( color: ArgonColors.primary, fontSize: 11, fontWeight: FontWeight.w600)) ], ), )) ], )), )); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/card-horizontal.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/argon_theme.dart'; class CardHorizontal extends StatelessWidget { CardHorizontal( {this.title = "Placeholder Title", this.cta = "", this.img = "https://via.placeholder.com/200", this.tap = defaultFunc}); final String cta; final String img; final Function tap; final String title; static void defaultFunc() { print("the function works!"); } @override Widget build(BuildContext context) { return Container( height: 130, child: GestureDetector( onTap: () {}, child: Card( elevation: 0.6, shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(6.0))), child: Row( children: [ Flexible( flex: 1, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(6.0), bottomLeft: Radius.circular(6.0)), image: DecorationImage( image: NetworkImage(img), fit: BoxFit.cover, ))), ), Flexible( flex: 1, child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(title, style: TextStyle( color: ArgonColors.header, fontSize: 13)), Text(cta, style: TextStyle( color: ArgonColors.primary, fontSize: 11, fontWeight: FontWeight.w600)) ], ), )) ], ), ), )); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/table-cell.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/Theme.dart'; class TableCellSettings extends StatelessWidget { final String title; final Function onTap; TableCellSettings({required this.title, required this.onTap}); @override Widget build(BuildContext context) { return GestureDetector( onTap: onTap(), child: Padding( padding: const EdgeInsets.only(top: 16.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(title, style: TextStyle(color: NowUIColors.text)), Padding( padding: const EdgeInsets.only(right: 8.0), child: Icon(Icons.arrow_forward_ios, color: NowUIColors.text, size: 14), ) ], ), ), ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/card-small.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/argon_theme.dart'; class CardSmall extends StatelessWidget { CardSmall( {this.title = "Placeholder Title", this.cta = "", this.img = "https://via.placeholder.com/200", this.tap = defaultFunc}); final String cta; final String img; final Function tap; final String title; static void defaultFunc() { print("the function works!"); } @override Widget build(BuildContext context) { return Flexible( child: Container( height: 235, child: GestureDetector( onTap: () {}, child: Card( elevation: 0.4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(8.0))), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Flexible( flex: 2, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(6.0), topRight: Radius.circular(6.0)), image: DecorationImage( image: NetworkImage(img), fit: BoxFit.cover, )))), Flexible( flex: 1, child: Padding( padding: const EdgeInsets.only( top: 8.0, bottom: 8.0, left: 8.0), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(title, style: TextStyle( color: ArgonColors.header, fontSize: 13)), Padding( padding: const EdgeInsets.only(top: 8.0), child: Text(cta, style: TextStyle( color: ArgonColors.primary, fontSize: 11, fontWeight: FontWeight.w600)), ) ], ), )) ], )), ), )); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/widgets/photo-album.dart
import 'package:flutter/material.dart'; import 'package:grocery_app/constants/Theme.dart'; class PhotoAlbum extends StatelessWidget { final List<String> imgArray; PhotoAlbum({required this.imgArray}); @override Widget build(BuildContext context) { return Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "Album", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14.0, ), ), Text( "View All", style: TextStyle(color: NowUIColors.primary, fontSize: 12.0), ), ], ), SizedBox( height: 250, child: GridView.count( primary: false, padding: EdgeInsets.symmetric(vertical: 15.0), crossAxisSpacing: 10, mainAxisSpacing: 10, crossAxisCount: 3, children: imgArray .map((item) => Container( height: 100, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(4.0)), image: DecorationImage( image: AssetImage(item), fit: BoxFit.cover)))) .toList()), ) ], ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/models/usermodel.dart
class UserModel { String? uid; String? phone; String? email; String? name; UserModel({ this.uid, this.phone, this.email, this.name, }); // receiving data from server factory UserModel.fromMap(map) { return UserModel( uid: map['uid'], phone: map['phone'], email: map['email'], name: map['name'], ); } // sending data to our server Map<String, dynamic> toMap() { return { 'uid': uid, 'phone': phone, 'email': email, 'name': name, }; } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/models/farmermodel.dart
class FarmerModel { String? uid; String? farm_name; String? email; String? name; String? location; int? status; FarmerModel({ this.uid, this.farm_name, this.email, this.name, this.location, this.status }); // receiving data from server factory FarmerModel.fromMap(map) { return FarmerModel( uid: map['uid'], farm_name: map['farm_name'], email: map['email'], name: map['name'], location: map['location'], status: map['status'], ); } // sending data to our server // Map<String, dynamic> toMap() { // return { // 'uid': uid, // 'phone': phone, // 'email': email, // 'name': name, // }; // } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/legal_about_page.dart
import 'dart:io'; import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:grocery_app/settings/terms.dart'; import 'package:grocery_app/settings/privacy.dart'; class LegalAboutPage extends StatefulWidget { @override _LegalAboutPageState createState() => _LegalAboutPageState(); } class _LegalAboutPageState extends State<LegalAboutPage> { @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: Padding( padding: const EdgeInsets.only(top:24.0,left: 24.0, right: 24.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.only(bottom: 16.0), child: Text( 'Legal & About', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ), Flexible( child: ListView( children: <Widget>[ ListTile( title: Text('Terms of Use'), trailing: Icon(Icons.chevron_right), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => TermsOfUse())), ), ListTile( title: Text('Privacy Policy'), trailing: Icon(Icons.chevron_right), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => PrivacyPage())), ), ], ), ), ], ), ), ), ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/privacy.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class PrivacyPage extends StatefulWidget { const PrivacyPage({Key? key}) : super(key: key); @override State<PrivacyPage> createState() => _PrivacyPageState(); } class _PrivacyPageState extends State<PrivacyPage> { List<Panel> panels = [ Panel( 'Disclosure of Your Personal Data', 'If the Company is involved in a merger, acquisition or asset sale, Your Personal Data may be transferred. We will provide notice before Your Personal Data is transferred and becomes subject to a different Privacy Policy.', false), Panel( 'Law enforcement?', 'Under certain circumstances, the Company may be required to disclose Your Personal Data if required to do so by law or in response to valid requests by public authorities (e.g. a court or a government agency).', false), Panel( 'Other legal requirements', 'The Company may disclose Your Personal Data in the good faith belief that such action is necessary to:' 'Comply with a legal obligation' 'Protect and defend the rights or property of the Company' 'Prevent or investigate possible wrongdoing in connection with the Service' 'Protect the personal safety of Users of the Service or the public' 'Protect against legal liability', false), Panel( 'Security of Your Personal Data', 'The security of Your Personal Data is important to Us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While We strive to use commercially acceptable means to protect Your Personal Data, We cannot guarantee its absolute security.', false), Panel( 'Childrens Privacy', 'Our Service does not address anyone under the age of 13. We do not knowingly collect ' 'personally identifiable information from anyone under the age of 13. ' 'If You are a parent or guardian and You are aware that Your child has ' 'provided Us with Personal Data, please contact Us. If We become aware that We have collected Personal Data ' 'from anyone under the age of 13 without verification of parental consent, ' 'We take steps to remove that information from Our servers.' 'If We need to rely on consent as a legal basis' ' for processing Your information and Your country ' 'requires consent from a parent, We may require Your parents consent before We collect and use that information.', false), Panel( 'Changes to this Privacy Policy', ' We may update Our Privacy Policy from time to time. We will notify You of any changes by posting the new Privacy Policy on this page.' 'We will let You know via email and/or a prominent notice on Our' 'Service, prior to the change becoming effective and update the "Last updated" date at the top of this Privacy Policy.' 'You are advised to review this Privacy Policy periodically for any changes.' ' Changes to this Privacy Policy are effective when they are posted on this page.', false) ]; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: Padding( padding: const EdgeInsets.only(top: 24.0), child: ListView( children: <Widget>[ Padding( padding: const EdgeInsets.only(left:24.0,right:24.0,bottom: 16.0), child: Text( 'FAQ', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ),... panels.map((panel)=>ExpansionTile( title: Text( panel.title, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey[600]), ), children: [Container( padding: EdgeInsets.all(16.0), color: Color(0xffFAF1E2), child: Text( panel.content, style: TextStyle(color: Colors.grey, fontSize: 12)))])).toList(), ], ), ), ), ); } } class Panel { String title; String content; bool expanded; Panel(this.title, this.content, this.expanded); }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/support.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SupportPage extends StatefulWidget { const SupportPage({Key? key}) : super(key: key); @override State<SupportPage> createState() => _SupportPageState(); } class _SupportPageState extends State<SupportPage> { List<Panel> panels = [ Panel( 'Personal Data', 'While using Our Service, We may ask You to provide Us with ' 'certain personally identifiable information that can be used to contact or ' 'identify You. Personally identifiable information may include, ' 'but is not limited to:' 'Email address' 'First name and last name Phone number' 'Usage Data', false), Panel( 'Usage Data', 'Usage Data is collected automatically when using the ' 'Service.' 'Usage Data may include information such as Your Device ' 'Internet Protocol address (e.g. IP address), browser type, browser version,' ' the pages of our Service that You visit, the time and date of Your visit,' ' the time spent on those pages, unique device identifiers and other diagnostic data.' 'When You access the Service by or through a mobile device, We may collect certain' ' information automatically, including, but not limited to, the type of mobile device ' 'You use, Your mobile device unique ID, the IP address of Your mobile device, ' 'Your mobile operating system, the type of mobile Internet browser You use, unique ' 'device identifiers and other diagnostic data.' 'We may also collect information that Your browser sends whenever You visit our Service ' 'or when You access the Service by or through a mobile device.', false), Panel( 'Use of Your Personal Data', 'The Company may use Personal Data for the following purposes:' 'To provide and maintain our Service, including to monitor the usage of our Service.' 'To manage Your Account: to manage Your registration as a user of the Service. ' 'The Personal Data You provide can give You access to different functionalities of the Service' ' that are available to You as a registered user.' 'For the performance of a contract: the development, compliance and undertaking of the purchase ' 'contract for the products, items or services You have purchased or of any other contract with' 'Us through the Service.' ' To contact You: To contact You by email, telephone calls, SMS, or other equivalent forms of electronic' ' communication, such as a mobile applications push notifications regarding updates ' 'or informative communications related to the functionalities, products or contracted services, ' 'including the security updates, when necessary or reasonable for their implementation.' 'To provide You with news, special offers and general information about other goods, ' 'services and events which we offer that are similar to those that you have already' ' purchased or enquired about unless You have opted not to receive such information.' 'To manage Your requests: To attend and manage Your requests to Us.', false), Panel( 'Retention of Your Personal Data', 'The Company will retain Your Personal Data only for as long as is necessary for the purposes' 'set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to ' 'comply with our legal obligations (for example, if we are required to retain your data to comply ' 'with applicable laws), resolve disputes, and enforce our legal agreements and policies.' 'The Company will also retain Usage Data for internal analysis purposes. ' 'Usage Data is generally retained for a shorter period of time, except when this data is used' ' to strengthen the security or to improve the functionality of Our Service,' 'or We are legally obligated to retain this data for longer time periods.', false), Panel( 'Transfer of Your Personal Data', 'Your information, including Personal Data, is processed at the Companys operating offices and in any' ' other places where the parties involved in the processing are located. ' 'It means that this information may be transferred to — and maintained on' '— computers located outside of Your state, province, country or other governmental jurisdiction' ' where the data protection laws may differ than those from Your jurisdiction.' 'Your consent to this Privacy Policy followed by Your submission of such information represents ' 'Your agreement to that transfer.' 'The Company will take all steps reasonably necessary to ensure that' ' Your data is treated securely and in accordance with this Privacy Policy and no transfer of ' 'Your Personal Data will take place to an organization or a country unless there are adequate ' 'controls in place including the security of Your data and other personal information.', false), ]; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: Padding( padding: const EdgeInsets.only(top: 24.0), child: ListView( children: <Widget>[ Padding( padding: const EdgeInsets.only(left:24.0,right:24.0,bottom: 16.0), child: Text( 'FAQ', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ),... panels.map((panel)=>ExpansionTile( title: Text( panel.title, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey[600]), ), children: [Container( padding: EdgeInsets.all(16.0), color: Color(0xffFAF1E2), child: Text( panel.content, style: TextStyle(color: Colors.grey, fontSize: 12)))])).toList(), ], ), ), ), ); } } class Panel { String title; String content; bool expanded; Panel(this.title, this.content, this.expanded); }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/terms.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class TermsOfUse extends StatefulWidget { const TermsOfUse({Key? key}) : super(key: key); @override State<TermsOfUse> createState() => _TermsOfUseState(); } class _TermsOfUseState extends State<TermsOfUse> { List<Panel> panels = [ Panel( 'Personal Data', 'While using Our Service, We may ask You to provide Us with ' 'certain personally identifiable information that can be used to contact or ' 'identify You. Personally identifiable information may include, ' 'but is not limited to:' 'Email address' 'First name and last name Phone number' 'Usage Data', false), Panel( 'Usage Data', 'Usage Data is collected automatically when using the ' 'Service.' 'Usage Data may include information such as Your Device ' 'Internet Protocol address (e.g. IP address), browser type, browser version,' ' the pages of our Service that You visit, the time and date of Your visit,' ' the time spent on those pages, unique device identifiers and other diagnostic data.' 'When You access the Service by or through a mobile device, We may collect certain' ' information automatically, including, but not limited to, the type of mobile device ' 'You use, Your mobile device unique ID, the IP address of Your mobile device, ' 'Your mobile operating system, the type of mobile Internet browser You use, unique ' 'device identifiers and other diagnostic data.' 'We may also collect information that Your browser sends whenever You visit our Service ' 'or when You access the Service by or through a mobile device.', false), Panel( 'Use of Your Personal Data', 'The Company may use Personal Data for the following purposes:' 'To provide and maintain our Service, including to monitor the usage of our Service.' 'To manage Your Account: to manage Your registration as a user of the Service. ' 'The Personal Data You provide can give You access to different functionalities of the Service' ' that are available to You as a registered user.' 'For the performance of a contract: the development, compliance and undertaking of the purchase ' 'contract for the products, items or services You have purchased or of any other contract with' 'Us through the Service.' ' To contact You: To contact You by email, telephone calls, SMS, or other equivalent forms of electronic' ' communication, such as a mobile applications push notifications regarding updates ' 'or informative communications related to the functionalities, products or contracted services, ' 'including the security updates, when necessary or reasonable for their implementation.' 'To provide You with news, special offers and general information about other goods, ' 'services and events which we offer that are similar to those that you have already' ' purchased or enquired about unless You have opted not to receive such information.' 'To manage Your requests: To attend and manage Your requests to Us.', false), Panel( 'Retention of Your Personal Data', 'The Company will retain Your Personal Data only for as long as is necessary for the purposes' 'set out in this Privacy Policy. We will retain and use Your Personal Data to the extent necessary to ' 'comply with our legal obligations (for example, if we are required to retain your data to comply ' 'with applicable laws), resolve disputes, and enforce our legal agreements and policies.' 'The Company will also retain Usage Data for internal analysis purposes. ' 'Usage Data is generally retained for a shorter period of time, except when this data is used' ' to strengthen the security or to improve the functionality of Our Service,' 'or We are legally obligated to retain this data for longer time periods.', false), Panel( 'Transfer of Your Personal Data', 'Your information, including Personal Data, is processed at the Companys operating offices and in any' ' other places where the parties involved in the processing are located. ' 'It means that this information may be transferred to — and maintained on' '— computers located outside of Your state, province, country or other governmental jurisdiction' ' where the data protection laws may differ than those from Your jurisdiction.' 'Your consent to this Privacy Policy followed by Your submission of such information represents ' 'Your agreement to that transfer.' 'The Company will take all steps reasonably necessary to ensure that' ' Your data is treated securely and in accordance with this Privacy Policy and no transfer of ' 'Your Personal Data will take place to an organization or a country unless there are adequate ' 'controls in place including the security of Your data and other personal information.', false), ]; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: Padding( padding: const EdgeInsets.only(top: 24.0), child: ListView( children: <Widget>[ Padding( padding: const EdgeInsets.only(left:24.0,right:24.0,bottom: 16.0), child: Text( 'FAQ', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ),... panels.map((panel)=>ExpansionTile( title: Text( panel.title, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey[600]), ), children: [Container( padding: EdgeInsets.all(16.0), color: Color(0xffFAF1E2), child: Text( panel.content, style: TextStyle(color: Colors.grey, fontSize: 12)))])).toList(), ], ), ), ), ); } } class Panel { String title; String content; bool expanded; Panel(this.title, this.content, this.expanded); }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/settings_page.dart
import 'package:grocery_app/LoginPage.dart'; import 'package:grocery_app/constants/app_properties.dart'; import 'package:grocery_app/constants/custom_background.dart'; import 'package:grocery_app/settings/change_password.dart'; import 'package:grocery_app/settings/legal_about_page.dart'; import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class SettingsPage extends StatelessWidget { @override Widget build(BuildContext context) { return CustomPaint( painter: MainBackground(), child: Scaffold( appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: LayoutBuilder( builder:(builder,constraints)=> SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints(minHeight: constraints.maxHeight), child: Padding( padding: const EdgeInsets.only(top: 24.0, left: 24.0, right: 24.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Text( 'General', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ), Padding( padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), child: Text( 'Account', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ), ListTile( title: Text('Change Password'), leading: Image.asset('assets/icons/change_pass.png'), onTap: () => Navigator.of(context).push( MaterialPageRoute(builder: (_) => ChangePasswordPage())), ), ListTile( title: Text('Sign out'), leading: Image.asset('assets/icons/sign_out.png'), onTap: () { Signout(); Navigator.pop(context); Navigator.of(context).push( MaterialPageRoute(builder: (_) => LoginRegisterPage())); }, ),], ), ), ), ) ), ), ), ); } } class Signout { Future<void> _signOut() async { await FirebaseAuth.instance.signOut(); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/settings/change_password.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:grocery_app/HomePage.dart'; import 'package:form_field_validator/form_field_validator.dart'; class ChangePasswordPage extends StatefulWidget { @override _ChangePasswordPageState createState() => _ChangePasswordPageState(); } class _ChangePasswordPageState extends State<ChangePasswordPage> { bool isLoading = true; User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if(loggedInUser.email != null){ setState(() { isLoading = false; }); } }); } late String _email; late String _password; final formkey = GlobalKey<FormState>(); final emailValidator = MultiValidator([ RequiredValidator(errorText: 'Email is required'), EmailValidator(errorText: 'Enter a valid email address') ]); void Resetpassword() async { Fluttertoast.showToast(msg: "${loggedInUser.email}"); await FirebaseAuth.instance.sendPasswordResetEmail(email: loggedInUser.email.toString()) .then((uid) => { Navigator.push(context, MaterialPageRoute(builder: (context) => HomePage())), Fluttertoast.showToast( msg: "E-mail has been sent successfully", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 10, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 ), }) .catchError((e) { Fluttertoast.showToast( msg: e!.message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.CENTER_LEFT, timeInSecForIosWeb: 4, backgroundColor: Colors.red, textColor: Colors.white, fontSize: 16.0 ); }); } @override Widget build(BuildContext context) { TextEditingController email = TextEditingController()..text = "${loggedInUser.email}"; double width = MediaQuery.of(context).size.width; double bottomPadding = MediaQuery.of(context).padding.bottom; Widget changePasswordButton = InkWell( onTap: () { Resetpassword(); }, child: Container( height: 80, width: width / 1.5, decoration: BoxDecoration( gradient: mainButton, boxShadow: [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.16), offset: Offset(0, 5), blurRadius: 10.0, ) ], borderRadius: BorderRadius.circular(9.0)), child: Center( child: Text("Request Reset", style: const TextStyle( color: const Color(0xfffefefe), fontWeight: FontWeight.w600, fontStyle: FontStyle.normal, fontSize: 20.0)), ), ), ); return Scaffold( backgroundColor: Colors.grey[100], appBar: AppBar( iconTheme: IconThemeData( color: Colors.black, ), brightness: Brightness.light, backgroundColor: Colors.transparent, title: Text( 'Settings', style: TextStyle(color: darkGrey), ), elevation: 0, ), body: SafeArea( bottom: true, child: (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) :LayoutBuilder( builder: (b, constraints) => Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints(minHeight: constraints.maxHeight), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.only(bottom: 48.0,top:16.0), child: Text( 'Change Password', style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 18.0), ), ), Padding( padding: const EdgeInsets.only(bottom: 12.0), child: Text( 'Your Email Address', style: TextStyle(fontWeight: FontWeight.bold), ), ), Container( padding: const EdgeInsets.symmetric( horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5))), child: TextField( controller: email, decoration: InputDecoration( border: InputBorder.none, hintText: 'Your email', hintStyle: TextStyle(fontSize: 12.0)), )), ], ), Align( alignment: Alignment.bottomCenter, child: Container( padding: EdgeInsets.only( top: 8.0, bottom: bottomPadding != 20 ? 20 : bottomPadding), width: width, child: Center(child: changePasswordButton), ), ), ], ), ), ), ), )), ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/address/address_form.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:flutter/material.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class AddAddressForm extends StatefulWidget { const AddAddressForm({Key? key}) : super(key: key); @override State<AddAddressForm> createState() => _AddAddressFormState(); } class _AddAddressFormState extends State<AddAddressForm> { User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); bool isLoading = true; @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); if(loggedInUser.email != null){ setState(() { isLoading = false; }); } }); } @override Widget build(BuildContext context) { TextEditingController fullname = TextEditingController()..text = "${loggedInUser.name}"; TextEditingController phone = TextEditingController()..text = "${loggedInUser.phone}"; TextEditingController email = TextEditingController()..text = "${loggedInUser.email}"; return (isLoading) ? Center( child: SizedBox( height: 80, width: 80, child: CircularProgressIndicator( color: Colors.blueAccent, strokeWidth: 3, ), ), ) : SizedBox ( height: 500, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container( padding: EdgeInsets.only(left: 16.0, top: 4.0, bottom: 4.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white, ), child: TextField( controller: fullname, decoration: InputDecoration( border: InputBorder.none, hintText: 'Full Name'), ), ), Container( padding: EdgeInsets.only(left: 16.0, top: 4.0, bottom: 4.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white, ), child: TextField( controller: phone, decoration: InputDecoration(border: InputBorder.none, hintText: 'Phone Number'), ), ), Container( padding: EdgeInsets.only(left: 16.0, top: 4.0, bottom: 4.0), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white, ), child: TextField( controller: email, decoration: InputDecoration(border: InputBorder.none, hintText: 'Email Address'), ), ), Row( children: <Widget>[ Checkbox( value: true, onChanged: (_) {}, ), Text('I consent that all my info submitted herein are correct') ], ) ], ), ); } }
0
mirrored_repositories/Android_MIRAALINK254/lib
mirrored_repositories/Android_MIRAALINK254/lib/address/add_address_page.dart
import 'package:grocery_app/constants/app_properties.dart'; import 'package:grocery_app/address/address_form.dart'; import 'package:flutter/material.dart'; import 'package:grocery_app/models/usermodel.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class AddAddressPage extends StatefulWidget { const AddAddressPage({Key? key}) : super(key: key); @override State<AddAddressPage> createState() => _AddAddressPageState(); } class _AddAddressPageState extends State<AddAddressPage> { User? user = FirebaseAuth.instance.currentUser; UserModel loggedInUser = UserModel(); @override void initState() { super.initState(); FirebaseFirestore.instance .collection("users") .doc(user!.uid) .get() .then((value) { loggedInUser = UserModel.fromMap(value.data()); setState(() {}); }); } @override Widget build(BuildContext context) { TextEditingController fullname = TextEditingController()..text = "${loggedInUser.name}"; TextEditingController phone = TextEditingController()..text = "${loggedInUser.phone}"; TextEditingController email = TextEditingController()..text = "${loggedInUser.email}"; Widget finishButton = InkWell( onTap:() {}, child: Container( height: 80, width: MediaQuery.of(context).size.width / 1.5, decoration: BoxDecoration( gradient: mainButton, boxShadow: [ BoxShadow( color: Color.fromRGBO(0, 0, 0, 0.16), offset: Offset(0, 5), blurRadius: 10.0, ) ], borderRadius: BorderRadius.circular(9.0)), child: Center( child: Text("Update", style: const TextStyle( color: const Color(0xfffefefe), fontWeight: FontWeight.w600, fontStyle: FontStyle.normal, fontSize: 20.0)), ), ), ); return Scaffold( backgroundColor: Colors.grey[100], appBar: AppBar( backgroundColor: Colors.transparent, elevation: 0.0, iconTheme: IconThemeData(color: darkGrey), title: Text( 'Address / Contact info', style: const TextStyle( color: darkGrey, fontWeight: FontWeight.w500, fontFamily: "Montserrat", fontSize: 38.0), ), ), body: LayoutBuilder( builder: (_, viewportConstraints) => SingleChildScrollView( child: ConstrainedBox( constraints: BoxConstraints(minHeight: viewportConstraints.maxHeight), child: Container( padding: EdgeInsets.only( left: 16.0, right: 16.0, bottom: MediaQuery.of(context).padding.bottom == 0 ? 20 : MediaQuery.of(context).padding.bottom), child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisSize: MainAxisSize.min, children: <Widget>[ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Card( margin: EdgeInsets.symmetric(vertical: 8.0), color: Colors.white, elevation: 3, child: SizedBox( height: 100, width: 80, child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Padding( padding: const EdgeInsets.all(4.0), child: Image.asset( 'assets/icons/address_home.png'), ), Text( 'Your Address are displayed here', style: TextStyle( fontSize: 10, color: darkGrey, ), textAlign: TextAlign.center, ) ], ), ))), Card( margin: EdgeInsets.symmetric(vertical: 8.0), color: yellow, elevation: 3, child: SizedBox( height: 80, width: 100, child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Padding( padding: const EdgeInsets.all(4.0), child: Image.asset( 'assets/icons/address_home.png', color: Colors.white, height: 20, ), ), Text( '${loggedInUser.name},\n NAIROBI KENYA', style: TextStyle( fontSize: 10, color: Colors.white, ), textAlign: TextAlign.center, ) ], ), ))), Card( margin: EdgeInsets.symmetric(vertical: 8.0), color: yellow, elevation: 3, child: SizedBox( height: 80, width: 100, child: Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Padding( padding: const EdgeInsets.all(4.0), child: Image.asset( 'assets/icons/address_work.png', color: Colors.white, height: 20), ), Text( 'Workplace', style: TextStyle( fontSize: 8, color: Colors.white, ), textAlign: TextAlign.center, ) ], ), ))) ], ), AddAddressForm(), Center(child: finishButton) ], ), ), ), ), ), ); } }
0
mirrored_repositories/flutter_course_app
mirrored_repositories/flutter_course_app/lib/home_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/components/home_screen_navbar.dart'; import 'package:flutter_course_app/components/lists/explore_course_list.dart'; import 'package:flutter_course_app/components/lists/recent_coruse_list.dart'; import 'package:flutter_course_app/constants.dart'; import 'package:flutter_course_app/screeens/continue_watching_screen.dart'; import 'package:flutter_course_app/screeens/sidebar_screen.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({ super.key, }); @override State<HomeScreen> createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin{ late Animation<Offset> sidebarAnimation; late Animation<double> fadeAnimation; late AnimationController sidebarAnimationController; var sidebarHidden = true; @override void initState() { // TODO: implement initState super.initState(); sidebarAnimationController = AnimationController( vsync: this, duration: Duration(milliseconds: 250), ); sidebarAnimation = Tween<Offset>( begin: Offset(-1, 0), end: Offset(0, 0), ).animate( CurvedAnimation(parent: sidebarAnimationController, curve: Curves.easeInOut) ); fadeAnimation = Tween<double>( begin: 0, end: 1, ).animate( CurvedAnimation(parent: sidebarAnimationController, curve: Curves.easeInOut) ); } //to prevent un necessary memory usage @override void dispose() { // TODO: implement dispose super.dispose(); sidebarAnimationController.dispose(); } @override Widget build(BuildContext context) { return Scaffold( body: Container( color: kBackgroundColor, child: Stack( children: [ SafeArea( child: Column( children: [ HomeScreenNavBar(triggerAnimation: (){ setState(() { sidebarHidden =! sidebarHidden; }); sidebarAnimationController.forward(); }), Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text("Recents", style: kLargeTitleStyle,), const SizedBox(height: 5,), Text("More courses ... ", style: kSubtitleStyle,), ], ), ), const SizedBox(height: 10,), RecentCourseList(), Padding( padding: const EdgeInsets.only( left: 20, right: 20, bottom: 16, top: 25 ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text('Explore', style: kTitle1Style,) ], ), ), ExploreCourseList(), ], ), ), ContinueWatchingScreen(), IgnorePointer( ignoring: sidebarHidden, child: Stack( children: [ FadeTransition( opacity: fadeAnimation, child: GestureDetector( onTap: (){ setState(() { sidebarHidden =! sidebarHidden; }); sidebarAnimationController.reverse(); }, child: Container( color: Color.fromRGBO(36, 38, 41, 0.4), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, ), ), ), SlideTransition( position: sidebarAnimation, child: SafeArea( child: SidebarScreen(), bottom: false, ), ), ], ), ), ], ), ), ); } }
0
mirrored_repositories/flutter_course_app
mirrored_repositories/flutter_course_app/lib/constants.dart
import 'package:flutter/material.dart'; // Colors const kBackgroundColor = Color(0xFFE7EEFB); const kSidebarBackgroundColor = Color(0xFFF1F4FB); const kCardPopupBackgroundColor = Color(0xFFF5F8FF); const kPrimaryLabelColor = Color(0xFF4F5455); const kSecondaryLabelColor = Color(0xFF797F8A); const kShadowColor = Color.fromRGBO(72, 76, 82, 0.16); const kCourseElementIconColor = Color(0xFF17294D); // Text Styles var kLargeTitleStyle = const TextStyle( fontSize: 28.0, fontWeight: FontWeight.bold, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text', decoration: TextDecoration.none, ); var kTitle1Style = const TextStyle( fontSize: 22.0, fontWeight: FontWeight.bold, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kCardTitleStyle = const TextStyle( fontFamily: 'SF Pro Text', fontWeight: FontWeight.bold, color: Colors.white, fontSize: 22.0, decoration: TextDecoration.none, ); var kTitle2Style = const TextStyle( fontSize: 20.0, fontWeight: FontWeight.bold, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kHeadlineLabelStyle = const TextStyle( fontSize: 17.0, fontWeight: FontWeight.w800, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text', decoration: TextDecoration.none, ); var kSubtitleStyle = const TextStyle( fontSize: 16.0, color: kSecondaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kBodyLabelStyle = const TextStyle( fontSize: 16.0, color: Colors.black, fontFamily: 'SF Pro Text', decoration: TextDecoration.none, ); var kCalloutLabelStyle = const TextStyle( fontSize: 20.0, fontWeight: FontWeight.w800, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kSecondaryCalloutLabelStyle = const TextStyle( fontSize: 16.0, color: kSecondaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kSearchPlaceholderStyle = const TextStyle( fontSize: 13.0, color: kSecondaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kSearchTextStyle = const TextStyle( fontSize: 13.0, color: kPrimaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, ); var kCardSubtitleStyle = const TextStyle( fontFamily: 'SF Pro Text' , color: Color(0xE6FFFFFF), fontSize: 13.0, decoration: TextDecoration.none, ); var kCaptionLabelStyle = const TextStyle( fontSize: 12.0, color: kSecondaryLabelColor, fontFamily: 'SF Pro Text' , decoration: TextDecoration.none, );
0
mirrored_repositories/flutter_course_app
mirrored_repositories/flutter_course_app/lib/main.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/home_screen.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Courseapp', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: HomeScreen(), ); } }
0
mirrored_repositories/flutter_course_app/lib
mirrored_repositories/flutter_course_app/lib/screeens/sidebar_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/components/sidebar_row.dart'; import 'package:flutter_course_app/constants.dart'; import 'package:flutter_course_app/model/sidebar.dart'; class SidebarScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( color: Colors.white.withOpacity(0.95), borderRadius: BorderRadius.only(topRight: Radius.circular(34, )) ), height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width*0.85, padding: const EdgeInsets.symmetric(vertical: 35, horizontal: 20), child: SafeArea( child: Column( children: [ Row( children: [ const CircleAvatar( backgroundImage: AssetImage('asset/images/profile.jpg'), radius: 35, ), const SizedBox(width: 10,), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Arshiajs' , style: kTitle1Style.apply(fontSizeDelta: 2),), Text('Flutter Developer', style: kHeadlineLabelStyle,), ], ) ], ), SizedBox(height: MediaQuery.of(context).size.height*0.1), SidebarRow(item: sidebarItem[0]), const SizedBox(height: 32,), SidebarRow(item: sidebarItem[1]), const SizedBox(height: 32,), SidebarRow(item: sidebarItem[2]), const SizedBox(height: 32,), SidebarRow(item: sidebarItem[3]), const Spacer(), Row( children: [ Image.asset('asset/icons/icon-logout.png', width: 20,), const SizedBox(width: 10,), Text("LogOut", style: kSecondaryCalloutLabelStyle,) ], ) ], ), ), ); } }
0
mirrored_repositories/flutter_course_app/lib
mirrored_repositories/flutter_course_app/lib/screeens/course_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/constants.dart'; import 'package:flutter_course_app/model/course.dart'; import 'package:flutter_course_app/screeens/course_sections_screen.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; class CourseScreen extends StatefulWidget { final Course course; CourseScreen({super.key, required this.course}); @override State<CourseScreen> createState() => _CourseScreenState(); } class _CourseScreenState extends State<CourseScreen> { Widget indicators() { List<Widget> indicators = []; for (var i = 0; i < 9; i++) { indicators.add(Container( width: 7.0, height: 7.0, margin: const EdgeInsets.symmetric(horizontal: 6.0), decoration: BoxDecoration( shape: BoxShape.circle, color: i == 0 ? const Color(0xFF0971FE) : const Color(0xFFA6AEBD)), )); } return Row( mainAxisAlignment: MainAxisAlignment.center, children: indicators, ); } late PanelController panelController; @override void initState() { // TODO: implement initState super.initState(); panelController = PanelController(); } @override Widget build(BuildContext context) { return Scaffold( body: Container( color: kBackgroundColor, child: SlidingUpPanel( controller: panelController, backdropEnabled: true, borderRadius: const BorderRadius.only(topLeft: Radius.circular(34)), color: kCardPopupBackgroundColor, boxShadow: const [ BoxShadow( color: kShadowColor, offset: Offset(0, -12), blurRadius: 32 ) ], minHeight: 0, maxHeight: MediaQuery.of(context).size.height*0.9, panel: CourseSectionScreen( ), body: SingleChildScrollView( child: Column( children: [ Stack( alignment: Alignment.bottomRight, children: [ Column( children: [ Padding( padding: const EdgeInsets.only(bottom: 20.0), child: Container( height: MediaQuery.of(context).size.height * 0.5, decoration: BoxDecoration(gradient: widget.course.background), child: SafeArea( bottom: false, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.symmetric( horizontal: 20.0, vertical: 20), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Container( padding: EdgeInsets.all(8), height: 60, width: 60, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(18)), child: Hero( tag: widget.course.logo, child: Image.asset( 'asset/logos/${widget.course.logo}'), )), ), const SizedBox( width: 10, ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Hero( tag: widget.course.courseSubtitle, child: Text( widget.course.courseSubtitle, style: kTitle1Style.copyWith( color: Colors.white), ), ), Hero( tag: widget.course.courseTitle, child: Text( widget.course.courseTitle, style: kTitle2Style.copyWith( color: Colors.black, fontSize: 22), ), ), ], )), GestureDetector( onTap: () { Navigator.pop(context); }, child: Container( width: 36, height: 36, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), color: kPrimaryLabelColor.withOpacity(0.5), ), child: const Icon( Icons.close, color: Colors.white, )), ), ], ), ), const SizedBox( height: 28, ), Expanded( child: Hero( tag: widget.course.illustration, child: Image.asset( 'asset/illustrations/${widget.course.illustration}', fit: BoxFit.cover, alignment: Alignment.topCenter, width: MediaQuery.of(context).size.width, ), )) ], ), ), ), ), ], ), Padding( padding: const EdgeInsets.symmetric(horizontal: 30.0), child: Container( padding: EdgeInsets.all(10), width: 60, height: 60, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(16), boxShadow: const [ BoxShadow( color: kShadowColor, blurRadius: 15, offset: Offset(0, 4), ) ] ), child: Image.asset('asset/icons/icon-play.png')), ), ], ), Padding( padding: const EdgeInsets.only( top: 12.0, left: 28.0, right: 28.0, bottom: 20 ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Row( children: [ Container( height: 58.0, width: 58.0, decoration: BoxDecoration( gradient: widget.course.background, borderRadius: BorderRadius.circular(29.0), ), child: Padding( padding: const EdgeInsets.all(4.0), child: Container( padding: const EdgeInsets.all(4.0), decoration: BoxDecoration( color: kBackgroundColor, borderRadius: BorderRadius.circular(29.0), ), child: const CircleAvatar( radius: 21.0, backgroundColor: kCourseElementIconColor, child: Icon( Icons.people , color: Colors.white, ), ), ), ), ), const SizedBox(width: 12.0), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "28.7k", style: kTitle2Style, ), Text( "Students", style: kSearchPlaceholderStyle, ), ], ) ], ), Row( children: [ Container( height: 58.0, width: 58.0, decoration: BoxDecoration( gradient: widget.course.background, borderRadius: BorderRadius.circular(29.0), ), child: Padding( padding: const EdgeInsets.all(4.0), child: Container( padding: const EdgeInsets.all(4.0), decoration: BoxDecoration( color: kBackgroundColor, borderRadius: BorderRadius.circular(29.0), ), child: const CircleAvatar( radius: 21.0, backgroundColor: kCourseElementIconColor, child: Icon( Icons.format_quote , color: Colors.white, ), ), ), ), ), const SizedBox(width: 12.0), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "12.4k", style: kTitle2Style, ), Text( "Comments", style: kSearchPlaceholderStyle, ), ], ) ], ), ], ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 28.0, vertical: 24.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ indicators(), GestureDetector( onTap: () { panelController.open(); }, child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.white, boxShadow: const [ BoxShadow( color: kShadowColor, offset: Offset(0, 12), blurRadius: 16.0, ) ], borderRadius: BorderRadius.circular(14.0), ), width: 80.0, height: 40.0, child: Text( "View all", style: kSearchTextStyle, ), ), ), ], ), ), Padding( padding: const EdgeInsets.symmetric(horizontal: 28.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "5 years ago, I couldn’t write a single line of Swift. I learned it and moved to React, Flutter while using increasingly complex design tools. I don’t regret learning them because SwiftUI takes all of their best concepts. It is hands-down the best way for designers to take a first step into code.", style: kBodyLabelStyle, ), const SizedBox( height: 24.0, ), Text( "About this course", style: kTitle1Style, ), const SizedBox( height: 24.0, ), Text( "This course was written for people who are passionate about design and about Apple's SwiftUI. It beginner-friendly, but it is also packed with tricks and cool workflows about building the best UI. Currently, Xcode 11 is still in beta so the installation process may be a little hard. However, once you get everything working, then it'll get much friendlier!", style: kBodyLabelStyle, ), const SizedBox(height: 24.0), ], ), ), ], ), ), ), ), ); } }
0
mirrored_repositories/flutter_course_app/lib
mirrored_repositories/flutter_course_app/lib/screeens/course_sections_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/components/lists/course_sections_list.dart'; import 'package:flutter_course_app/constants.dart'; class CourseSectionScreen extends StatelessWidget { const CourseSectionScreen({super.key}); @override Widget build(BuildContext context) { return Container( decoration: const BoxDecoration( color: kBackgroundColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(34)) ), child: Column( children: [ Container( padding: EdgeInsets.all(32), decoration: const BoxDecoration( color: kCardPopupBackgroundColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(34), bottomLeft: Radius.circular(34)), boxShadow: [ BoxShadow( color: kShadowColor, offset: Offset(0, 12), blurRadius: 32, ) ] ), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text("Course Section", style: kTitle1Style,), SizedBox(height: 5,), Text("12 Section", style: kSubtitleStyle,) ], ), ), CourseSectionList(), ], ), ); } }
0
mirrored_repositories/flutter_course_app/lib
mirrored_repositories/flutter_course_app/lib/screeens/continue_watching_screen.dart
import 'package:flutter/material.dart'; import 'package:flutter_course_app/components/certificate_viewer.dart'; import 'package:flutter_course_app/components/lists/continue_watching_list.dart'; import 'package:flutter_course_app/constants.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; class ContinueWatchingScreen extends StatelessWidget { const ContinueWatchingScreen({super.key}); @override Widget build(BuildContext context) { return SlidingUpPanel( backdropEnabled: true, borderRadius: const BorderRadius.only( topRight: Radius.circular(34), topLeft: Radius.circular(34) ), color: kCardPopupBackgroundColor, boxShadow: const [ BoxShadow( color: kShadowColor, offset: Offset(0, -12), blurRadius: 32 ) ], minHeight: 65, maxHeight: MediaQuery.of(context).size.height*0.75, panel: Column( children: [ Center( child: Padding( padding: const EdgeInsets.only( top: 12, bottom: 18 ), child: Container( width: 42, height: 4, decoration: BoxDecoration( color: Color(0xFFc5CBD6), borderRadius: BorderRadius.circular(2) ), ), ), ), const SizedBox(height: 20), Padding(padding: const EdgeInsets.symmetric(horizontal: 32), child: Text('Contiue Watching Screen', style: kTitle1Style,),), ContinueWatchingList(), const SizedBox(height: 20), Padding(padding: const EdgeInsets.symmetric(horizontal: 32), child: Text('Certificates', style: kTitle2Style,),), Expanded(child: CertificateViewer()), ], ), ); } }
0