@override Widget build(BuildContext context) { return Scaffold( body: Container( alignment: Alignment.center, child: Center( child: Card( margin: EdgeInsets.symmetric(horizontal: 35), child: Padding( padding: const EdgeInsets.all(20), child: Form( key: _formKey, child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, children: [ TextFormField( decoration: InputDecoration(labelText: 'Email'), validator: (value) { if (value .trim() .isEmpty) { return 'Please enter your email address'; } if (!RegExp(r'\S+@\S+\.\S+').hasMatch(value)) { return 'Please enter a valid email address'; } return null; }, onChanged: (value) => _userEmail = value, ), TextFormField( decoration: InputDecoration(labelText: 'Username'), validator: (value) { if (value .trim() .isEmpty) { return 'This field is required'; } if (value .trim() .length < 4) { return 'Username must be at least 4 characters in length'; } return null; }, onChanged: (value) => _userName = value, ), TextFormField( decoration: InputDecoration(labelText: 'Password'), obscureText: true, validator: (value) { if (value .trim() .isEmpty) { return 'This field is required'; } if (value .trim() .length < 8) { return 'Password must be at least 8 characters in length'; }
if (!RegExp(r'[a-z]').hasMatch(value) == true) { return "Password must be at least Lower case letter"; } if (!RegExp(r'\d').hasMatch(value) == true) { return "Password must be at least have number"; }
if (!RegExp(r'[A-Z]').hasMatch(value) == true) { return "Password must be at least have Uppercase letter"; } return null; }, onChanged: (value) => _password = value, ), TextFormField( decoration: InputDecoration(labelText: 'Confirm Password'), obscureText: true, validator: (value) { if (value.isEmpty) { return 'This field is required'; }
if (value != _password) { return 'Confimation password does not match the entered password'; }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- data-type=0 hide the delete button data-type=1 show the delete button -->
<li class="li_vessel" v-for="(item,index) in lists "data-type="0" :key="index">
<!-- "touchstart" is triggered when the finger touches the screen "touchend" is triggered when the finger leaves the screen "capture" is used for event capture -->
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Eliminate the default inner and outer margins */
margin: 0;
padding: 0;
}
body {
background: rgb(246, 245, 250);
}
.biggestBox {
overflow: hidden; /*Excess part is hidden*/
}
ul {
/* Eliminate ul default style */
list-style: none;
padding: 0;
margin: 0;
}
.li_vessel {
/* All styles 0.2 seconds slow motion*/
transition: all 0.2s;
}
/* =0 hide */
.li_vessel[data-type="0"] {
transform: translate3d(0, 0, 0);
}
/* =1 display */
.li_vessel[data-type="1"] {
/* The larger the -64px setting, the farther you can slide left. It is best to set the same value as the width and positioning distance of the delete button below*/
transform: translate3d(-64px, 0, 0);
}
/* Delete button */
.li_vessel .removeBtn {
width: 64px;
height: 103px;
background: #ff4949;
font-size: 16px;
color: #fff;
text-align: center;
line-height: 22px;
position: absolute;
top: 0px;
right: -64px;
line-height: 103px;
text-align: center;
border-radius: 2px;
}
/* Picture style on the left */
.contant {
overflow: hidden; /*eliminate the floating caused by the picture*/
class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or simply save your changes to "hot reload" in a Flutter IDE). // Notice that the counter didn't reset back to zero; the application // is not restarted. primarySwatch: Colors.blue, // This makes the visual density adapt to the platform that you run // the app on. For desktop platforms, the controls will be smaller and // closer together (more dense) than on mobile platforms. visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key); final String title; @override _MyHomePageState createState() => _MyHomePageState(); }
permute() { var permute = (v, {m = false}) { var p = -1, j, k, f, r, l = v.length, q = 1, i = l + 1; --i; q *= i; var x = [new List(l), new List(l), new List(l), new List(l)]; j = q; k = l + 1; i = -1; for (; ++i < l; x[2][i] = i, x[1][i] = x[0][i] = j /= --k) {
}
for (r = new List(q); ++p < q;) { r[p] = new List(l); i = -1; for (; ++i < l; --x[1][i] != --x[1][i]) { x[1][i] = x[0][i]; x[2][i] = (x[2][i] + 1) % l; if (x[3][i] != null) r[p][i] = m ? x[3][i] : v[x[3][i]]; f = 0; for ((x[3][i] = x[2][i]); !(f == 0); f = !f) { for (j = i; j == true; x[3][--j] == x[2][i] && (x[3][i] = x[2][i] = (x[2][i] + 1) % l && f == 1)) {
} } } }
return r; }; var perobjs = new List(); var perobjscnt = 0; var permobj = ''; for (var x = 0; x < permObj.length; x++) { permobj = permObj[x]["value"]; if (permobj != '') { perobjs.add(permobj); perobjscnt++; } } var pre = prefix["setprefix"].replaceAll(r'/\\x/g', '\n'); var suf = prefix["setsuffix"].replaceAll(r'/\\x/g', '\n'); var joinobjs = prefix["objdelimiter"].replaceAll(r'/\\x/g', '\n'); var joinperms = prefix["objjoin"].replaceAll(r'/\\x/g', '\n'); var out = permute(perobjs).map((objs) { return objs[0] != null ? objs.join(joinobjs) + "\n" : perobjs.join( joinobjs) + "\n"; }); setState(() { output = out = out.join(joinperms); }); controllerOutput.text = output; print(output); }
var todo = List<Widget>(); int _index = 0; void _add() { int keyValue = _index; permObj.add({'id': _index, 'value': '',}); var _formdataIndex = permObj.indexWhere((data) => data['id'] == keyValue); todo = List.from(todo) ..add(Column( key: Key("${keyValue}"), children: <Widget>[ ListTile( leading: Text('Name: '), title: TextField( onChanged: (val) { permObj[_formdataIndex]['value'] = val; }, ), ), ], )); setState(() => ++_index); }
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;usingSystem.Net;// make sure that using System.Net; is included usingSystem.Diagnostics;// make sure that using System.Diagnostics; is included namespaceHttpDownloadC{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}WebClientwebClient=newWebClient();privatevoidbutton1_Click(objectsender,EventArgse){webClient.DownloadProgressChanged+=newDownloadProgressChangedEventHandler(webClient_DownloadProgressChanged);webClient.DownloadFileCompleted+=newAsyncCompletedEventHandler(webclient_DownloadFileCompleted);// start download webClient.DownloadFileAsync(newUri(textBox1.Text),@"C:\\MYRAR.EXE");}voidwebClient_DownloadProgressChanged(objectsender,DownloadProgressChangedEventArgse){doublebytesIn=double.Parse(e.BytesReceived.ToString());doubletotalBytes=double.Parse(e.TotalBytesToReceive.ToString());doublepercentage=bytesIn/totalBytes*100;progressBar1.Value=int.Parse(Math.Truncate(percentage).ToString());}voidwebclient_DownloadFileCompleted(objectsender,AsyncCompletedEventArgse){MessageBox.Show("Saved as C:\\MYRAR.EXE","Httpdownload");}}}
hspeed=0; ShotTimer-=1; if keyboard_check(vk_left) hspeed=-4; if keyboard_check(vk_right) hspeed=4; if keyboard_check(vk_space) { if ShotTimer<0 { instance_create(x+sprite_width/2,y,objPlayerBullet); ShotTimer=15; } }
EnemyCount=instance_number(objInvader1)+instance_number(objInvader2)+instance_number(objInvader3)+instance_number(objInvader4)+instance_number(objInvader5); if EnemyCount=0 { //You would advance to the next level here if show_question("You have completed the demo.## Would you like to play again?") { game_restart(); } else { game_end(); } }
Collision Event with object objInvader1:
execute code:
if show_question("You have lost!##Would you like to play again?") { game_restart(); } else { game_end(); }
Collision Event with object objEnemyBullet:
execute code:
if show_question("You have lost!##Would you like to play again?") { game_restart(); } else { game_end(); }
No comments:
Post a Comment