Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.37 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class LoginScreen3 extends StatefulWidget {
  4. @override
  5. _LoginScreen3State createState() => new _LoginScreen3State();
  6. }
  7.  
  8. class _LoginScreen3State extends State<LoginScreen3>
  9. with TickerProviderStateMixin {
  10. @override
  11. void initState() {
  12. super.initState();
  13. }
  14.  
  15. Widget HomePage() {
  16. return new Container(
  17. height: MediaQuery.of(context).size.height,
  18. decoration: BoxDecoration(
  19. color: Colors.redAccent,
  20. image: DecorationImage(
  21. colorFilter: new ColorFilter.mode(
  22. Colors.black.withOpacity(0.1), BlendMode.dstATop),
  23. image: AssetImage('assets/images/mountains.jpg'),
  24. fit: BoxFit.cover,
  25. ),
  26. ),
  27. child: new Column(
  28. children: <Widget>[
  29. Container(
  30. padding: EdgeInsets.only(top: 250.0),
  31. child: Center(
  32. child: Icon(
  33. Icons.person_pin,
  34. color: Colors.white,
  35. size: 100.0,
  36. ),
  37. ),
  38. ),
  39. Container(
  40. padding: EdgeInsets.only(top: 20.0),
  41. child: new Row(
  42. mainAxisAlignment: MainAxisAlignment.center,
  43. children: <Widget>[
  44. Text(
  45. "الوصول الحكومي",
  46. style: TextStyle(
  47. color: Colors.white,
  48. fontSize: 20.0,
  49. ),
  50. ),
  51. Text(
  52. " نموذج",
  53. style: TextStyle(
  54. color: Colors.white,
  55. fontSize: 20.0,
  56. fontWeight: FontWeight.bold),
  57. ),
  58. ],
  59. ),
  60. ),
  61. new Container(
  62. width: MediaQuery.of(context).size.width,
  63. margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 150.0),
  64. alignment: Alignment.center,
  65. child: new Row(
  66. children: <Widget>[
  67. new Expanded(
  68. child: new OutlineButton(
  69. shape: new RoundedRectangleBorder(
  70. borderRadius: new BorderRadius.circular(30.0)),
  71. color: Colors.redAccent,
  72. highlightedBorderColor: Colors.white,
  73. onPressed: () => gotoSignup(),
  74. child: new Container(
  75. padding: const EdgeInsets.symmetric(
  76. vertical: 20.0,
  77. horizontal: 20.0,
  78. ),
  79. child: new Row(
  80. mainAxisAlignment: MainAxisAlignment.center,
  81. children: <Widget>[
  82. new Expanded(
  83. child: Text(
  84. "إنشاء حساب جديد",
  85. textAlign: TextAlign.center,
  86. style: TextStyle(
  87. color: Colors.white,
  88. fontWeight: FontWeight.bold),
  89. ),
  90. ),
  91. ],
  92. ),
  93. ),
  94. ),
  95. ),
  96. ],
  97. ),
  98. ),
  99. new Container(
  100. width: MediaQuery.of(context).size.width,
  101. margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 30.0),
  102. alignment: Alignment.center,
  103. child: new Row(
  104. children: <Widget>[
  105. new Expanded(
  106. child: new FlatButton(
  107. shape: new RoundedRectangleBorder(
  108. borderRadius: new BorderRadius.circular(30.0)),
  109. color: Colors.white,
  110. onPressed: () => gotoLogin(),
  111. child: new Container(
  112. padding: const EdgeInsets.symmetric(
  113. vertical: 20.0,
  114. horizontal: 20.0,
  115. ),
  116. child: new Row(
  117. mainAxisAlignment: MainAxisAlignment.center,
  118. children: <Widget>[
  119. new Expanded(
  120. child: Text(
  121. "تسجيل الدخول",
  122. textAlign: TextAlign.center,
  123. style: TextStyle(
  124. color: Colors.redAccent,
  125. fontWeight: FontWeight.bold),
  126. ),
  127. ),
  128. ],
  129. ),
  130. ),
  131. ),
  132. ),
  133. ],
  134. ),
  135. ),
  136. ],
  137. ),
  138. );
  139. }
  140.  
  141. Widget LoginPage() {
  142. return new Container(
  143. height: MediaQuery.of(context).size.height,
  144. decoration: BoxDecoration(
  145. color: Colors.white,
  146. image: DecorationImage(
  147. colorFilter: new ColorFilter.mode(
  148. Colors.black.withOpacity(0.05), BlendMode.dstATop),
  149. image: AssetImage('assets/images/mountains.jpg'),
  150. fit: BoxFit.cover,
  151. ),
  152. ),
  153. child: new Column(
  154. children: <Widget>[
  155. Container(
  156. padding: EdgeInsets.all(120.0),
  157. child: Center(
  158. child: Icon(
  159. Icons.headset_mic,
  160. color: Colors.redAccent,
  161. size: 50.0,
  162. ),
  163. ),
  164. ),
  165. new Row(
  166. children: <Widget>[
  167. new Expanded(
  168. child: new Padding(
  169. padding: const EdgeInsets.only(right: 40.0),
  170. child: new Text(
  171. "الرقم القومي",
  172. textDirection: TextDirection.rtl,
  173. style: TextStyle(
  174. fontWeight: FontWeight.bold,
  175. color: Colors.redAccent,
  176. fontSize: 15.0,
  177. ),
  178. ),
  179. ),
  180. ),
  181. ],
  182. ),
  183. new Container(
  184. width: MediaQuery.of(context).size.width,
  185. margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0),
  186. alignment: Alignment.center,
  187. decoration: BoxDecoration(
  188. border: Border(
  189. bottom: BorderSide(
  190. color: Colors.redAccent,
  191. width: 0.5,
  192. style: BorderStyle.solid),
  193. ),
  194. ),
  195. padding: const EdgeInsets.only(left: 0.0, right: 10.0),
  196. child: new Row(
  197. crossAxisAlignment: CrossAxisAlignment.center,
  198. mainAxisAlignment: MainAxisAlignment.start,
  199. children: <Widget>[
  200. new Expanded(
  201. child: TextField(
  202. obscureText: true,
  203. textAlign: TextAlign.left,
  204. decoration: InputDecoration(
  205. border: InputBorder.none,
  206. hintText: '297XXXXXXXXXXX',
  207. hintStyle: TextStyle(color: Colors.grey),
  208. ),
  209. ),
  210. ),
  211. ],
  212. ),
  213. ),
  214. Divider(
  215. height: 24.0,
  216. ),
  217. new Row(
  218. children: <Widget>[
  219. new Expanded(
  220. child: new Padding(
  221. padding: const EdgeInsets.only(right: 40.0),
  222. child: new Text(
  223. "كلمة السر",
  224. textDirection: TextDirection.rtl,
  225. style: TextStyle(
  226. fontWeight: FontWeight.bold,
  227. color: Colors.redAccent,
  228. fontSize: 15.0,
  229. ),
  230. ),
  231. ),
  232. ),
  233. ],
  234. ),
  235. new Container(
  236. width: MediaQuery.of(context).size.width,
  237. margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0),
  238. alignment: Alignment.center,
  239. decoration: BoxDecoration(
  240. border: Border(
  241. bottom: BorderSide(
  242. color: Colors.redAccent,
  243. width: 0.5,
  244. style: BorderStyle.solid),
  245. ),
  246. ),
  247. padding: const EdgeInsets.only(left: 0.0, right: 10.0),
  248. child: new Row(
  249. crossAxisAlignment: CrossAxisAlignment.center,
  250. mainAxisAlignment: MainAxisAlignment.start,
  251. children: <Widget>[
  252. new Expanded(
  253. child: TextField(
  254. obscureText: true,
  255. textAlign: TextAlign.left,
  256. decoration: InputDecoration(
  257. border: InputBorder.none,
  258. hintText: '*********',
  259. hintStyle: TextStyle(color: Colors.grey),
  260. ),
  261. ),
  262. ),
  263. ],
  264. ),
  265. ),
  266. Divider(
  267. height: 24.0,
  268. ),
  269. new Row(
  270. mainAxisAlignment: MainAxisAlignment.end,
  271. children: <Widget>[
  272. Padding(
  273. padding: const EdgeInsets.only(right: 20.0),
  274. child: new FlatButton(
  275. child: new Text(
  276. "نسيت كلمة المرور؟",
  277. style: TextStyle(
  278. fontWeight: FontWeight.bold,
  279. color: Colors.redAccent,
  280. fontSize: 15.0,
  281. ),
  282. textAlign: TextAlign.end,
  283. ),
  284. onPressed: () => {},
  285. ),
  286. ),
  287. ],
  288. ),
  289. new Container(
  290. width: MediaQuery.of(context).size.width,
  291. margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 20.0),
  292. alignment: Alignment.center,
  293. child: new Row(
  294. children: <Widget>[
  295. new Expanded(
  296. child: new FlatButton(
  297. shape: new RoundedRectangleBorder(
  298. borderRadius: new BorderRadius.circular(30.0),
  299. ),
  300. color: Colors.redAccent,
  301. onPressed: () => {},
  302. child: new Container(
  303. padding: const EdgeInsets.symmetric(
  304. vertical: 20.0,
  305. horizontal: 20.0,
  306. ),
  307. child: new Row(
  308. mainAxisAlignment: MainAxisAlignment.center,
  309. children: <Widget>[
  310. new Expanded(
  311. child: Text(
  312. "الدخول",
  313. textAlign: TextAlign.center,
  314. style: TextStyle(
  315. color: Colors.white,
  316. fontWeight: FontWeight.bold),
  317. ),
  318. ),
  319. ],
  320. ),
  321. ),
  322. ),
  323. ),
  324. ],
  325. ),
  326. ),],
  327. ),
  328. );
  329. }
  330.  
  331. Widget SignupPage() {
  332. return new ListView(
  333. children: <Widget>[
  334. Container(
  335. padding: EdgeInsets.all(10.0),
  336. child: Center(
  337. child: Icon(
  338. Icons.person_pin,
  339. color: Colors.redAccent,
  340. size: 30.0,
  341. ),
  342. ),
  343. ),
  344. new Text(
  345. "بيانات المولود",
  346. textAlign: TextAlign.center,
  347. style: new TextStyle(
  348. color: Colors.blue,
  349. fontSize: 20,
  350. fontWeight: FontWeight.bold,
  351. ),
  352. ),
  353. new Row(
  354. mainAxisAlignment: MainAxisAlignment.center,
  355. children: <Widget>[
  356. new Radio(
  357. value: 0,
  358. activeColor: Colors.red,
  359. ),
  360. new Text(
  361. 'ذكر',
  362. style: new TextStyle(fontSize: 16.0),
  363. ),
  364. new Radio(
  365. value: 1,
  366. ),
  367. new Text(
  368. 'أنثي',
  369. style: new TextStyle(
  370. fontSize: 16.0,
  371. ),
  372. ),
  373. ],
  374. ),
  375. new Row(
  376. children: <Widget>[
  377. new Expanded(
  378. child: new Padding(
  379. padding: const EdgeInsets.only(left: 40.0),
  380. child: new Text(
  381. "محل الولادة",
  382. style: TextStyle(
  383. fontWeight: FontWeight.bold,
  384. color: Colors.redAccent,
  385. fontSize: 15.0,
  386. ),
  387. ),
  388. ),
  389. ),
  390. ],
  391. ),
  392. new Container(
  393. width: MediaQuery.of(context).size.width,
  394. margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0),
  395. alignment: Alignment.center,
  396. decoration: BoxDecoration(
  397. border: Border(
  398. bottom: BorderSide(
  399. color: Colors.redAccent,
  400. width: 0.5,
  401. style: BorderStyle.solid),
  402. ),
  403. ),
  404. padding: const EdgeInsets.only(left: 0.0, right: 10.0),
  405. child: new Row(
  406. crossAxisAlignment: CrossAxisAlignment.center,
  407. mainAxisAlignment: MainAxisAlignment.start,
  408. children: <Widget>[
  409. new Expanded(
  410. child: TextField(
  411. obscureText: true,
  412. textAlign: TextAlign.left,
  413. decoration: InputDecoration(
  414. border: InputBorder.none,
  415. hintText: 'samarthagarwal@live.com',
  416. hintStyle: TextStyle(color: Colors.grey),
  417. ),
  418. ),
  419. ),
  420. ],
  421. ),
  422. ),
  423. Divider(
  424. height: 24.0,
  425. ),
  426. new Row(
  427. children: <Widget>[
  428. new Expanded(
  429. child: new Padding(
  430. padding: const EdgeInsets.only(left: 40.0),
  431. child: new Text(
  432. "تاريخ الميلاد",
  433. style: TextStyle(
  434. fontWeight: FontWeight.bold,
  435. color: Colors.redAccent,
  436. fontSize: 15.0,
  437. ),
  438. ),
  439. ),
  440. ),
  441. ],
  442. ),
  443. new Container(
  444. width: MediaQuery.of(context).size.width,
  445. margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0),
  446. alignment: Alignment.center,
  447. decoration: BoxDecoration(
  448. border: Border(
  449. bottom: BorderSide(
  450. color: Colors.redAccent,
  451. width: 0.5,
  452. style: BorderStyle.solid),
  453. ),
  454. ),
  455. padding: const EdgeInsets.only(left: 0.0, right: 10.0),
  456. child: new Row(
  457. crossAxisAlignment: CrossAxisAlignment.center,
  458. mainAxisAlignment: MainAxisAlignment.start,
  459. children: <Widget>[
  460. new Expanded(
  461. child: TextField(
  462. obscureText: true,
  463. textAlign: TextAlign.left,
  464. decoration: InputDecoration(
  465. border: InputBorder.none,
  466. hintText: '*********',
  467. hintStyle: TextStyle(color: Colors.grey),
  468. ),
  469. ),
  470. ),
  471. ],
  472. ),
  473. ),
  474. Divider(
  475. height: 24.0,
  476. ),
  477. new Row(
  478. children: <Widget>[
  479. new Expanded(
  480. child: new Padding(
  481. padding: const EdgeInsets.only(left: 40.0),
  482. child: new Text(
  483. "CONFIRM PASSWORD",
  484. style: TextStyle(
  485. fontWeight: FontWeight.bold,
  486. color: Colors.redAccent,
  487. fontSize: 15.0,
  488. ),
  489. ),
  490. ),
  491. ),
  492. ],
  493. ),
  494. new Container(
  495. width: MediaQuery.of(context).size.width,
  496. margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0),
  497. alignment: Alignment.center,
  498. decoration: BoxDecoration(
  499. border: Border(
  500. bottom: BorderSide(
  501. color: Colors.redAccent,
  502. width: 0.5,
  503. style: BorderStyle.solid),
  504. ),
  505. ),
  506. padding: const EdgeInsets.only(left: 0.0, right: 10.0),
  507. child: new Row(
  508. crossAxisAlignment: CrossAxisAlignment.center,
  509. mainAxisAlignment: MainAxisAlignment.start,
  510. children: <Widget>[
  511. new Expanded(
  512. child: TextField(
  513. obscureText: true,
  514. textAlign: TextAlign.left,
  515. decoration: InputDecoration(
  516. border: InputBorder.none,
  517. hintText: '*********',
  518. hintStyle: TextStyle(color: Colors.grey),
  519. ),
  520. ),
  521. ),
  522. ],
  523. ),
  524. ),
  525. Divider(
  526. height: 24.0,
  527. ),
  528. new Row(
  529. mainAxisAlignment: MainAxisAlignment.end,
  530. children: <Widget>[
  531. Padding(
  532. padding: const EdgeInsets.only(right: 20.0),
  533. child: new FlatButton(
  534. child: new Text(
  535. "Already have an account?",
  536. style: TextStyle(
  537. fontWeight: FontWeight.bold,
  538. color: Colors.redAccent,
  539. fontSize: 15.0,
  540. ),
  541. textAlign: TextAlign.end,
  542. ),
  543. onPressed: () => {},
  544. ),
  545. ),
  546. ],
  547. ),
  548. new Container(
  549. width: MediaQuery.of(context).size.width,
  550. margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 50.0),
  551. alignment: Alignment.center,
  552. child: new Row(
  553. children: <Widget>[
  554. new Expanded(
  555. child: new FlatButton(
  556. shape: new RoundedRectangleBorder(
  557. borderRadius: new BorderRadius.circular(30.0),
  558. ),
  559. color: Colors.redAccent,
  560. onPressed: () => {},
  561. child: new Container(
  562. padding: const EdgeInsets.symmetric(
  563. vertical: 20.0,
  564. horizontal: 20.0,
  565. ),
  566. child: new Row(
  567. mainAxisAlignment: MainAxisAlignment.center,
  568. children: <Widget>[
  569. new Expanded(
  570. child: Text(
  571. "SIGN UP",
  572. textAlign: TextAlign.center,
  573. style: TextStyle(
  574. color: Colors.white,
  575. fontWeight: FontWeight.bold),
  576. ),
  577. ),
  578. ],
  579. ),
  580. ),
  581. ),
  582. ),
  583. ],
  584. ),
  585. ),
  586. ],
  587. );
  588. }
  589.  
  590. gotoLogin() {
  591. //controller_0To1.forward(from: 0.0);
  592. _controller.animateToPage(
  593. 0,
  594. duration: Duration(milliseconds: 800),
  595. curve: Curves.bounceOut,
  596. );
  597. }
  598.  
  599. gotoSignup() {
  600. //controller_minus1To0.reverse(from: 0.0);
  601. _controller.animateToPage(
  602. 2,
  603. duration: Duration(milliseconds: 800),
  604. curve: Curves.bounceOut,
  605. );
  606. }
  607.  
  608. PageController _controller =
  609. new PageController(initialPage: 1, viewportFraction: 1.0);
  610. @override
  611. Widget build(BuildContext context) {
  612. return Container(
  613. height: MediaQuery.of(context).size.height,
  614. child: PageView(
  615. controller: _controller,
  616. physics: new AlwaysScrollableScrollPhysics(),
  617. children: <Widget>[LoginPage(), HomePage(), SignupPage()],
  618. scrollDirection: Axis.horizontal,
  619. ));
  620. }
  621. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement